0

I have a USB-powered light. This light is just an LED and resistor between the +5V and GND pins on the USB connector.

I would like to plug this light into my computer, and be able to turn it on/off from the command line. Is this achievable? (Ubuntu 22.04)

Jordan
  • 131
  • 3
  • 5
    Does this answer your question? [Turning off power to usb port. Or turn off power to entire usb subsystem](https://unix.stackexchange.com/questions/165447/turning-off-power-to-usb-port-or-turn-off-power-to-entire-usb-subsystem) – Marcus Müller May 29 '23 at 22:02
  • 1
    Note that the takeaway is: You in all likelihood cannot turn off the *power* to your USB port. Your USB light is "too stupid", if you say it's just a resistor and an LED, and mainboards "hardwire" 5V to the USB connectors. If it *was* an actual USB device, i.e. a microcontroller that "speaks" the USB protocol, shutting down the device *might* be possible, if the software on that microcontroller supports it. – Marcus Müller May 29 '23 at 22:04
  • If your motherboard doesn't support powering off a USB port, you can buy USB hubs that will do this. They implement PPPS Per-Port Power Switching, for software control. There are very few around, see the list given by uhubctl in link above by Marcus. The [uugear](https://www.uugear.com/product/mega4-4-port-usb-3-ppps-hub-for-raspberry-pi-4b/) hub still seems to be sold, for about 35euro. – meuh May 30 '23 at 09:41

0 Answers0