How Do I Force Windows to Remove and Redetect a USB Device?
Digital I/O (DIO)>>Static>>USB-6501, CompactDAQ, Multifunction DAQ (MIO)>>Portable
My USB device will occasionally lose connection to the computer, and I have to disconnect and then reconnect my it before it will work. Why does this happen, and how can I get Windows to redetect the device, without having to physically disconnect the device?
This behavior occurs when the device loses power, but the computer does not. For example, often when a computer goes into standby or power-save mode it will often shut down power to the USB ports. Also, this can happen when a computer returns from having been hibernated. In either case, the device is not redetected by the computer and thus you will not be able to communicate with it. Follow the instructions below to redetect the device within Windows when this happens:
- Install the DevCon utility from Microsoft. The DevCon utility is a command-line utility that acts as an alternative to Device Manager. Using DevCon, you can enable, disable, restart, update, remove, and query individual devices or groups of devices. You can download DevCon from http://support.microsoft.com/kb/311272
- Open the Windows Device Manager by going to Start » Run, type in devmgmt.msc, and then click the OK button.
- You will now need to determine which USB hub (port) the troubled device is connected to. To do this, expand the Universal Serial Bus controllers group at the bottom of the list.
- In sequence, double click on every USB Root Hub entry and click the Power tab to see if your device is listed.
- When you have found the hub that has your device listed, click the Details tab. Record the name shown in the list between the first and second \ sign, for example ROOT_HUB20.
- Next, start a Command Prompt by going to Start » Run, type in cmd, and then click the OK button.
- In the Command Prompt window, type in each of the following commands followed by enter, replacing ROOT_HUB20 with what you recorded in step 4.
devcon remove *ROOT_HUB20*
- Now, Windows will remove and re-detect the hub and any USB devices attached to it, re-enabling them in the process. If this does not work, you probably selected the wrong hub in step 4. Repeat steps 3 - 6 until the device works.
Related Links: MSDN: The DevCon command-line utility functions as an alternative to Device ManagerKnowledgeBase 3D8J0A3U: USB-92xx Devices May Not Wake from Hibernation