Serial Monitor should handle disconnects more gracefully
See original GitHub issueEdit from maintainers - Temporary solution: https://docs.platformio.org/en/latest/faq/advanced-serial-monitor.html
Serial Monitor should handle disconnects more gracefully
This is a bug report/feature request to improve the serial port functionality in Platform IO.
Configuration
Operating system: Windows 10 x64
PlatformIO Version (platformio --version
): PlatformIO Core, version 5.1.1
Description of problem
Using serial monitor on a USB based serial port crashes with Exception
Steps to Reproduce
- Start a serial monitor to a device with a USB based serial port:
pio device monitor
- Reset the device
Actual Results
Exception in thread rx:
Traceback (most recent call last):
File "C:\Users\camer\.platformio\python3\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "C:\Users\camer\.platformio\python3\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "c:\users\camer\.platformio\penv\lib\site-packages\serial\tools\miniterm.py", line 445, in reader
data = self.serial.read(self.serial.in_waiting or 1)
File "c:\users\camer\.platformio\penv\lib\site-packages\serial\serialwin32.py", line 257, in in_waiting
raise SerialException("ClearCommError failed ({!r})".format(ctypes.WinError()))
serial.serialutil.SerialException: ClearCommError failed (PermissionError(13, 'The device does not recognize the command.', None, 22))
Expected Results
An error message designed for a novice user to understand.
Ideally also (optional) automatic reconnect when the device comes back.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:17 (12 by maintainers)
Top Results From Across the Web
Update serial monitor after disconnecting from computer?
SerialMonitor has to either signal a "goodbye" before disconnecting, or ( IMO better ) request collected data when ready to receive.
Read more >Cisco 2511 Terminal Server - graceful disconnect on exit
I am using a Cisco 2511 as a terminal server. I connect the octopus cable to serveral Cisco router consoles. Connections work fine....
Read more >Solved: Gracefully handling EtherCAT slave connection and ...
Say you have a daisy chain of etherCAT slaves and the last one gets disconnected.
Read more >6. Configuration notes - Network UPS Tools
First, most of the programs use an uppercase word to declare a configuration directive. This may be something like MONITOR, NOTIFYCMD, ...
Read more >EZ-Link Connection Issues After a Few Hours - adafruit industries
I can put my computer to sleep, disconnect, reconnect, leave the area, come back and they ... OSX) had a serial monitor open,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi All!
Great news! Huge refactoring to the device monitor logic and it seems this issue has been solved. Also, automatic reconnection has been implemented.
Please re-test with
pio upgrade --dev
.Does it work as expected now?
@ivankravets Thank you very much for this correction!