Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?


  Search this Thread
Old 07-01-2010, 02:06 PM   #1
Registered: Oct 2008
Location: Mexico City
Distribution: Fedora
Posts: 65

Rep: Reputation: 15
How simulate unplug an re-plug of USB devices?


After some tests I found that some USB Bluetooth Dongles errors, only are recoverable if the USB is unplugged an then plugged again.

Is there some way to simulate that a USB device is unplugged and re-plugged?

Old 07-01-2010, 02:24 PM   #2
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
As root, you could run
This will "rediscover" the devices attached, but it may not reset the device itself.
Old 07-01-2010, 02:44 PM   #3
Senior Member
Registered: Jan 2008
Distribution: Arch/Slackware/Knoppix
Posts: 1,784
Blog Entries: 14

Rep: Reputation: 279Reputation: 279Reputation: 279
If you find the solution, let me know... but I don't think it is a Linux problem per se, as I've observed the occasional need to physically unplug the device under Windows XP as well.
Old 07-01-2010, 04:32 PM   #4
Registered: Oct 2008
Location: Mexico City
Distribution: Fedora
Posts: 65

Original Poster
Rep: Reputation: 15
Yes, I also suspect that the problem is not Linux only, but the next test is try the simulation of un-plug and re-plug.


Let's try with udev.
Old 07-01-2010, 07:37 PM   #5
Registered: Mar 2008
Posts: 18,072

Rep: Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709
I think it is part to usb tools. I am not sure that is the correct package but there is a usb tool kit that I think includes what you'd need.
Old 07-02-2010, 10:20 AM   #6
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,911

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
You won't accurately simulate an unplug - ever imho, because the chip will still see the impedance.
This became an issue for me when I had a box (around kernel2.6.19) which gave copious usb2 log spam. Someone on via hardware wrote a kernel patch that threw out what the usb controller chip was thinking. The (via) usb chip behaved differently if it had a device plugged in or not. This was my contribution to kernel development - required because I had the dodgiest box on the planet :-/. The end result was an option for ehci_hcd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Detect USB and Printer Plug / Unplug C/C++ source haseit Linux - Newbie 1 01-19-2009 06:59 PM
USB errors durring boot. have to unplug keyboard, plug back in to use it to sign on agentc0re Slackware 5 03-17-2008 08:02 PM
USB plug & unplug JrLz Slackware 6 12-09-2004 08:07 AM
USB mouse works only if i unplug then re-plug it allelopath Linux - Hardware 3 11-20-2004 12:48 PM
usb wlan works but only after i unplug and plug triagladad Linux - Wireless Networking 0 09-21-2004 06:45 AM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:53 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration