-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testBLE_uart sketch fails to compile #17
Comments
What compiler are you using? Arduino IDE would generate a warning but still compiles. I've modified it to String to clear the warning. |
I'm using the Arduino IDE v2..3.2. I also use the arduino-cli but not on this issue. std::string rxValue = pCharacteristic->getValue(); will never compile because there's no conversion from String to stl::string. There's another warning on char * genBleID(int suffixDigits = 2, char prefix[] = CONNECTION_NAME) because CONNECTION_NAME is a string literal, and the pointer isn't const. that's a different issue. |
I am able to compile the testBLE_uart.ino using either Arduino IDE 2.2.1 or Arduino IDE 1.8.19. Target Board (under Tools menu) is the Arduino ESP32 > ESP32 Dev Module. I get no warnings. In Windows 10, this is the path to the tool which indicates what compiler version I am using: ...\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\esp-2021r2-patch5-8.4.0 |
I'm attaching the error log for completeness. I'm at a loss for words here. This needs to be nailed down. From my perspective, this is a C++ language issue. I would argue a compiler that accepts the code in question is broken. The code in question (which is the code that git says was changed) is The function BLECharacteristic::getValue returns a String object. The statement can be simplified to make it more direct: If the compiler doesn't declare this as an error then I don't know what it's doing. |
Have you been able to try my fix, which was uploaded yesterday? |
Yes. Sorry for the delay; distractions on my end Sketch uses 1115061 bytes (85%) of program storage space. Maximum is 1310720 bytes. The issue is resolved from my POV. |
I found a bug in sending long 'K'-token skills via the mobile app after the modification. |
I don't understand. I don't see how std::string rxValue = pCharacteristic->getValue(); can ever legitimately compile. There's no conversion from String to std::string. |
It's used in the main program to receive commands from the mobile app. The
bug raises when receiving long skill data after token 'K'.
I haven't figured out why the String method fails. So, I rolled back to the
std::string method.
…On Mon, Jul 29, 2024 at 11:19 PM FlexoTim ***@***.***> wrote:
I don't understand.
testBLE_uart doesn't send skill data.
I don't see how
std::string rxValue = pCharacteristic->getValue();
can ever legitimately compile. There's no conversion from String to
std::string.
—
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACKLZGGB4JPB2DQWAYRJY4TZOZMPBAVCNFSM6AAAAABJFCTIWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJWGIZDCNZVG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
~~
Rongzhong Li, PhD
http://borntoleave.github.io
|
We need to get on the same page in terms of
communication.
I would call that a related issue but not an issue in testBLE_uart. This is
your repository and process, so it's up to you but I would log the error as
a related issue against OpenCatEsp32. I just want the error to be as
specific as possible.
Is this happening in the existing code or new code? In other words, can I
replicate this behavior with my code base? I need more detail about how to
replicate the issue or analyze the code.
I'm going to make an assumption that this is related to the new arm
attachment. The new DOF and weight affects skills and gait, etc. and may
uncover new or old issues. Do I need to look at a different code branch?
I think we want to try to isolate the issue to either the BLE interface or
the skill data processing.
I say this because in order for me to do something here I need to see the
new code and see if I can spot the error, or somehow replicate the behavior.
I understand reverting the code back to std:string to see if that's the
cause. What was the result? Same or different behavior? I would suspect the
same.
In any case, I'll help as best I can but I need something to work with,
i.e., some code.
We can communicate via email rather than through the repository or continue
through the repository. It's up to you.
Tim
On Wed, Jul 31, 2024 at 6:27 AM Rongzhong Li ***@***.***>
wrote:
… It's used in the main program to receive commands from the mobile app. The
bug raises when receiving long skill data after token 'K'.
I haven't figured out why the String method fails. So, I rolled back to
the
std::string method.
On Mon, Jul 29, 2024 at 11:19 PM FlexoTim ***@***.***> wrote:
> I don't understand.
> testBLE_uart doesn't send skill data.
>
> I don't see how
>
> std::string rxValue = pCharacteristic->getValue();
>
> can ever legitimately compile. There's no conversion from String to
> std::string.
>
> —
> Reply to this email directly, view it on GitHub
> <
#17 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/ACKLZGGB4JPB2DQWAYRJY4TZOZMPBAVCNFSM6AAAAABJFCTIWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJWGIZDCNZVG4>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
--
~~
Rongzhong Li, PhD
http://borntoleave.github.io
—
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BIH3YD5R5J5Q3G626DYARSDZPC3ZLAVCNFSM6AAAAABJFCTIWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRQGE4DQMRSHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi,
I have isolated the problem to that specific line of code:
[image: Screenshot 2024-08-01 at 14.48.42.png]
The main program crashes when sensing 'K' token commands with large numbers
of skill data. Switching between these two lines reproduces and resolves
the problem.
Some bytes must be changed when converting between std:string and Arduino
String.
…On Thu, Aug 1, 2024 at 12:03 AM FlexoTim ***@***.***> wrote:
I'm doing this privately so we can get on the same page in terms of
communication.
I would call that a related issue but not an issue in testBLE_uart. This
is
your repository and process, so it's up to you but I would log the error
as
a related issue against OpenCatEsp32. I just want the error to be as
specific as possible.
Is this happening in the existing code or new code? In other words, can I
replicate this behavior with my code base? I need more detail about how to
replicate the issue or analyze the code.
I'm going to make an assumption that this is related to the new arm
attachment. The new DOF and weight affects skills and gait, etc. and may
uncover new or old issues. Do I need to look at a different code branch?
I think we want to try to isolate the issue to either the BLE interface or
the skill data processing.
I say this because in order for me to do something here I need to see the
new code and see if I can spot the error, or somehow replicate the
behavior.
I understand reverting the code back to std:string to see if that's the
cause. What was the result? Same or different behavior? I would suspect
the
same.
In any case, I'll help as best I can but I need something to work with,
i.e., some code.
We can communicate via email rather than through the repository or
continue
through the repository. It's up to you.
Tim
On Wed, Jul 31, 2024 at 6:27 AM Rongzhong Li ***@***.***>
wrote:
> It's used in the main program to receive commands from the mobile app.
The
> bug raises when receiving long skill data after token 'K'.
>
> I haven't figured out why the String method fails. So, I rolled back to
> the
> std::string method.
>
> On Mon, Jul 29, 2024 at 11:19 PM FlexoTim ***@***.***> wrote:
>
> > I don't understand.
> > testBLE_uart doesn't send skill data.
> >
> > I don't see how
> >
> > std::string rxValue = pCharacteristic->getValue();
> >
> > can ever legitimately compile. There's no conversion from String to
> > std::string.
> >
> > —
> > Reply to this email directly, view it on GitHub
> > <
>
#17 (comment)>,
>
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/ACKLZGGB4JPB2DQWAYRJY4TZOZMPBAVCNFSM6AAAAABJFCTIWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJWGIZDCNZVG4>
>
> > .
> > You are receiving this because you commented.Message ID:
> > ***@***.***>
> >
>
>
> --
> ~~
> Rongzhong Li, PhD
> http://borntoleave.github.io
>
> —
> Reply to this email directly, view it on GitHub
> <
#17 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/BIH3YD5R5J5Q3G626DYARSDZPC3ZLAVCNFSM6AAAAABJFCTIWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRQGE4DQMRSHE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACKLZGBXNA7IUCEBCJ5LBATZPEDDVAVCNFSM6AAAAABJFCTIWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRQHA3DKNBUGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
~~
Rongzhong Li, PhD
http://borntoleave.github.io
|
I can't see the screenshot file. I can't replicate the issue without the data used to produce it. What's necessary to replicate what "long skill" command means? I'm suspicious about how the write of the BLE characteristic is involved with reading skill data. Does this happen with the UART? If it's a problem with the program memory footprint then it will resurface in some other location. If it's a conversion issue, then it should be testable outside of the BLE API. |
A test command can be imported as a customized mobile app button: |
The sketch contains an stl::string variable which is illegal.
The text was updated successfully, but these errors were encountered: