eric-hedengren / arduino-upload-tclab

Code that makes uploading all those Arduinos faster
0 stars 0 forks source link

Cannot Open Com Port Error #2

Open eric-hedengren opened 3 years ago

eric-hedengren commented 3 years ago

During the while loop when Arduinos are being checked for in the com ports, a device is detected very quickly, and immediately after the connection is opened. This may not be enough time for the Arduino and the computer to establish a secure connection, which could be why an error is sometimes thrown when a new device appears. Currently a small amount of time is being waited after the device is detected to let the device initialize itself, but errors are still thrown (not as frequently). It may be necessary to increase this wait time, but it's bad for efficiency.

eric-hedengren commented 3 years ago

Maybe the connection opening could be put in a try statement? Then it would just keep failing until the port is ready.