No processes running / resource busy

I’m trying this with multiple boards. Seeduino XIAO ESP32C3 as well as D1 Mini ESP32. My Sketch won’t upload with PlatformIO. Using Mac OS Sonoma 14.2.1 When doing so I suddenly get. After it has been working for the last… weeks?

A fatal error occurred: Could not open /dev/tty.usbmodem1101, the port is busy or doesn't exist.
([Errno 16] could not open port /dev/tty.usbmodem1101: [Errno 16] Resource busy: '/dev/tty.usbmodem1101')

Uploading with the Arduino IDE works. I shut down the Arduino IDE, so it can’t be that there is a serial monitor blocking the port. I also rebooted my mac.
ls -l /System/Library/Extensions/SiLabsUSBDriver.kext and ls -l /Library/Extensions/SiLabsUSBDriver.kext

Gives no results.

The thing is, that this worked once. so apparently something got blocked. i just can’t say what. There is no python or platformio process running that would indicate that something is blocking.
Interestingly i just shut down vscode and upload worked. But not reproducable.

lsof /dev/tty.usbserial-0264D1KX

produces no output.

My platformio.ini is:

[env:d1]
platform = espressif32
board = wemos_d1_mini32
framework = arduino
lib_deps = 
	khoih-prog/ESP32TimerInterrupt@^2.3.0
	https://github.com/leandcesar/PeakDetection
upload_port = /dev/tty.usbserial-0264D1KX
monitor_port = /dev/tty.usbserial-0264D1KX
monitor_speed = 115200

I’m not using a Mac but I think it is required to grant permission to access USB devices.

I have noticed that there is a difference between the port used and the one specified in your platformio.ini

/dev/tty.usbmodem1101 vs. /dev/tty.usbserial-0264D1KX ?!

turns out my problem was that i caused a coredump during setup() which means that the board was stuck in a reboot loop and to add to that somehow the boot button on the xiao esp32c3 wouldn’t work properly… my bad.