5 ms·
Uhubctl – control USB power per-port on smart USB hubs
- unixhero 6y agoWhen is my usb hub a smart hub? What is a usb smart hub?
- btgeekboy 6y agoThe README.md in the repo answers this question and offers a list of known compatible devices.
- unixhero 6y agoThanks!
- olejorgenb 6y agoFrom the readme (https://github.com/mvp/uhubctl#what-is-usb-per-port-power-switching https://github.com/mvp/uhubctl#what-is-usb-per-port-power-sw...): sudo lsusb -v | grep wHubCharacteristic -A 3 If you see "Ganged power switching" or "Per-port power switching" it has a chance of working.
- 0134340 6y agoReturned 0x0008 for me. Too bad, I had this idea of controlling my USB desklamp's power from a quick script via hotkey.
- dingaling 6y ago> What is a usb smart hub? Cynically it's a hub that hasn't has its functionality impaired by cost-optimisation. Technically it's a hub that implements per-port power control and optionally per-port over-current detection. An example is the old Linksys USB2HUB4 hub that's nearly 20 years old but still reaches decent bids on eBay as it is sought after by many hobbyists. It uses the excellent NEC PD720110 chipset that doesn't cut any corners. It even boosts USB1.1 comms up to USB2.0 speed over the host link.
- nitrogen 6y agoIt even boosts USB1.1 comms up to USB2.0 speed over the host link. The terminology to look for is "multi-TT" (transaction translator) for this feature. Very useful for hooking up a whole bunch of serial ports to an embedded controller over USB. I made a video about doing so for my old startup like 7 or 8 years ago (though the hub in the video may have been single-TT... It was stolen so I can't go back and test it again). Per-port power and LED control was also really useful, but really rare, for embedded hardware. The idea was that a ton of peripherals would be connected over a network of USB extenders, and a user interface would let you flash the LED next to a device you wanted to find, if you weren't sure where it was. No cloud needed.
- 7952 6y agoIt would be cool to have a usb hub like this that was ethernet powered and could be controlled over the network.
- pascoej 6y agoBandwidth might be an issue. I've played with thin clients on my local network and while one usb camera is fine, two makes the entire experience start to chug on a gigabit lan.
- kalleboo 6y agoIt wouldn't even need to support data - so many things are just USB-powered that it could still be useful if it was basically "smart 5V DC power outlet"
- pabs3 6y agoJoey Hess' blog post about using this to save power on USB drives: https://joeyh.name/blog/entry/usb_drives_with_no_phantom_load/ https://joeyh.name/blog/entry/usb_drives_with_no_phantom_loa... https://news.ycombinator.com/item?id=25322564 https://news.ycombinator.com/item?id=25322564
- deleted 6y ago[deleted]
- bschwindHN 6y agoI needed to remotely power cycle some USB devices. These "smart hubs" are hard to find and I couldn't get the results I wanted on any hardware I had, so I made a PCB with a solid state relay on the 5V line - problem solved.
- sokoloff 6y agoWhy a solid state relay rather than a MOSFET?
- foobarbecue 6y agoTransistors generally can't switch significant currents effectively. Also, they can't latch.
- LeifCarrotson 6y agoUh, citation needed? A typical MOSFET is abundantly capable of switching several amps of current, orders of magnitude more than you'll find in a USB system. Also, an SSR (whether MOSFET, IGBT, triac, or SCR based) doesn't latch either. Only some esoteric mechanical relays latch. I had a similar requirement to OP, though my USB hardware was fine, it was a third party device that would sometimes fail to connect when the system restarted. A watchdog reset of the uC trivially reconnected my hardware, but I resorted to enabling/disabling the AHCI driver to force Windows to re-enumerate USB devices to get that to be reliable.
- foobarbecue 6y agoI was misinformed. Thanks for the correction.
- dschuler 6y agoSolid-state relays provide isolation between the control circuit and the load, which makes it easy to deal with voltage differences between those circuits, which happens frequently when there is some distance between them. Those relays can be built with MOSFETS or other doped semiconductor switches.
- olejorgenb 6y agoNice, my thinkpad dock actually support this! No I'll just need to glue together `adb shell dumpsys battery | grep level`, uhubctl and some udev magic to turn off phone charging above a certain threshold :)
- folmar 6y agoI have no personal experience, but there are some android apps to do this on the phone end.
- olejorgenb 6y agoLast I checked those require root and couldn't find any obvious non-root apps now either. I stumbled over this HW + app solution though: https://chargie.org/ https://chargie.org/
- ChrisMarshallNY 6y agoPretty cool. I was not previously aware of USB "Smart Hubs." However, I note that the last hub was shipped three years ago. USB-C has completely changed the way that USB hubs operate. Is this still viable?
- ChrisMarshallNY 6y agoHmm...I now see ones with 2018/19 dates. Maybe I need glasses (I do, but that's a different topic). Still, I haven't seen any real USB-C hubs. I'm assuming that they are too difficult to make.
- defied 6y agoIf you're looking for smart USB Hubs, these are pretty good https://www.cambrionix.com/ https://www.cambrionix.com/ We're using the "PowerPad" hubs for mobile device hosting. Each of the ports on the USB hub will detect the device and deliver its fastest possible charge.
- dpedu 6y ago> Each of the ports on the USB hub will detect the device and deliver its fastest possible charge. Isn't that how standard USB is supposed to work?
- rincebrain 6y agoMany consumer-grade USB hubs ([1] for example) will only deliver their full power (or full cleverness - e.g. negotiating certain protocols like Quick Charge) on a subset of ports, so advertising that these hubs will provide their full power output on every port makes sense. [1] - https://www.amazon.com/dp/B0797NWDCB/ https://www.amazon.com/dp/B0797NWDCB/
- rgovostes 6y agoAnyone know of a compact hub that supports this? In AUVs, where space is at a premium and battery power is limited, being able to disconnect VBUS from a USB peripheral could be very helpful.
- tootie 6y agoI think it's a matter of time before we see all sorts of small home appliances that replace their DC power bricks with USB.
- codazoda 6y agoI maintain hub-ctl on GitHub. It's cool to see someone expanding on this work. You've got a great list of working hubs as well. Your readme mentions hub-ctl but doesn't talk about specific improvements. Besides documentation, what are those improvements? https://github.com/codazoda/hub-ctrl.c https://github.com/codazoda/hub-ctrl.c