-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Handle unexpected events on serial ports #8046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle unexpected events on serial ports #8046
Conversation
I tried this IDE version, but with MKR WiFi1010, on Windows 10, it's the same problem. |
Could this be done without the timer? If you look at the work on PluggableDiscovery and try running SerialDiscovery_JSON on Linux, the future may look like near real-time response to USB add & remove events. One second delay isn't very long for humans, but a device can reset and reappear withing 1 second on most Linux & Mac systems. Even Windows 10 is better about delays with detecting devices. And that's just USB. |
1 second delay is just an example; we could be much more tight since calling |
✅ Build completed. Please test this code using one of the following: ⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-8046-BUILD-791-linux32.tar.xz ℹ️ The |
Similar to minicom behaviour. Automatically reopens the port only if it takes the same name (could be improved based on vid/pid)
d195cc4
to
d2f8e15
Compare
✅ Build completed. Please test this code using one of the following: ⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-8046-BUILD-884-linux32.tar.xz ℹ️ The |
While working with low power, the serial port can disappear/reappear very often (see arduino-libraries/ArduinoLowPower#7).
This makes using the serial monitor very frustrating (especially on Linux) since the port will acquire another name if reconnected while the monitor is open. Changing port will close the monitor for good, so it must be reopened manually.
This patch tries to add a couple of "helpers" to make the situation less terrible.