How to run PlatformIO serial monitor from the command line
First, activate the PlatformIO virtual environment which will give you access to the pio script:
run_pio_monitor.sh
source ~/.platformio/penv/bin/activateNow, if you have - for example - an environment called esp32dev listed in platformio.ini:
platformio_env_example.ini
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduinoyou can build & upload using the following code:
run_pio_monitor_cmd.sh
pio run -e esp32dev -t monitorYou can also combine both commands (the virtual env activation and the pio run command) into a single line of shell script:
run_and_monitor.sh
source ~/.platformio/penv/bin/activate && pio run -e esp32dev -t monitorCheck out similar posts by category:
PlatformIO
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow