Open mintakka opened 3 years ago
Discussed on discord (thanks @mintakka). It looks like if we just sort the ports it should work. My experience has been that MacOS always assigns a higher-numbered port to the CDC2 device.
Alternatively, we can use the lookup code in https://github.com/pyserial/pyserial/pull/566/files.
This problem will occur on other OS's as well. My experience has been that they also assign a lower port or device number to the REPL channel, so sorting should work in general, though if we can look up the interface name, that would be best.
On a Mac, if the Mu editor is open and connected, then the notebook kernel doesn't seem to want to play.
I'm not sure what happens if you have more then one notebook open at any one time?
This is also a problem when using the USB_cdc circuitpython library.
The kernel tries to select /dev/ttyACM1, which I'm using as a serial data transport, instead of the correct /dev/ttyACM0 that the REPL is available on.
Description
I am trying to use a Feather M4 Express with circuitpython (version 6.1.0) and Jupyter. I am intermittently having an issue where the kernel fails to automatically connect to the correct CDC port (circuitpython is presenting on two ports in my OS).
What I Did
Here are my serial ports:
Here is an instance where the kernel automatically attempted to connect to the usbmodem140303 port. Notebook commands run in this state hang and never complete. It seems like the kernel always connects to whichever port for the board is listed first. In this error case, that is usbmodem14303. If the other port, usbmodem14301 is listed first, then the jupyter kernel will attempt to connect to that one. In that state things are functional.