Arduino opens serial port; python cannot find it

MacOS Ventura 13.6.2 on M2 silicon.

I have an OV7670 board connected to Arduino Nano 33 BLE Sense. I communicate with the Arduino over /dev/tty.usbmodem1101 (aka /dev/cu.usbmodem1101.)

Python (using colab) returns "No such file or directory: '/dev/tty.usbmodem1101'" when I try to open the serial port.

I have a pushbutton that the Arduino code is polling for, so I can tell that the serial port is still open/functional.

I tried multiple ports on the Mac just in case one has some limited capabilities, but they all return the same message.

What am I missing here?

If you have opened the serial monitor the serial monitor in the arduino-ide the IDE occupies the port.
Hence other software can't use it.

1 Like

I closed the IDE and re-opened/re-compiled without opening the serial monitor. I still see the same error message. If it told me the port was in use, I think that might be the answer, but it can't find it at all.

From command line:

MacBook-Pro-5:~ xxx$ python -m serial.tools.list_ports
/dev/cu.Bluetooth-Incoming-Port
/dev/cu.GalaxyBudsLiveEEBF
/dev/cu.usbmodem1101

Inside python:

import serial.tools.list_ports
ports = serial.tools.list_ports.comports()
for p in ports:
print(p.device)
print(len(ports), 'ports found')

returns: "0 ports found"

Unclear why there would be inconsistency between the two.

Anyways, I ran this in PyCharm and it worked. No idea what's wrong with colab.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.