Link to home
Create AccountLog in
Avatar of Duncan Roe
Duncan RoeFlag for Australia

asked on

How can I cause a USB port to drop its power line for a time?

Sometimes we need to hard-reset a USB modem by dropping power to it for, say, 10 seconds (to let the 0.1Farad capacitor fully discharge). Physically unplugging works but will not be available once the systems are installed. Is there any way to command the USB port to lower its power supply line?
Avatar of marshalx
marshalx

duncan, the modem is powered by its own adaptor to the 250volt mains,  Not from the usb (that ive heard of), so to hard reset, as you know, unplug the modem etc.  cannot control modem power via usb (other than in reverse /power management tab),  but you CAN disable the port from ctrlpan / devman / usb device etc.   Hard resetting is not something you will need to do much at all after its working ok, so if it does become necessary, youll just have to crawl under the desk and pull the plug !  
Avatar of nobus
if the device power  can becut from control panel>Energy settings that would be what you need
if not  -try safely remove :http://safelyremove.com/?pid=1

use trial to test it
SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Duncan Roe

ASKER

Thanks for the ideas guys, keep them coming!
@marshalx: I should have mentioned - this is a Sierra Wireless 3G modem / GPS and yes, it is definitely USB powered. But thanks for your interest
@nobus: I did already try disabling a hub from devmgmt.msc (Device Manager) and all the attached USB key lights went out. But I realised after I'd left work that wasn't a definitive test of power loss :( didn't run test on actual device because it was mid-way through a re-install). On Monday I will do that test - modem has a green power led so I'll know for sure if power goes off.
@CodeCruiser: Terrific! A command-line replacement for Device Manager will fit the bill exactly, as long as my re-test on Monday is successful
Very disappointing. Disabling a USB hub from either devmgmt.msc or devcon.exe does not drop its power line.
Maddeningly, in the Root USB Hub Properties screen, the Power management tab contains a check box to Allow the computer to turn off this device to save power. So it would seem there must be some interface to do it. But what?
did you try safely remove?   not sure if it has that option, but it handles much of the USB
There is no problem that the USB root hub is disabled. For a mass storage device, that would imply removal (safe or otherwise). My test on Friday demonstrated that works. But I need more - I need the power to be turned off to the attached device.
you did not answer my question - did you try it ?
Safely remove doesn't apply to network cards and there is no such option in devcon.exe
The safely remove icon does not appear on the embedded system anyway. It does appear on the desktop development environment but only offers disks, not the Sierra Wireless card. Anyway I have to tell the root hub to drop power to the device, and this has to be programmatic (no user intervention).
@nobus: the login shell on the embedded system isn't explorer.exe, and even when it is during installation there is no task bar. If you know of a command line equivalent to safely remove then I'll gladly try it.
apparently you never read what i posted - i'll post it here again : and try the trial plse
-----------
if the device power  can becut from control panel>Energy settings that would be what you need
if not  -try safely remove :http://safelyremove.com/?pid=1

use the  trial to test it
I did see your post, and looked at the site but thought the product was unlikely to do what I wanted. Now I have tried it and am sure it doesn't. Here are all Sierra Wireless and USB devices as displayed by devcon.exe
C:\>devcon find *|grep -E -i "wireless|usb"
HID\VID_045E&PID_0040\6&2E9B802B&0&0000                     : Microsoft USB Wheel Mouse Optical
PCI\VEN_8086&DEV_27C8&SUBSYS_27C88086&REV_02\3&2411E6FE&0&E8: Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27C8
PCI\VEN_8086&DEV_27C9&SUBSYS_27C98086&REV_02\3&2411E6FE&0&E9: Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27C9
PCI\VEN_8086&DEV_27CA&SUBSYS_27CA8086&REV_02\3&2411E6FE&0&EA: Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27CA
PCI\VEN_8086&DEV_27CB&SUBSYS_27CB8086&REV_02\3&2411E6FE&0&EB: Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27CB
PCI\VEN_8086&DEV_27CC&SUBSYS_27CC8086&REV_02\3&2411E6FE&0&EF: Intel(R) 82801G (ICH7 Family) USB2 Enhanced Host Controller - 27CC
ROOT\LEGACY_USBSTOR\0000                                    : USB Mass Storage Driver
ROOT\MS_PSCHEDMP\0004                                       : Sierra Wireless HSPA Network Adapter - Packet Scheduler Miniport
ROOT\MS_PSCHEDMP\0005                                       : Sierra Wireless HSPA Network Adapter #2 - Packet Scheduler Miniport
SWMUXBUS\SW_MODEM\7&32EB5DAD&0&6&0000                       : Sierra Wireless HSPA Modem #2
SWMUXBUS\SW_NET\7&32EB5DAD&0&0&0000                         : Sierra Wireless HSPA Network Adapter #2
SWMUXBUS\SW_SERIAL\7&32EB5DAD&0&1&0000                      : Sierra Wireless AT Command Port (UMTS) (COM9)
SWMUXBUS\SW_SERIAL\7&32EB5DAD&0&2&0000                      : Sierra Wireless DM Port (UMTS) (COM10)
SWMUXBUS\SW_SERIAL\7&32EB5DAD&0&3&0000                      : Sierra Wireless CNS Port (UMTS) (COM11)
SWMUXBUS\SW_SERIAL\7&32EB5DAD&0&4&0000                      : Sierra Wireless NMEA Port (UMTS) (COM12)
SWMUXBUS\SW_SERIAL\7&32EB5DAD&0&5&0000                      : Sierra Wireless Data Port (UMTS) (COM13)
USB\ROOT_HUB\4&101E3E63&0                                   : USB Root Hub
USB\ROOT_HUB\4&1D968DFA&0                                   : USB Root Hub
USB\ROOT_HUB\4&2D93DBB0&0                                   : USB Root Hub
USB\ROOT_HUB\4&3B0C2B47&0                                   : USB Root Hub
USB\ROOT_HUB20\4&181185D6&0                                 : USB Root Hub
USB\VID_045E&PID_0040\5&1ADE13EA&0&2                        : Microsoft USB Wheel Mouse Optical
USB\VID_1199&PID_683C\5&2D994891&0&3                        : USB Composite Device
USB\VID_1199&PID_683C&MI_00\6&13D7B3DF&0&0000               : Sierra Wireless HSPA Device
USB\VID_1199&PID_683C&MI_01\6&13D7B3DF&0&0001               : Sierra Wireless HSPA Device
USB\VID_1199&PID_683C&MI_02\6&13D7B3DF&0&0002               : Sierra Wireless HSPA Device
USB\VID_1199&PID_683C&MI_03\6&13D7B3DF&0&0003               : Sierra Wireless HSPA Device
USB\VID_1199&PID_683C&MI_04\6&13D7B3DF&0&0004               : Sierra Wireless HSPA Device
USB\VID_1199&PID_683C&MI_05\6&13D7B3DF&0&0005               : Sierra Wireless HSPA Device
USB\VID_1199&PID_683C&MI_06\6&13D7B3DF&0&0006               : Sierra Wireless HSPA Device
USB\VID_14C8&PID_0003\0000100977                            : Zytronic, x-y, USB (UPDD)

C:\>

Open in new window

From the GUI displayed by devmgmt.msc I can see that the Sierra Wireless modem is attached to the USB2.0 device USB\ROOT_HUB20\4&181185D6&0 and is the only device so attached. (It shows up as the USB Composite Device). There are 2 USB connectors pinned out from the system- the other is USB\ROOT_HUB\4&1D968DFA&0.
What I need to do therefore is drop power to the USB2.0 hub, as its Power Management tab seems to imply is possible. The USB Safely Remove command-line utility usr.exe only shows me
C:\>usr list -a
1. Sierra Wireless HSPA Device
2. Sierra Wireless HSPA Device
3. Sierra Wireless HSPA Device
4. Sierra Wireless HSPA Device
5. Sierra Wireless HSPA Device
6. Sierra Wireless HSPA Device
7. Sierra Wireless HSPA Modem #2
8. Microsoft USB Wheel Mouse Optical
9. Zytronic, x-y, USB (UPDD)

C:\>

Open in new window

I can stop the modem but the power stays on and the blue light still flashes (so perhaps it is still connected - I don't know).
C:\>usr stop -n "Sierra Wireless HSPA Modem #2"
Device "Sierra Wireless HSPA Modem #2" has been stopped successfully!

C:\>usr list -a
1. Sierra Wireless HSPA Modem #2    (safely removed)
2. Microsoft USB Wheel Mouse Optical
3. Zytronic, x-y, USB (UPDD)

C:\>devcon find *|grep -E -i "wireless|usb"
HID\VID_045E&PID_0040\6&2E9B802B&0&0000                     : Microsoft USB Wheel Mouse Optical
PCI\VEN_8086&DEV_27C8&SUBSYS_27C88086&REV_02\3&2411E6FE&0&E8: Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27C8
PCI\VEN_8086&DEV_27C9&SUBSYS_27C98086&REV_02\3&2411E6FE&0&E9: Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27C9
PCI\VEN_8086&DEV_27CA&SUBSYS_27CA8086&REV_02\3&2411E6FE&0&EA: Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27CA
PCI\VEN_8086&DEV_27CB&SUBSYS_27CB8086&REV_02\3&2411E6FE&0&EB: Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27CB
PCI\VEN_8086&DEV_27CC&SUBSYS_27CC8086&REV_02\3&2411E6FE&0&EF: Intel(R) 82801G (ICH7 Family) USB2 Enhanced Host Controller - 27CC
ROOT\LEGACY_USBSTOR\0000                                    : USB Mass Storage Driver
ROOT\MS_PSCHEDMP\0004                                       : Sierra Wireless HSPA Network Adapter - Packet Scheduler Miniport
ROOT\MS_PSCHEDMP\0005                                       : Sierra Wireless HSPA Network Adapter #2 - Packet Scheduler Miniport
USB\ROOT_HUB\4&101E3E63&0                                   : USB Root Hub
USB\ROOT_HUB\4&1D968DFA&0                                   : USB Root Hub
USB\ROOT_HUB\4&2D93DBB0&0                                   : USB Root Hub
USB\ROOT_HUB\4&3B0C2B47&0                                   : USB Root Hub
USB\ROOT_HUB20\4&181185D6&0                                 : USB Root Hub
USB\VID_045E&PID_0040\5&1ADE13EA&0&2                        : Microsoft USB Wheel Mouse Optical
USB\VID_1199&PID_683C\5&2D994891&0&3                        : USB Composite Device
USB\VID_14C8&PID_0003\0000100977                            : Zytronic, x-y, USB (UPDD)

C:\>

Open in new window

Impressive as safely remove is, it really doesn't do what I need. What I think I do need is to access the power management interface of the USB2.0 root hub. Any ideas?
i have been thinking about this, and i fear the power line cannot be dropped on the USB, (it comes from the usb chip), so that should be a modem option, or switch imo; but i would like to be proved wrong...
Even if we can't drop the power line on the chip, can't we drop power to the chip? That would seem to be what power management would do on, say, hibernate. I guess it depends if the API is exposed or is only available to the Windows OS. I downloaded the WDK (Windows Driver Kit) so hopefully can use the API if it's available at all.
Hey Duncan, it's PeterH from AUSLIG days!

Have you made any progress with the WDK? If not ...

Sorry to harp on something you've previously dismissed, but I am also a great supporter of USB Safely Remove (Zentimo actually).
I know you are a rigorous person, so it's highly likely that, when you installed it, you did select the "power-down" configuration option and reboot before testing? Just thought I'd mention it in case :-)
It could also be worth trying the latest Zentimo version, although I suspect that it shares the same code base as usr.

All the best.
power to the chip?  that would be the  PC Power supply afaik - so no i still see no way of doing that; i believe even it was made on purpose that way : if you cut the power to an active USB device, guess what can happen ?
@rocman: Hi PeterH, good to hear from you!
I tried Zentimo 1.4 from the web site, but it doesn't offer a "power-down" configuration option - maybe the Win XP on these systems is too old to support it?

@nobus: The device says it can be power managed so I want to power manage it. So what if you cut power to an active device - much the same as unplugging, isn't it?
the device itself may be power managed -  then it should have the means to do so
cutting power is not the same as unplugging - this may cause even shorts...
It's USB\ROOT_HUB20\4&181185D6&0  that advertises the power management ability - not the modem itself. I took that to mean that hub can be shut down and powered off - thus dropping power to the modem. (Zentimo doesn't know about that device)
None of the answers have helped me, but they might be of some use to others. So I don't know what to do
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
devcon.exe was a good addition to the tool box. I wanted a user space solution but didn't ask for one - seeing this is to overcome flakey driver or micro code, the bug report suggestion wins the day