Rapid disconnect/reconnect of device isn't recognized.
See original GitHub issueBug Description:
Rapid disconnection and reconnection doesn’t seem to be properly recognized.
This is related to this bug posted here: https://github.com/microsoft/vscode-serial-monitor/issues/26, where someone posted this issue on the serial monitor.
Steps to Reproduce:
- Plug in a device
- Unplug the device and quickly plug the device back in.
Expected: The package correctly picks up both events and the device is properly picked up on reconnection Actual: It doesn’t seem to handle the reconnection event, it seems that reconnections happen too quickly for it to handle?
Additional Information
- Operating System: Windows 11
- Runtime (
node -v
orelectron -v
): 16.13.1 - Node USB Version (
npm ls usb
): 2.5.0
Issue Analytics
- State:
- Created a year ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
How to Fix a USB Device That Keeps Disconnecting ...
1. Quick Fixes for the "USB Keeps Disconnecting and Reconnecting" Error · 2. Reinstall the USB Drivers · 3. Configure Your PC's Power...
Read more >Windows 10 usb device disconnects and reconnects often
Restart the computer and check, if it works. If the issue still persists, follow the Method 3. Method 3:.
Read more >If your computer doesn't recognize your iPhone or iPad
If that doesn't help, disconnect your device and all other USB devices and accessories from your computer. Then reconnect only your device.
Read more >Device Not Recognized While Connected to the Computer?
Disconnect your device from the computer (Do not reconnect the device until step 4). Step 2. Completely Uninstall the Device Update software from...
Read more >USB keeps disconnecting and reconnecting in Windows 10
To know more on how to fix USB disconnecting and reconnecting in Windows ... If after you connect a USB device, it keeps...
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
I would expect an update to resolve this issue as I suspect the older polling mechanism on Windows is the culprit. Easy to test…
for context: hotplug detection has never really worked correctly in Windows until 2.5.0. before that, we regularly polled the current devices and relied on libusb to tell us whether two devices are the same or not.
if libusb is still recognizing a device as “the same” after a reconnection, then I’m afraid there’s little we can do and this is an issue that libusb should fix.
we could do additional validation by checking that
busNumber
anddeviceAddress
have not changed, but something tells me libusb is already doing that. maybe Windows is reusing the deviceAddress?in any case, even if it does work in 2.5.0, it’s essentially a data race and you should not rely on it