Article 5PCV2 Turning off USB port power

Turning off USB port power

by
CVAlkan
from LinuxQuestions.org on (#5PCV2)
For many years now, we've been able to have our monitor screens go blank after a specified period of inactivity to save power.

More recently, however, we now have backlit keyboards and other USB devices, few of which seem to have any timeouts of their own. This became more apparent than ever to me after I recently purchased a very nice monitor-mounted USB-powered task light (https://www.amazon.com/dp/B08DKQ3JG1...roduct_details). Now if I walk away from the desk, the monitor will shut down nicely, but the task light and keyboard backlight remain on unless I explicitly turn them off, which I sometimes don't do if I wrongly think I'm going to return in five minutes, but get distracted and return four hours later!

So I decided to see if I could do something about that. So far I've had no luck whatever. It is barely possible to do this for [some devices] with [some additional software] (e.g. fiddling with entries in "/sys/bus/usb/devices" or installing uhubctl), but the specifc USB port assignments seem to change with the weather (I do plug and unplug other peripherals, and suspect I always will) and, more importantly, some devices - in particular the task light I purchased and really like) - are not actually USB devices at all. They simply use the USB connector to draw power; they have no drivers, don't show up at all with the usual lsusb commands and the like.

So I experimented a bit with adding "usbcore.autosuspend=-1" to my grub CMDLINE. The chief problem with doing would of course be that neither the keyboard nor the mouse is "alive" enough to wake up the system when I return - probably why the commands seem to be deprecated.

Then I found a nice monitor that has an internal USB hub and wondered if it could be configured to cut off power to its hub (or, even better, to an individual port) when it got the "go dark" command from its HDMI port; that way I could plug the desk lamp into that (cleaning up cabling in the process!). I contacted a vendor that sells and supports that particular monitor and the answer was something like "no one ever asked that before, but it sounds like an interesting idea; let me check." So far, it's looking like such a product doesn't exist.

Thinking that I can't be the only user on the planet who had thought about doing something similar, I was wondering if anyone has found a practical solution for accomplishing such a "group sleep". There are now loads of USB-powered "things" one might want to shut off when leaving the desk (my son-in-law has a USB-powered fan for example), so I'd love to hear any ideas ... even if it's something embarrassingly obvious that I overlooked!

Stay safe.latest?d=yIl2AUoC8zA latest?i=nrbU4f_8cHA:qFWDhZToydQ:F7zBnMy latest?i=nrbU4f_8cHA:qFWDhZToydQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=nrbU4f_8cHA:qFWDhZToydQ:gIN9vFwnrbU4f_8cHA
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments