LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Turn off USB power (https://www.linuxquestions.org/questions/linux-hardware-18/turn-off-usb-power-4175414736/)

cerr 07-03-2012 04:16 PM

Turn off USB power
 
Hi,

I have realized that the 5V on the USB are always present, even when the host system reboots. Now, I was wondering, is there any way that I can turn off the 5>V onb the USB port explicitly? I have a usb client device and I would like it to go through a reeboot as well when I reboot the host as the system is supposed to be self-surviving 24/7/365 and I can only "guarantee" this, if I also can power cycle my usb client...
Any hints?

Thanks!!!
Ron

Doc CPU 07-03-2012 04:37 PM

Hi there,

Quote:

Originally Posted by cerr (Post 4718479)
I have realized that the 5V on the USB are always present, even when the host system reboots.

yes, that's by design. Some notebooks, however, switch USB power off when they're powered down themselves and not on AC power for recharging.

Quote:

Originally Posted by cerr (Post 4718479)
Now, I was wondering, is there any way that I can turn off the 5>V onb the USB port explicitly?

You can't. At least there's no standard way. All RESET-aware USB devices depend on "being told" to reset themselves by their driver.

Quote:

Originally Posted by cerr (Post 4718479)
I have a usb client device and I would like it to go through a reeboot as well when I reboot the host as the system is supposed to be self-surviving 24/7/365 and I can only "guarantee" this, if I also can power cycle my usb client...

That would require some hardware tricks. Problem is, you can't detect a simple restart of the host system by its power lines, least of all USB power. Instead, you'll have to monitor the status of the system's RESET line, which is available on PCI expansion slots (possibly on PCI-e, too, but I'm not sure) and on legacy IDE ports.

Actually, that's a tough one. But maybe we can find a solution if you tell us a bit more about the limiting conditions.

[X] Doc CPU

cerr 07-03-2012 04:48 PM

Quote:

Originally Posted by Doc CPU (Post 4718495)
Actually, that's a tough one. But maybe we can find a solution if you tell us a bit more about the limiting conditions.

NHi Doc,
We'rehere to find solutions for the tough problems, are we not? :) However, as for the conditions:
I have a little embedded box running an Atmel AT91SAM ARM processor. I compiled a mini distro using buildroot and busssybox, featuring kernel 3.2.7. Tthe system is supposed to be connected to the cloud with a cell phone stick. I got that going fine, meaning i can dial up and send ands receive data just fine for a while and then it loses connection, i redial and it will reconnect some times, other times, it says that the ppd pid is locked already so i built a watchdog script that gets executed by cron every 5 minutes. It will check if it can ping 8.8.8.8 and in case of a negative feedback, I reboot my little box (which will trigger it to redial on init) but every now and then, the system seems to hang itself up on boot aand i believe it might be because the usb cell stick requires a power cycle every now and then too (I wanbted to power cycle it on every reboot). Now how can I get this accomplished?
Aany hints?
Please advise, Doctor!

frieza 07-03-2012 04:50 PM

just out of curiosity, what is the client device? can you issue commands to reboot the device via the USB interface? if you can send it a reboot signal then you could perhaps set the computer to send a reboot signal to the device when it reboots, just a thought, couldn't tell you if this would work or not since none of the specifics about the device in question were provided.

cerr 07-03-2012 04:54 PM

Quote:

Originally Posted by frieza (Post 4718506)
just out of curiosity, what is the client device? can you issue commands to reboot the device via the USB interface? if you can send it a reboot signal then you could perhaps set the computer to send a reboot signal to the device when it reboots, just a thought, couldn't tell you if this would work or not since none of the specifics about the device in question were provided.

True, it's a cell phone stick from ZTE, type MF668A - I just sent the sales rep an email, asking him if he can get me in touch with a ZTE tech guy to get some additional info about its usb power management profile.

jefro 07-03-2012 07:45 PM

It would be possible to use acpi I'd think to power down the port.

It has been an issue with computers forever. A reboot is not a power down.


All times are GMT -5. The time now is 10:27 PM.