(Edited and expanded from original question for clarity)
USB interfaces as a means of controlling external hardware from a desktop or laptop computer are ubiquitous; many thousands of hardware models are available, ranging in price from 10-1 to 106 USD. It is reasonable to require that the +5V DC voltage line be able to be switched off from the host computer, but this is by no means guaranteed across every mainstream PC/laptop running every widespread OS.
I am looking to have a true cross-platform solution to be able to selectively power USB ports down and up from software, for totally arbitrary lengths of time. This is not because I am prototyping or breadboarding, and nor is this my first foray into electronics making an LED blink on and off; I require a long-term reliable solution.
I am looking for an efficient solution which minimizes:
- Implementation time
- Other general hassles, such as volume or amount of trailing wires
Based upon comments, I have thusfar ranked my options as follows:
Buy a dedicated USB splitter, with fully cross-platform proprietary software, such as the Yepkit YKUSH hub:
- Negligble software compilation time + some time to "box up"
- Compact and neat
Buy a programmable USB hub:
- Small amount of time to implement command-line software control
- Professionally boxed
At the moment, I would be tempted to get a 4-way USB hub, splice its power lines through a separate arduino-controlled relay (as I have an arduino that need never be unpowered).
Buy a fairly off-the shelf hub compatible with uhubctl. Then either run Linux or program a way to make it work in Windows. A VM would also be a headache, because programs in Windows will have trouble interfacing with Linux programs inside the VM.
- Long time to implement cross-platform software
- Professional USB hub
Buy a USB hub and a Normally Closed 5V relay, controlled by e.g. an arduino to cut power to the USB hub as required:
- Long time to solder and tidy connections + short time to implement switching in arduino code
- Fairy ugly due to splicing wires
(Surprisingly not suggested in responses given that this is an Electrical Engineering site)