Skip to content

Multiple CDC ports causing issues with Jupyter kernel? #28

@mintakka

Description

@mintakka
  • CircuitPython Kernel version: 0.5.1
  • Python version: 3.6.13 (conda environment)
  • Operating System: macOS 11.2

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:

❯ pio device list
/dev/cu.Bluetooth-Incoming-Port
-------------------------------
Hardware ID: n/a
Description: n/a

/dev/cu.usbmodem14303
---------------------
Hardware ID: USB VID:PID=239A:8026 SER=4CBE1F385364933502020233339110FF LOCATION=20-3
Description: Feather M4 Express - CircuitPython CDC2 data

/dev/cu.usbmodem14301
---------------------
Hardware ID: USB VID:PID=239A:8026 SER=4CBE1F385364933502020233339110FF LOCATION=20-3
Description: Feather M4 Express - CircuitPython CDC2 data

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.

circuitpy ❯ jupyter notebook
[I 15:34:47.261 NotebookApp] Serving notebooks from local directory: /Users/MYNAME/Desktop
[I 15:34:47.261 NotebookApp] Jupyter Notebook 6.2.0 is running at:
[I 15:34:47.261 NotebookApp] http://localhost:8888/?    token=28f9c073a686bd4938db0b8574b4158b08d286b24f46e205
[I 15:34:47.261 NotebookApp]  or http://127.0.0.1:8888/?    token=28f9c073a686bd4938db0b8574b4158b08d286b24f46e205
[I 15:34:47.261 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 15:34:47.264 NotebookApp] 

    To access the notebook, open this file in a browser:
        file:///Users/MYNAME/Library/Jupyter/runtime/nbserver-26094-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=28f9c073a686bd4938db0b8574b4158b08d286b24f46e205
     or http://127.0.0.1:8888/?token=28f9c073a686bd4938db0b8574b4158b08d286b24f46e205
[W 15:34:48.781 NotebookApp] 404 GET /apple-touch-icon-precomposed.png (::1) 8.050000ms referer=None
[W 15:34:48.785 NotebookApp] 404 GET /apple-touch-icon.png (::1) 1.250000ms referer=None
[I 15:34:54.107 NotebookApp] Creating new notebook in 
[I 15:34:55.045 NotebookApp] Kernel started: 412927db-5709-4a7c-b62e-cf65d6c6e615, name: circuitpython
DEBUG:asyncio:Using selector: KqueueSelector
DEBUG:asyncio:Using selector: KqueueSelector
DEBUG:circuitpython_kernel.kernel:circuitpython_kernel version 0.3.0.dev
DEBUG:circuitpython_kernel.board:/dev/cu.Bluetooth-Incoming-Port
DEBUG:circuitpython_kernel.board:/dev/cu.usbmodem14303
DEBUG:circuitpython_kernel.board:CircuitPython Board Found at: /dev/cu.usbmodem14303
DEBUG:circuitpython_kernel.board:Connected? False
DEBUG:circuitpython_kernel.board:connect: open /dev/cu.usbmodem14303
DEBUG:circuitpython_kernel.board:serial already open
DEBUG:circuitpython_kernel.board:* enter raw repl ...
[I 15:35:17.427 NotebookApp] Kernel interrupted: 412927db-5709-4a7c-b62e-cf65d6c6e615
DEBUG:circuitpython_kernel.kernel:no connection failed to enter raw repl with /dev/cu.usbmodem14303
DEBUG:circuitpython_kernel.kernel:Error:  'No connection to CiruitPython VM: failed to enter raw repl with     /dev/cu.usbmodem14303'
DEBUG:circuitpython_kernel.board:/dev/cu.Bluetooth-Incoming-Port
DEBUG:circuitpython_kernel.board:/dev/cu.usbmodem14303
DEBUG:circuitpython_kernel.board:CircuitPython Board Found at: /dev/cu.usbmodem14303
DEBUG:circuitpython_kernel.board:Connected? False
DEBUG:circuitpython_kernel.board:connect: open /dev/cu.usbmodem14303
DEBUG:circuitpython_kernel.board:serial already open
DEBUG:circuitpython_kernel.board:* enter raw repl ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions