Esp32 Serial monitor selects the wrong USB serial port

I’m new to this…not sure what information y’all need

  • Ubuntu 22.04 desktop
  • up to date, vscode 1.87.2 and platformio 6.1.13
  • using ESP32-S3-WROOM-1-N8R2

ESP32 development, upload, wifi, etc. is working fine…except if there is already a device using ttyUSB0.

The ESP32 board creates ttyACM0 when plugged in. Usually, there is already a device plugged into that uses ttyUSB0. It’s an ICOM IC-7300 transceiver which identifies as “Silicon Labs CP210x UART Bridge”.

The PlatformIO Upload process correctly uses ttyACM0, probably because platformio.ini has “upload_port = /dev/ttyACM0”

But the serial monitor uses ttyUSB0 if it is active and ttyACM0 only if ttyUSB0 is not in use.

Is there a way to force Serial Monitor use ttyACM0? or a way to blacklist ttyUSB0 for PlatformIO?

thanks,
jeff

https://docs.platformio.org/en/latest/projectconf/sections/env/options/monitor/monitor_port.html

not sure about black listing, but you can lock the pio project to a monitor port the same was you locked the upload port, just use “monitor_port”. If I understand what you want, something like this in your INI:

monitor_port = "/dev/ttyACM0”

that wont require a rebuild to take effect, but once you save, PIO might take a minute “re configuring”. Be advised, your next build will be long anytime you change the project INI.

ps–while your in there, consider adding: “monitor_raw=true” . This enables colorized serial prints through ESP_LOG(). Real game changer for readability on the monitor.