?Upload USB busy [Errno 16]?

My board is plugged in to the same named usb port that the Arduino IDE recognizes. upload_speed = 115200

I’m trying to overwrite the code that is currently running on the board. Which does use Serial.print().

Could that be why the port is busy?

Traceback (most recent call last):
  File "/Users/dave_j/.platformio/packages/tool-esptoolpy/esptool.py", line 3201, in <module>
    _main()
  File "/Users/dave_j/.platformio/packages/tool-esptoolpy/esptool.py", line 3194, in _main
    main()
  File "/Users/dave_j/.platformio/packages/tool-esptoolpy/esptool.py", line 2889, in main
    esp = chip_class(each_port, initial_baud, args.trace)
  File "/Users/dave_j/.platformio/packages/tool-esptoolpy/esptool.py", line 237, in __init__
    self._port = serial.serial_for_url(port)
  File "/Users/dave_j/.platformio/penv/lib/python3.7/site-packages/serial/__init__.py", line 88, in serial_for_url
    instance.open()
  File "/Users/dave_j/.platformio/penv/lib/python3.7/site-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 16] could not open port /dev/cu.usbserial-14220: [Errno 16] Resource busy: '/dev/cu.usbserial-14220'
*** [upload] Error 1

Is this the same serial port with which the upload works in Arduino IDE?

A firmware merely executing Serial.print() doesn’t make your USB-UART busy. Resource busy sounds liek another program is using the port (do you have a serial monitor open?) or broken drivers…

1 Like

No, the Arduino IDE was not running.

Yes, same port that works with the Arduino IDE.

Problem solved. After verifying that the serial monitor worked, I determined that the port and speed must be explicitly declared in the platformio.ini.

Thanks for your comments.