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.
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.