New user using serial monitor

Hi, got my program uploaded - it’s the microchip 4809 examples send/ receive on UART1. I clicked the PIO serial monitor icon and it opens and shows the following which is fine:

--- Available filters and text transformations: colorize, debug, default, direct, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at http://bit.ly/pio-monitor-filters
--- Miniterm on COM9  9600,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

so my question is, the program uploaded waits for a keyboard response (ON / OFF) and blinks a LED and returns a text message to the serial monitor. However when I type anything in the serial monitor window the text I type does not appear. I’m used to arduino serial monitor.

Perhaps there’s a setting I need?

thanks
Paul

Does it work there? (You can open the serial monitor standalone without needing to upload a program).

The only major difference between PlatformIO’s serial monitor (aka, miniterm.py) and Arduino’s serial monitor is that directly sends data on every keypress, not on enter. But you can make it behave the same by using a monitor_filters = send_on_enter directive in the platformio.ini.

Otherwise as a general sanity check, check the validity of

I.e., that COM9 is the right serial port (otherwise set monitor_port), that 9600 is the baud rate used in the firmware in Serial.begin() (otherwise set monitor_speed) and that the USB serial adapter is physically connected to the right pins on the target microcontroller (GND, TX, RX).

Thanks Max, i ran up the arduino sermon and set to 9600, it works I can send text and get the expected response from the 4809. I’ll experiment a bit with PIO tomorrow.
Paul

Hi Max, I tried playing with the settings, but I can’t get PIO serial monior to work, When I click the serial monitor icon (bottom left, two icons to right of the upload icon) I get this:

Executing task: C:\Users\Paul\.platformio\penv\Scripts\pio.exe device monitor <

--- Available filters and text transformations: colorize, debug, default, direct, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at http://bit.ly/pio-monitor-filters
--- Miniterm on COM9  9600,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---


But if I type anything, it doesn’t appear in the monitor window. If I press enter I get a message popup bottom rh corner of screen:
yellow tringle with exclamation The task Platformio: Monitor (SendReceive) is already active - terminate task or restart.

Also if I leave PIO and fire up arduino IDE and use the sermon there, it compains that COMport 9 is unavailable, which probably indicates PIO has captured it.

If I close the PIO serial monitor, the Arduino SerMon works fine, I can message the chip and get expected responses.

In PIO, I’ve tried the help menu Ctrl T followed by Ctrl H, but there’s not much I can see that would help.

thanks for any thoughts.
Paul

ok, I just got it working by removing the baud rate line in PIO.ini…weird
Paul

But, I still can’t get an echo of what I type, so I tried Ctrl+E (from help toggles), but that just opens a window at the top of the PIO Main window.
Any ideas on getting some visibility of what I type?
thanks
Paul

I started to use PuTTY and it seems to work fine. Can I integrate that with PIO and use it as the serial monitor?

thanks
Paul

I have managed to get the serial monitor working (by typing the command at the prompt with the --echo option rather than use the icon) it now echoes what I type and as a bonus that (for some reason) enables comms with the 4809 chip too.

So my new question is how do I configure the serial monitor in PIO.ini so that I can include --echo.
I tried

; note --echo is indented by two spaces - PK
monitor_options = 
  --echo

and although the serial monitor seems to recognise this (no error reported when it starts) It does not echo the keyboard and also seems to foul up Ctrl +T which opens a dialog at the top of the PIO window instead of showing the menu.

Does the serial monitor work in PIO? I guess it’s just me?

thanks
Paul

When I add this PlatformIO tells me

Warning! Ignore unknown configuration option `monitor_options` in section [env:Due]
--- Available filters and text transformations: colorize, debug, default, direct, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at http://bit.ly/pio-monitor-filters
--- Miniterm on COM18  9600,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

Because per doc it’s called monitor_flags. When I call it that, I immediately get the desired behavior.

thanks again for your help with this. The PIO document I found and followed was this one:
https://docs.platformio.org/en/latest/core/userguide/device/cmd_monitor.html

which has various mentions of customising PIO.ini, but not for the echo option.

I tried my best with the knowledge of Platformio I’ve gained, but some of the options are not intuitive, for instance in the document I’ve referenced --echo is referred to as an option, not as a flag, and that’s what led me to try

monitor_options = 
  --echo

--echo is an option when running the pio monitor command on the commandline – that’s why it’s in the CLI documentation. All options that are valid in the platformio.ini are listed in “platformio.ini” (Project Configuration File) — PlatformIO latest documentation.