da61 Reset USB-Devices - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > Peripheral Hardware

Peripheral Hardware Stuff that plugs in via USB, FireWire, eSATA, PS/2, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old June 29th, 2011, 09:27
Ben Ben is offline
Member
 
Join Date: Nov 2008
Posts: 192
Thanks: 13
Thanked 1 Time in 1 Post
Default Reset USB-Devices

Hi,

I have 4 USB modems connected to a FreeBSD 8.2. They are powered via USB.

Sometimes a modem can hang and not succeed in sending faxes via HylaFax ("Unknown problem"). In this case I would like to "disconnect" the USB device remotely and reconnect.

I tried usbconfig but seems the modem would not come up again so I have to reboot the server to fix it.

Any hints what I could do?

Thanks.

Last edited by DutchDaemon; June 29th, 2011 at 15:24.
Reply With Quote
  #2  
Old July 2nd, 2011, 23:42
tingo tingo is offline
Member
 
Join Date: Nov 2008
Location: Oslo, Norway
Posts: 825
Thanks: 133
Thanked 82 Times in 68 Posts
Default

Exactly what did you try with usbconfig? The power_off / power_on commands? Or something else?
__________________
Torfinn

Last edited by DutchDaemon; July 3rd, 2011 at 02:15.
Reply With Quote
  #3  
Old July 3rd, 2011, 08:26
Ben Ben is offline
Member
 
Join Date: Nov 2008
Posts: 192
Thanks: 13
Thanked 1 Time in 1 Post
Default

I tried usbconfig power_off and on as well as reset. I tried to reset the hub but my SSH session freezes after. So I don't know what I can do.

Last edited by DutchDaemon; July 4th, 2011 at 00:58. Reason: Mind your writing style: http://forums.freebsd.org/showthread.php?t=18043
Reply With Quote
  #4  
Old July 3rd, 2011, 18:57
tingo tingo is offline
Member
 
Join Date: Nov 2008
Location: Oslo, Norway
Posts: 825
Thanks: 133
Thanked 82 Times in 68 Posts
Default

But still the devices work again when you reboot the server? Do you know if the usbconfig power_off command really works? Are there any lights or other visual indicators to tell if the device has power or not?
__________________
Torfinn

Last edited by DutchDaemon; July 4th, 2011 at 00:59.
Reply With Quote
  #5  
Old July 3rd, 2011, 21:38
Ben Ben is offline
Member
 
Join Date: Nov 2008
Posts: 192
Thanks: 13
Thanked 1 Time in 1 Post
Default

After a reboot the device works again. I do not have direct access to the server so I can't tell if it really works. When I set it to power_on I just see the config-Value changed to 255 which can't be changed any more.

I read something about usbconfig having a bug but I'm not yet sure if this only occurred after running power_off twice.

Last edited by DutchDaemon; July 4th, 2011 at 01:00. Reason: Mind your writing style: http://forums.freebsd.org/showthread.php?t=18043
Reply With Quote
  #6  
Old July 4th, 2011, 19:50
pva pva is offline
Junior Member
 
Join Date: Jun 2011
Location: Helsinki, Finland
Posts: 18
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I'm posting this for posteriority, in the hope that this post'll save somebody some teeth-gnashing (it's not good for your tooth enamel!).

I've been having similar problems with my Huawei E1820 USB modem, where the 3G connection would crap out once every week or so (and in fact still does), leaving the modem in an indefinite state that could only be recovered from by unplugging and plugging the device in again (or rebooting the whole machine):

Code:
Jul  4 12:00:06 microserver kernel: ugen1.2: <Huawei Technologies> at usbus1 (disconnected)
Jul  4 12:00:06 microserver kernel: u3g0: at uhub1, port 5, addr 2 (disconnected)
Jul  4 12:00:06 microserver ppp[23684]: Warning: 0.0.0.0: Change route failed: errno: No such process
Jul  4 12:00:06 microserver ppp[23684]: Warning: deflink: Unable to set physical to speed 0
Jul  4 12:00:06 microserver last message repeated 2 times
Jul  4 12:00:06 microserver ppp[23684]: Warning: deflink: tcsetattr: Unable to restore device settings
Jul  4 12:00:06 microserver kernel: umass0: at uhub1, port 5, addr 2 (disconnected)
Jul  4 12:00:06 microserver kernel: (cd0:umass-sim0:0:0:0): lost device
Jul  4 12:00:06 microserver kernel: (cd0:umass-sim0:0:0:0): removing device entry
Jul  4 12:00:06 microserver kernel: umass1: at uhub1, port 5, addr 2 (disconnected)
Jul  4 12:00:06 microserver kernel: (da0:umass-sim1:1:0:0): lost device
Jul  4 12:00:06 microserver kernel: (da0:umass-sim1:1:0:0): removing device entry
Jul  4 12:00:09 microserver ppp[23684]: Warning: deflink: /dev/cuaU0.0: Bad file descriptor
Based on advice from this thread, I modified the monitoring script I had already running via cron(8) to reset the modem using usbconfig(8) should the link fail. This would seem to remedy the problem and allow ppp(8) to re-establish the connection.

I am, of course, still faced with the quixotic quest of unearthing the root cause of the problem in co-operation with my telco, which has proven decidedly unhelpful in the matter up until this point, but that's a subject for another post.

Last edited by DutchDaemon; July 4th, 2011 at 21:02.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Confused about USB HID devices peterlaursen FreeBSD Development 4 October 20th, 2011 15:53
reset USB<->RS232 adapter over SSH m4rtin Peripheral Hardware 3 December 10th, 2010 16:10
[Solved] Having trouble mounting USB devices eldoraado Peripheral Hardware 10 October 4th, 2010 14:04
USB devices and their name in /dev ikbendeman Peripheral Hardware 8 September 17th, 2010 19:12
Sometimes stops see usb-devices. goshanecr Peripheral Hardware 1 April 27th, 2010 11:30


All times are GMT +1. The time now is 03:54.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0