Powering off or resetting USB peripherals



Hi -

I've got an LG-VL600 LTE USB modem permanently connected to an ALIX.2D13
box running Debian. Support for the VL600 is fairly new at this point,
so I'm running 2.6.38 slightly patched with the following:

https://github.com/balrog-kun/LG-VL600-utils/

Although this box runs a complex mess of Quagga, OpenVPN, and iptables,
let's just say for the moment that its purpose in life is to provide
backup Internet access.

Every couple of days the LTE connection is lost temporarily, which
results in the modem going into an unusable state, ultimately needing to
be physically unplugged and reconnected.

With the creation of a few simple monitoring scripts I'd like to be able
to reset the modem automatically upon loss of connection to the LTE
network. Unfortunately, unloading all the associated modules (lg_vl600,
cdc_ether, and cdc_acm) does not reset the modem, so I looked into ways
of shutting off the appropriate USB port and powering it back on.

I Googled around a little, and the best I could find was:

# echo suspend >/sys/bus/usb/devices/$dev/power/control
--- wait a second ---
# echo on >/sys/bus/usb/devices/$dev/power/control

However, it seems that although this worked prior to 2.6.32, the suspend
option was removed in later kernels for whatever reason, leaving me
apparently no way to cut power to or otherwise reset individual USB
peripherals. From Documentation/usb/power-management.txt:

power/control

This file contains one of two words: "on" or "auto".
You can write those words to the file to change the
device's setting.

"on" means that the device should be resumed and
autosuspend is not allowed. (Of course, system
suspends are still allowed.)

"auto" is the normal state in which the kernel is
allowed to autosuspend and autoresume the device.

(In kernels up to 2.6.32, you could also specify
"suspend", meaning that the device should remain
suspended and autoresume was not allowed. This
setting is no longer supported.)

Is there some alternate way of cutting the power to a USB device
temporarily in order to reset it? Maybe some userland application that
I'm not aware of?

Thanks!

- Mark

--
Mark Kamichoff
prox@xxxxxxxxxxxxx
http://www.prolixium.com/

Attachment: signature.asc
Description: Digital signature



Relevant Pages

  • Re: Wireless USB modem for broadband access problems
    ... It won't boot up if the modem's connected, even after changing the boot sequence and if I connect the modem once my desktop screen comes up, Windows crashes. ... There are enough problems with USB card readers, ... and the connection looks like a connection to any other ...
    (microsoft.public.windowsxp.hardware)
  • Re: what is the 1394 connection ?
    ... something above about them having a 'The shop used the Firewire port because ... they had a Firewire hub, switch, or broadband modem' ... usually supporting Ethernet for a LAN connection to an intranetwork. ... USB 1.0 only gave you 11Mpbs and even that is faster than what your broadband ISP gives you for Internet bandwidth. ...
    (microsoft.public.windowsxp.newusers)
  • Re: what is the 1394 connection ?
    ... Where all but my 2 modem connections were either ... >> something above about them having a 'The shop used the Firewire port ... >supporting Ethernet for a LAN connection to an intranetwork. ... So it doesn't matter if you use a NIC, USB, or Firewire because ...
    (microsoft.public.windowsxp.newusers)
  • Re: mobile phone for internet, what is right choice?
    ... has build-in modem for GPRS. ... bluetooth adapter; it works reasonably well. ... If you don't have a bluetooth adapter I assume that using the phone's usb ... a wireless connection to my computer simultaneously, ...
    (freebsd-questions)
  • Re: Networking a USB broadband connection
    ... connection share a USB broadband modem on a network. ... Next G wireless broadband with a USB desktop modem) I am using a D-Link ... to the home wireless network with a laptop to use the internet connection. ...
    (microsoft.public.windowsxp.network_web)