How to turn of USB Power when device is switched off

A place to talk about all the Operating Systems, Software & Hardware
Post Reply
User avatar
slop
Posts: 3
Joined: Sat Feb 02, 2019 3:51 pm

Wed Apr 03, 2019 3:42 pm

Hi

I build a mobile Emby Server with my LattePanda alpha. I have a little Box with a USB-C Battery, a little Router and the Alpha. The Router and a FAN are pluged in by USB.
The Plan was: switch off the Apha= everything turned off.
But the Fan and the router are still powered via USB when the Alpha switched off and the battery is connected.

Is it possible to disable USB power, when the Panda is turned off?

User avatar
Tsaukpaetra
Posts: 7
Joined: Sun Feb 03, 2019 8:15 pm

Wed Jan 01, 2020 11:46 am

I am interested in getting this to happen as well, I've noted a few threads here and here where this would be useful.

In my case, I have a USB enclosure that will power down the drives when power from the USB port is lost, which is important when I'm not using the LattePanda for longevity (I'm using the LattePanda for backup).

I'm not sure how things are wired, but I'm hopeful a BIOS update can fix this, as USB ports should be able to be turned off. Will need to do some investigating.

User avatar
ccs_hello
Posts: 561
Joined: Sat Oct 13, 2018 9:16 pm

Fri Jan 03, 2020 4:14 am

Don't know if LP Alpha has a hardware design that has a controllable USB power supply to turn on / turn off the USB power. If no such circuit, one has to design one to add on top of the existing LPA board.

Then how to determine the control on/off state? See this thread to understand the procedure:
https://www.lattepanda.com/topic-f23t18595.html

Also, if the sole goal of using LPA's USB port is to get the power from that port but not using the USB as a data transport mechanism, e.g., to turn-on/turn-off a fan, then
a different power path can be built (in DIY manner), say using the
5V_Always power bus as the supply, then go thru the power control circuit to supply power to the consuming device(s).

User avatar
Tsaukpaetra
Posts: 7
Joined: Sun Feb 03, 2019 8:15 pm

Sat Jan 04, 2020 11:44 pm

Yeah, my use-case is that the power supply for the LattePanda triggers off the USB power, going through the USB I'm not really able to pull apart the wires to splice in a custom solution... ūüėÖ
So, it's both a data and power trigger, and why I'm seeking support for turning off the USB ports completely.

I do know (for example) my Laptop's BIOS has settings to maintain power on certain USB ports when AC power was connected even if the main system was off and so thought that perhaps something similar was happening; but if the USB power is hard-wired to an always-on regulator I could see why this might be impossible to achieve.

Here's hoping the LattePanda engineers might see and chime in...

User avatar
Tsaukpaetra
Posts: 7
Joined: Sun Feb 03, 2019 8:15 pm

Mon Jan 13, 2020 6:56 am

Hmm, so after digging around in Linux I found two utilities that might be helpful in my endeavor. The first, uhubctl, is unable to detect any acceptable USB hubs, likely because the LattePanda does not have individual port power control, but is instead ganged (according to lsusb output).
The seconds (the original hub-ctl code) enumerates two hubs that claim they're ganged switching, but telling the program to turn off either of them seems to do nothing (the program has extremely little feedback).

So, I guess I'm stuck; it's not possible to turn off the USB ports at any time while mainboard power exists. Shame really...

Post Reply