Setting baudrate of Terminal


platform = espressif32
board = lolin32
framework = arduino

I’m using a Serial.begin(115200) and some Serial.println() since I was being used to it when using the Arduino platform.
Now I turned to use and I’m performing first steps. When I open the “Terminal” I’m seeing (in the time period the println() are occuring, not the actual printed text but some garbage as one is being used to see when the baud rate is wrong.

As a shot in the dark I changed the baudrate in Serial.begin to 9600, which made the println text appear correctly.

Where in the IDE can I set tha baudrate of the Terminal?

In your platformio.ini file, just add this line:

monitor_speed = 115200

Alternatively, when you run the pio device monitor command, you can specify the baud rate there too.

pio device monitor --baud 115200

You can abbreviate --baud to -b if you wish. The command pio device monitor --help is your friend. Always assuming that you execute the device monitor on the command line of course!

Obviously, the default baud rate is 9600 and this must agree with what you specify in your code.



For one, I tried this monitor_speed = 115200 to no avail.

Does platformio.ini have to be saved by some button or so?

It simply doesn‘t work.

Secondly, where does one issue the pio command?

Simply edit your platformio.ini as normandunbar said.

Then save the file like any other files by clicking on File / Save or by pressing the keyboard shortcut [CTRL]+[S].

To make the changes available to Platformio you need to close the monitor task by clicking on the trash bin icon:

Then re-open the monitor.
It should now start with a baudrate of 115200:

 *  Executing task: platformio device monitor 

--- Terminal on COM10 | 115200 8-N-1

To issue pio commands manually, click on the PlatformIO icon and click on New Terminal (listed in the section “Miscellaneous”):

Thanks. Saving the file and restarting the IDE helped.
Since I’m running under macOS I never know whether to use [CTRL]+[E] or ⌘+E, since copy/paste work on ⌘-C, ⌘-V resp.

I don;t use a Mac, but I assume (always a bad idea) that just saving the file should work with no need to restart the IDE. I’m on Linux, and never need to do anything other than CTRL+S to save the current file.

Any time you make a change to platformio.ini you will need to save it before compiling. Just to be on the safe side.


Sorry I made a typo. Of course it’s CTRL+S instead of CTRL+E.
Afaik CTRL is COMMAND on Mac?

About the only thing I know about Macs is that this key, ‘⌘’, is the command key, which is Windows/Linux CTRL key. :wink: So, yes, ⌘+S would save the current file.


1 Like