-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Serial Monitor periodically corrupts post-ASCII output #589
Comments
This problem still remains, at least for Arduino Due |
I'd like to try to fix this one. I can see serial-monitor.exe is providing the proper binary characters, and the corruption is already present by the time the data reaches the frontend. Can someone like @kittaakos maybe point me towards instructions on how to debug the middleware layer? I think something in the binaryblob/json/utf8 encoding is going wrong in there. Thanks! |
You must build and start the IDE2 from the sources. For example:
If you use VS Code, you can start the app in debug mode via the
If you want to debug the backend, put a breakpoint here to see what is coming from the CLI's monitor, and here to see what is sent to the frontend. If you need additional input on how and why things work as they work, please ping the original authors of the feature: @AlbyIanna or @davegarthsimpson. |
Thanks so much @kittaakos. I was already building from github and using Code. I didn't realize those Code customizations were right there! The example program demonstrating this issue is actually not sending an increasing set of characters from bytes 128 to 255. It is sending UTF8 encoded versions of those bytes, because the sketch editor defaults to UTF8 encoding. I believe this is correct, as it appears the Arduino 1 IDE did the same. These are multibyte characters in UTF8. Because incoming serial data is packetized, sometimes the first part of a UTF8 encoded character arrives without the rest, and therefore cannot be decoded correctly. In this case, there is a bug in the UTF8 processing which attempts to decode it anyway, resulting in corruption. I am putting in a pull request which seems to fix the issue. Note: If the incoming serial data has any other encoding other than UTF8, it will never be displayed correctly in the serial monitor. If the serial monitor is meant to respect locales, then the hardcoded 'utf8' in the TextDecoder will not be sufficient. |
Describe the problem
🐛 When Serial Monitor is used to display characters past the ASCII range printed by a non-native USB board, corruption occurs at various non-fixed positions in the output.
To reproduce
🐛 Some of the characters are replaced by
�
:Expected behavior
All characters to be printed correctly by Serial Monitor all the time:
Arduino IDE version
Original report
2.0.0-beta.12-nightly.20211028
Last verified with
d6a4b0f (with serial-monitor 0.11.0)
Operating system
Windows
Operating system version
10
Additional context
I originally suspected the corruption might be caused by #375, but this bug persists even though that one has been resolved.
The delay duration has an influence on the position of the corruption and the manifestation is different from one board to another (less corruption on Leonardo and MKR, more on Nano Every).
The issue does not occur when using the Arduino IDE 1.8.19 Serial Monitor, even when the board is running the binary that produced the corrupted output in Arduino IDE 2.x (i.e., it's not related to the sketch having been compiled in Arduino IDE 2.x).
Originally reported at https://forum.arduino.cc/t/serial-monitor-difficulties-with-german-umlauts/870541
Additional reports:
Issue checklist
The text was updated successfully, but these errors were encountered: