However, no matter how long the sleep time, it still only cuts power for a second.
Anyone know how to cut power for say, 5 seconds?
I have a USB device that sometimes freezes, and would like to automate unplugging/replugging to save me the tedious exercise of doing so manually each day
Hmm, what about if you make it something like 20 seconds? It could also be something in the kernal or hardware implementation which prevents it from being turned off for too long. I’ll have a look and let you know
Well, I can’t seem to find a concrete answer on that. There does seem to be have been changes on how USB power management is handled and what you can do in software. I’m not sure if that has something to do with it though. The easiest way to test that would be to control an LED as well (or some other indicator) before and after the sleep duration so you can see if the script is running correctly and it’s just a hardware management issue.
Hmm, what I’d try, is get a multimeter out (or even better, a scope), and monitor the 5V line to see if it’s truly disconnecting bus power, or just sending a shutdown message to your USB device.