Serial Monitor not working

I’ll join this discussion since I have the same problem, I’m on Linux though.

Your suggested commands show the expected output (counter going up, one in hex one showing the received chars).

No updates. Maybe a permission problem?

Do you mean that it works with pio device monitor --encoding hexlify and doesn’t work with pio device monitor?

No, from the command line it works for any case, at the moment I am using pio device monitor --baud 115200 and stop/start before/after programming to debug.

What doesn’t work is the serial monitor within the IDE (clicking on the little plug on the lower left)

1 Like

Success!
I have updated PlatfornIO with the latest software and the Serial Monitor and Terminal are both working perfectly
Thanks for all your support!

For me this problem has now appeared.
Background is: I uninstalled VSCode as well as all directories and reinstalled Atom and PIO.
Everything is working well.
However when I try to use the serial monitor (Shift+CMD+M) it is black text (I think) on black background.
I have tried several themes. The effect is the same: Background can be green, text is still invisible. Only the cursor is visible. Using any external terminal works fine. Problem is the same on Terminal (Shift+CMD+T) Also the build terminal works fine (White text, Black background. Have only seen this since a fresh install yesterday, Home 0.9.5·Core 3.5.3b2. Have tried a few different Terminal Themes. Does not solve the problem.

I am having the same problem with serial monitor / just see a blinking cursos

  • All sw up-2-date
  • Tried different themes
  • Serial port works with other monitors
  • Serial monitor ports and baudrate is properly detected

Also the terminal does not work with my platformio (blinking cursos).
Hope somebody has some suggestion?

Thanks

Does it work when you invoke miniterm.py directly? (i.e. try miniterm.py <your device file> <your baud rate>)

This is a problem with Atom. Please switch to A professional collaborative platform for embedded development · PlatformIO

Your solution is to switch to a Microsoft product? That’s not really a solution is it?

Could you provide a simple code to reproduce this issue?

Its a regression from an update you pushed ~ 25 days ago.

Could you provide more details? Which version does work for you?

When I click the plug icon in Atom to connect to a Mayfly board the PlatformIO: Serial Monitor window comes up with the correct port and baudrate but when I click start I only get a black box with a blinking cursor. I can successfully run the serial monitor with my Arduino IDE and VS Code so it’s not a hardware problem. Any ideas?

Identical symptoms as @aktentasche. VSCode

But only on the RaspberryPi pico defined as below. UNO and TEENSY configurations in the same project both work normally.

[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0.2m
platform_packages =
maxgerhardt/framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git
maxgerhardt/toolchain-pico@https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz
lib_deps = mikalhart/TinyGPSPlus@^1.0.3

--filter hexlify

also only seems to work with 7-bit ASCII bytes. Anything over 127 and it prints “??”.

Printing the hex value of any byte fed to the Serial object would be a useful tool. I’m sure there is a lib that does some printf somewhere.

Interestingly, if one does an “Upload” followed by the “Monitor” from the left side “Project Tasks” “General” area, Monitor seems to work at least most of the time. Perhaps there is a timing issue in the mix.

When the “Upload and Monitor” task is done, there is never any Monitor output.

The Pico implements USB itself so special care must be taken. Do you use while(!Serial) {} in the setup() code before printing anything so that it waits for the USB connection to be established? Also, since USB setup takes a while, the “Upload and Monitor” task will likely not directly pick up the device directly after the flash process, since it needs more time. Better to use upload, then monitor. If the serial waits properly, no data should be lost.

@maxgerhardt , thank you. I noticed that Serial activity in setup() never prints with the Pico. As noted, I did suspect a timing issue. I work a lot with commercial radio equipment and each manufacturer’s control protocol has it’s own set of interesting “features”, so it is not really a surprise to find differences.

Thank you for the reminder about waiting for Serial to wake up. That is helpful also.

Perhaps the PlatformIO could specify a timing parameter for use between Upload completed and Monitor start as part of the overall configuration. Adding a few ms to the process for all boards would likely not be an aggravation for those of us who use many different pieces of hardware.

Thanks to ALL involved for ALL of this hard work. It is creating great fun and valuable frustration for me, and firing more neurons to boot! :slight_smile: Just an excellent suite of tools.

Regards,

Mitch

This is already possible with a tiny bit of scripting: Teensy 4.1 Unit Testing Issue - #5 by maxgerhardt

Also see the tiny bit of script at the bottom of Add test start delay option · Issue #3742 · platformio/platformio-core · GitHub that waits for the monitor_port specified in the platformio.ini.

Continuing the discussion from Serial Monitor not working:

This helped me in platformio.ini:
[env:nodemcuv2]
platform=espressif8266
board = nodemcuv2
framework=arduino

monitor_speed = 115200
monitor_rts = 0
monitor_dtr = 0

1 Like