-
-
Notifications
You must be signed in to change notification settings - Fork 414
Description
Describe the request
We can use the USB serial number to know that a board has changed COM port, for example after an upload, or when it swaps to bootloader mode after a double-tap on the reset button.
Currently the discovery returns this information:
{
"eventType": "list",
"ports": [
{
"address": "/dev/ttyACM0",
"label": "/dev/ttyACM0",
"properties": {
"pid": "0x804e",
"vid": "0x2341",
"serialNumber": "EBEABFD6514D32364E202020FF10181E"
},
"protocol": "serial",
"protocolLabel": "Serial Port (USB)"
}
]
}
we may extend the result by adding an extra field hardwareId
that is populated when we have an hardware identification number available, for example for USB serial ports we can use the USB Serial Number:
{
"eventType": "list",
"ports": [
{
"address": "/dev/ttyACM0",
"label": "/dev/ttyACM0",
"hardwareId": "EBEABFD6514D32364E202020FF10181E",
"properties": {
"pid": "0x804e",
"vid": "0x2341",
"serialNumber": "EBEABFD6514D32364E202020FF10181E"
},
"protocol": "serial",
"protocolLabel": "Serial Port (USB)"
}
]
}
This change may require an update to the Pluggable Discovery specification.
Describe the current behavior
When a board changes the port after a reset, there is no reliable way to determine if the new port belongs to the same board.
With this proposal implemented the IDE may exploit the hardwareId
field to reselect the correct port automatically.
Arduino CLI version
Operating system
N/A
Operating system version
N/A
Additional context
cc @pnndra @kittaakos @per1234 @umbynos
Issue checklist
- I searched for previous reports in the issue trackerI verified the problem still occurs when using the nightly buildMy report contains all necessary detailsTo pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Activity
umbynos commentedon Dec 15, 2022
@facchinm can we assume the
serialNumber
is unique?facchinm commentedon Dec 16, 2022
Most of the times yes; if using a PluggableUSB module (like Keyboard, Mouse or MIDIUSB) the serial number reported will change a bit (but I think it's a corner case compared with the vast majority of the use cases)
cmaglie commentedon Jan 4, 2023
Thinking on this a bit more, this is not related specifically to serial but its a broader change to the Pluggable Discovery specification, I'm moving the issue to the
arduino-cli
repo.[-]Allow identification of a specific instance of a board when the COM port changes[/-][+]Allow identification of a specific instance of a board from a Pluggable Discovery[/+]umbynos commentedon Jan 24, 2023
@cmaglie is the serial number exposed even in case of the network discovery?
hardwareId
support arduino/serial-discovery#60hardwareId
field support arduino/pluggable-discovery-protocol-handler#31