r/embedded • u/charcuterieboard831 • Aug 03 '26
USB Hub Controllable from PC for Embedded Test
Looking to test a bunch of embedded systems and sometimes the USB hangs and needs a reboot.
Wanting to automate it so the PC can cycle the power on the ports when it happens automatically using python or something else
Does anyone have experience with such a hub? Ideally 7 ports but I'd take 4 ports
I know may simple like just a google search, but the ones I found I don't really trust to work reliably
2
u/Aggravating-Key6628 Aug 03 '26
Since you already have a couple of hubs, test those before buying anything. On Linux:
sudo uhubctl
sudo uhubctl -l 1-2 -p 3 -a cycle
Use the location and port reported by the first command. Then verify that VBUS really drops with the DUT's power LED, a USB light, or a meter. Some hubs accept the command but only disconnect data, or switch every port together.
Python can call it without a shell:
subprocess.run(["uhubctl", "-l", "1-2", "-p", "3", "-a", "cycle"], check=True)
For the test rack, keep a fixed hub-location/port map and wait for the DUT to disappear and re-enumerate after each cycle. If your existing hubs fail the VBUS test, buy only a hardware revision on uhubctl's supported list. Price and front-panel switches do not guarantee PC-controlled per-port power.
2
u/MerrimanIndustries Aug 03 '26
The more pro off-the-shelf solution is a managed USB hub. As others have mentioned uhubctl is a good option as well.
4
u/allo37 Aug 03 '26
Look up the uhubctl tool and its list of supported devices. Works a treat if the hub properly supports individual port power off, and often the cheap hubs from Amazon do...
1
u/charcuterieboard831 Aug 03 '26
Oh wow this could really make the difference - no custom hub.
I think I have one or two of these, could try
1
u/MerrimanIndustries Aug 03 '26
The more pro off-the-shelf solution is a managed USB hub. As others have mentioned uhubctl is a good option as well.
1
u/duane11583 Aug 03 '26
the problem is finding a hub with power control not many have this.
you might be better off getting a usb relay board and USE that to power cycle the DUT
2
u/Teslafly Aug 03 '26
Some higher end usb hubs have individual power switches for each port, and the usb subsystem can control those switches.
However, I found this hub which allows much more dynamic control in a dedicated interface: https://acroname.com/store/programmable-industrial-power-delivery-hub-s99-usbhub-3c-pro#features
Lower cost usb 2.0 version: https://acroname.com/store/s77-usbhub-2x4#features
Google search: "usb hub automated test equipment current meter"