Serial Monitor not working

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