forked from pyserial/pyserial
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Issue importée depuis pyserial/pyserial
Auteur original : @davet2001
Issue originale : pyserial/pyserial#699
Statut original : Open
Summary
When I use list_ports to provide a list of serial ports to a user in linux, they are only shown ports directly under /dev/* (excluding sudirectories). This can result in multiple ports being displayed e.g. /dev/ttyUSB0, /dev/ttyUSB1.
This is a problem for two reasons:
- There is no obvious indication which port is which - often resulting in user trial and error.
- If the machine is restarted with USB adapters disconnected or in a different arrangement, the mapping of USB0,1 etc can change.
The solution would be to include serial ports by ID in the list.
Steps to reproduce
What I did:
$ python3 -m serial.tools.list_ports -v -s
What I expected to happen:
$ python3 -m serial.tools.list_ports -v -s
/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
desc: n/a
hwid: LINK=/dev/ttyUSB0 LINK=/dev/ttyUSB0
/dev/ttyUSB0
desc: USB2.0-Serial
hwid: USB VID:PID=1A86:7523 LOCATION=1-4
2 ports found
What actually happened:
/dev/ttyUSB0
desc: USB2.0-Serial
hwid: USB VID:PID=1A86:7523 LOCATION=1-4
1 ports found
I am working on a PR for this.
davet2001
Metadata
Metadata
Assignees
Labels
No labels