Trying to connect to serial ports that do not correspond to a control board may cause unexpected behaviour to devices on the port.
Current solution
In the serial_ports function, only include serial ports that match recognized Mega2560 USB VID:PID ports.
New problem
Some users might be using Arduino/Genuino clones that might not be in the recognized USB VID:PID list, but are still compatible with the control board firmware.
Proposed solution
Rather than only including serial ports that match recognized Mega2560 USB VID:PID ports, consider all ports when trying to connect, but try to connect in the following order:
Serial ports that match recognized Mega2560 USB VID:PID
Serial ports that match recognized Arduino USB vendor ID (i.e., VID=2341)
Remaining ports (perhaps with option to disable?)
Hopefully, cases 1 and 2 improve connecting speed when a control board device is actually connected.
Case 3 will add support for unrecognized (but compatible) clones. However, since case 3 may still lead to the Original problem from above, we might want to add an optional argument to the serial_ports function to specify whether or not to include devices matching 3.
Try connecting to any serial port, but try recoginized Mega2560 USB VID:PID ports first
Original problem
Trying to connect to serial ports that do not correspond to a control board may cause unexpected behaviour to devices on the port.
Current solution
In the
serial_ports
function, only include serial ports that match recognized Mega2560 USB VID:PID ports.New problem
Some users might be using Arduino/Genuino clones that might not be in the recognized USB VID:PID list, but are still compatible with the control board firmware.
Proposed solution
Rather than only including serial ports that match recognized Mega2560 USB VID:PID ports, consider all ports when trying to connect, but try to connect in the following order:
VID=2341
)Hopefully, cases 1 and 2 improve connecting speed when a control board device is actually connected.
Case 3 will add support for unrecognized (but compatible) clones. However, since case 3 may still lead to the Original problem from above, we might want to add an optional argument to the
serial_ports
function to specify whether or not to include devices matching 3.Try connecting to any serial port, but try recoginized Mega2560 USB VID:PID ports first