Visual Studio Code pio upload and monitor both stopped working

Hey everyone,

I’ve been using Platformio for several years, mainly on Mac. A few months I transitioned from Atom to Visual Studio Code. Things have been going very well but just this morning upload and monitor with ESP32 stopped working completely on all projects.

My ini file:

platform = espressif32
board = featheresp32
framework = arduino
lib_deps =
upload_port = /dev/cu.SLAB_USBtoUART
monitor_speed = 115200

Error Log in terminal when uploading or attempting monitor:

Traceback (most recent call last):
  File "/Users/traviselliott/.platformio/packages/tool-esptoolpy/", line 34, in <module>
  File "/Users/traviselliott/.platformio/packages/tool-esptoolpy/esptool/", line 1032, in _main
  File "/Users/traviselliott/.platformio/packages/tool-esptoolpy/esptool/", line 674, in main
    esp = esp or get_default_connected_device(
  File "/Users/traviselliott/.platformio/packages/tool-esptoolpy/esptool/", line 920, in get_default_connected_device
    _esp = chip_class(each_port, initial_baud, trace)
  File "/Users/traviselliott/.platformio/packages/tool-esptoolpy/esptool/", line 302, in __init__
    self._port = serial.serial_for_url(port)
  File "/Users/traviselliott/.platformio/penv/lib/python3.9/site-packages/serial/", line 90, in serial_for_url
  File "/Users/traviselliott/.platformio/penv/lib/python3.9/site-packages/serial/", line 332, in open
  File "/Users/traviselliott/.platformio/penv/lib/python3.9/site-packages/serial/", line 517, in _reconfigure_port
termios.error: (22, 'Invalid argument')
*** [upload] Error 1

Any thoughts on what might have broke overnight? It does appear there was an update to Visual Studio Code. Latest version shows 1.83.1

I’m dead in the water and unable to resolve.

Usually this indicates hardware failure. In combination with Mac that means:

  1. to try a different USB cable (source, source)
  2. to connect it to a USB 2 port (source) or USB 2 Hub.

You’re right. I actually got a hold of a bad ESP32. It’s always the simplest thing I guess. Problem was it messed up the USB port on my MAC so it looked like all the modules were bad, but it was just one bad module that was messing up the port requiring reboot.

Thank you