-
Notifications
You must be signed in to change notification settings - Fork 236
Serial Monitor crashes when receiving invalid UTF-8 #1338
Comments
Same Problem with v0.4.4, vscode 1.60.0 |
I was having the same issue, until I noticed this in the documentation for the extension settings:
Changing my Interestingly, changing the |
Same issue here even using the default 115200 baud rate. [Starting] Opening the serial port - COM4 No other output. I hit reset on the esp8266, and no output. With the monitor still running, I open the Arduino IDE and the serial monitor in the IDE connects and works fine. If vscode were actually connecting to the COM port, the IDE should be giving an error that the port is already in use. |
@adiazulay FYI - I created this issue based on your request in the issue linked in my OP. Because of this issue, I have haven't used VSCode for my Arduino development for 3 months now. However, I'd love to get back to using it again. Can you comment? FYI my environment is now: vsCode: 1.62.3 |
@hoekma Thanks for reaching out, I'm actually no longer the maintainer of this repo, but @benmcmorran might be able to help you. |
I see the same issue happening on Linux. The serial monitor connects, but shows no data from the serial port. However, when I close the serial monitor, reset my serial device and then reopen serial monitor, I do get output. Looking at this code I found the call used to start the monitor: When I run this in a linux console like so: It works, but crashes when I reset the device:
So, at least on my system, this looks like a bug or rather a missing recover feature in I tried
|
This works for me now. I just get a notice |
I just realized: When using the Arduino IDE, the serial monitor also has a pause (or silent reconnect), because serial output at the start of the device program is never received, unless a delay is placed in the device program. |
@benmcmorran Any thoughts on getting the serial monitor working for VSCode for mac? |
@hoekma I'm on vacation until the end of the year, but I should be able to
take a look at this in January. @aleun helped with the initial move to
serial-monitor-cli and might also have ideas. Finally, if this worked for
you on an older version of the extension, you can try downloading an older
release from https://github.com/microsoft/vscode-arduino/releases and see
if that works as a workaround until we can fix the extension.
…On Thu, Dec 9, 2021 at 7:44 PM hoekma ***@***.***> wrote:
@benmcmorran <https://github.com/benmcmorran> Any thoughts on getting the
serial monitor working for VSCode for mac?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1338 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVINJHHHD7LLBQNU4NCMDLUQFZTBANCNFSM5DJPMVGA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I'm trying to get an arduino uno to sending data (preferably in json-format) to my laptop (running ubuntu) to plot the data with a python script. However I found the issue that when uploading with vscode there will be no output on neither the extension's monitor nor the serial monitor of the arduino IDE. As it appears to me, the extension has some problem in either compiling or uploading 'Serial.print()'- statements, as well as some (maybe timing-related) problem in actually displaying incoming data, presumably because of the restarts (that come with starting the monitor) causing the monitor to crash (as @Rembunator found out). (So I think it is timing-based because very few times it inexplicably does work, while most times it doesn't.) I'm currently using:
Edit on 12/15/2021: |
@Joneffxn But I took a closer look at the data that was being decoded. After every reset, a lot of gibberish (initialization?) comes in first like this: It seems to always end with a sequence starting with BTW I tested resetting the device about 30 times in a row and the decoding exception was raised every time. |
We shipped v0.4.9 of the extension yesterday. It includes #1412 to throttle the rate at which the extension tries to write to the serial monitor, which helps avoid the situation where no data appears in the serial monitor until the connection is closed. Can you try updating to v0.4.9 and let me know if you're still seeing issues? |
Same issue of silent serial monitor with : and extension v0.4.10 |
Thanks all for reports. This certainly looks like an issue with serial monitor assuming a UTF-8 encoding. Looping in @gcampbell-msft who has been working on other serial monitor changes. |
We expect that microsoft/serial-monitor-cli#12 will fix this issue. |
Hi, my VS Code 1.64.1 with Arduino extension v0.4.10 experienced the same behaviour: When clicked to open the serial monitor and reseted teh device (ESP8266 in my case), no output i shown. I have increased the Developer Log Level to 'trace' and ther is en exception related to this extension in |
@milanbx based on the stack trace you provided the issue you're seeing isn't related to UTF-8 encoding. I'm moving your report to a new issue. |
This issue has been fixed in the latest release of this extension, which is available in the VS Code extension marketplace. |
Hello
|
@benmcmorran Thank you for working on this. I am trying this now on versions 0.4.11 and 0.4.0 with no luck. Can you advise which version you tested this on? |
@netcrawler00, @benmcmorran I have tried this again on Arduino version 1.64.2 and extension 0.4.11 and all works fine, port selection and also serial output. As for the serial output, I have added following delay to my sketch to give the COM some time to start properly: Serial.begin(115200);
delay(700);
Serial.println("\n-------------------------------"); 1000 ms was too much, 600 ms too little to display the first init-like output line. |
I edited my last comment, the mistake was on my side. Bug closed for me. |
Similar to issue #1293
When connecting to the serial port on my macBook Pro using both ports /dev/cu.SLAB_USBtoUART and /dev/cu.usbserial-0001 I do not see any serial output. When connecting, I see the follwing:
[Starting] Opening the serial port - /dev/cu.usbserial-0001
or
[Starting] Opening the serial port - /dev/cu.SLAB_USBtoUART
Then no serial output. Serial output does work when connected through the Arduino app. Both are connecting at 115200.
Note: I CAN see the led on my device flash off and then back on when connecting, suggesting it is communicating with the device via serial, however my Serial.println() and Serial.print() output is not displaying in the output.
vsCode: 1.59.1
Arduino plugin: v0.0.4 Preview
Device: ESP32
The text was updated successfully, but these errors were encountered: