-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
When I list the available serial ports using serial.tools.list_ports.comports() on Ubuntu 24.04, it also lists all the dummy /dev/ttyS* (0-31) devices which are non-existent on my hardware.
On the same machines with Ubuntu 22.04, only existing serial ports are listed.
>>> from serial.tools.list_ports import comports
>>> [p.name for p in comports()]Output on Ubuntu 24.04:
['ttyS0', 'ttyS1', ..., 'ttyS30', 'ttyS31', 'ttyUSB0', ..., 'ttyUSB7']Output on Ubuntu 22.04:
['ttyUSB0', ..., 'ttyUSB7']| Ubuntu Version | Kernel Version |
|---|---|
| 22.04 | 6.2.0-26-generic |
| 24.04 | 6.8.0-36-generic |
By default, pyserial filters out devices with subsystem platform.
However, Ubunt 24.04 (or more precisely newer kernel versions) report a different subsystem serial-base for all the (existing and non-existing) legacy serial ports:
| Port Type | Subsystem on Ubuntu 22.04 | Subsystem on Ubuntu 24.04 |
|---|---|---|
| Non-existent ports (/dev/ttyS*) | platform | serial-base |
| Existing legacy ports (/dev/ttyS*) | pnp | serial-base |
gfolkmanis-nhgh
Metadata
Metadata
Assignees
Labels
No labels