Closed
Description
When run on Ubuntu 20.04, serial-discovery is finding the /dev/ttyS* placeholder ports.
Looks like the go-serial library is supposed to check for this, but it seems to not be working.
https://github.com/bugst/go-serial/blob/f344e5f764a882b93ba5e38988551cbb2186e948/serial_unix.go#L285
./serial-discovery
LIST
{
"eventType": "command_error",
"message": "First command must be HELLO, but got 'LIST'",
"error": true
}
HELLO 1 "manual run"
{
"eventType": "hello",
"message": "OK",
"protocolVersion": 1
}
START
{
"eventType": "start",
"message": "OK"
}
LIST
{
"eventType": "list",
"ports": [
{
"address": "/dev/ttyS8",
"label": "/dev/ttyS8",
"protocol": "serial",
"protocolLabel": "Serial Port",
"properties": {}
},
{
"address": "/dev/ttyS9",
"label": "/dev/ttyS9",
"protocol": "serial",
"protocolLabel": "Serial Port",
"properties": {}
},
{
"address": "/dev/ttyS0",
"label": "/dev/ttyS0",
"protocol": "serial",
"protocolLabel": "Serial Port",
"properties": {}
},
{
"address": "/dev/ttyS2",
"label": "/dev/ttyS2",
"protocol": "serial",
"protocolLabel": "Serial Port",
"properties": {}
},
{
"address": "/dev/ttyS3",
"label": "/dev/ttyS3",
"protocol": "serial",
"protocolLabel": "Serial Port",
"properties": {}
},
{
"address": "/dev/ttyS7",
"label": "/dev/ttyS7",
"protocol": "serial",
"protocolLabel": "Serial Port",
"properties": {}
},
{
"address": "/dev/ttyS6",
"label": "/dev/ttyS6",
"protocol": "serial",
"protocolLabel": "Serial Port",
"properties": {}
},
{
"address": "/dev/ttyACM0",
"label": "/dev/ttyACM0",
"protocol": "serial",
"protocolLabel": "Serial Port (USB)",
"properties": {
"pid": "0x0483",
"serialNumber": "5393790",
"vid": "0x16c0"
}
},
{
"address": "/dev/ttyS1",
"label": "/dev/ttyS1",
"protocol": "serial",
"protocolLabel": "Serial Port",
"properties": {}
},
{
"address": "/dev/ttyS4",
"label": "/dev/ttyS4",
"protocol": "serial",
"protocolLabel": "Serial Port",
"properties": {}
},
{
"address": "/dev/ttyS5",
"label": "/dev/ttyS5",
"protocol": "serial",
"protocolLabel": "Serial Port",
"properties": {}
}
]
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
/dev/ttyS0->/dev/ttyUSB0
arduino/arduino-ide#490cmaglie commentedon Feb 18, 2022
@PaulStoffregen are the
ttySxx
accessible from your user?From some tests on my local machine I see that if the port is not accessible the enumerator will (wrongly) list it:
but if I give the correct permissions to the user everything is fine again:
can you check if this is your case?
I've prepared a fix here bugst/go-serial#135
PaulStoffregen commentedon Feb 18, 2022
Yes, confirmed.
cmaglie commentedon Feb 24, 2022
This has been fixed with #38, and is already in production.
I'm working on another fix in the go-serial library, that allows checking if a serial port is fake or not without opening it (following your suggestion on libudev here) but it's mid-term because it requires a more involved change in the go-serial library.