That isn't a measured power draw.  It's what the device tells the host that it 
needs.  The actual power usage is likely much lower.

You could probably test this pretty easily with your keyboard.  Each keyboard 
indicator light draws between 10-30ma, so run
Lsusb on your keyboard with all 3 lights off, then turn on scroll lock, numlock 
etc. and run it again and see if the power "usage"
Has increased.  I'm betting it won't.

It's also not at all logical a mouse would draw 5 times the power when it only 
has 1 led in it while a KB has 3.

Per USB specs any USB port must supply at minimum 100ma and any device drawing 
more than that must command the host
During enumeration to supply more power.  Most likely the chip in the mouse 
just sends 500 since that's the amount that every
USB port ever manufactured all the way down to USB 1.0 is able to support.  
Obviously higher versions can supply more power if
Requested.

A USB power meter is only $4 off Amazon:

https://www.amazon.com/Current-Voltage-Multimeter-Digital-Detector/dp/B09Z6PQZRS

Ted

-----Original Message-----
From: PLUG <plug-boun...@lists.pdxlinux.org> On Behalf Of Ben Koenig
Sent: Tuesday, January 23, 2024 5:25 PM
To: Portland Linux/Unix Group <plug@lists.pdxlinux.org>
Subject: Re: [PLUG] How to script USB device detection

The USB descriptors reported by lsusb -v will also report the MaxPower value of 
a given device.

e.g. my Logitech keyboard is currently reporting a MaxPower usage of 98mA while 
my Roccat mouse is reporting 500mA

# lsusb -vd 046d:c53d |grep MaxPower
    MaxPower               98mA
# lsusb -vd 1e7d:2dcd |grep MaxPower
    MaxPower              500mA


This might be useful if you need to identify at what point USB power draw 
becomes a problem.
-Ben


On Tuesday, January 23rd, 2024 at 10:10 AM, Tomas Kuchta 
<tomas.kuchta.li...@gmail.com> wrote:

> This article may tell you more about what you need
> 
> https://www.baeldung.com/linux/control-usb-power-supply
> 
> -T
> 
> On Tue, Jan 23, 2024, 12:35 Tomas Kuchta tomas.kuchta.li...@gmail.com
> 
> wrote:
> 
> > echo 1 > /sys/bus/usb/drivers/usb/bind
> > 
> > Will bind it again. The side effect of unbind+bind is usb bus/device 
> > reset, depending on whether you are addressing bus or device
> > 
> > The number(s) being echoed means:
> > usbBusNo usbPort usbDevice
> > Check the bus/device format in /sys or dmsg or ....
> > 
> > There is old article from GKH about how this worked in 2.6 kernels 
> > ages ago. It has changed somewhat and improved - see usb kernel 
> > sub-system documentation or google for more details.
> > 
> > https://lwn.net/Articles/143397/
> > 
> > I am typing this on my cell, using google and memory - I was not 
> > able to verify current format on my system at home and I use remote 
> > multi-user centOS at work (cannot mess with that)
> > 
> > Good luck, -T
> > 
> > On Tue, Jan 23, 2024, 11:24 Vince Winter thine.technoc...@gmail.com
> > wrote:
> > 
> > > It is also about the power draw on the processor power and the 
> > > system power from having a USB controller working. Having any USB 
> > > plugged adds noticeable amount of power.
> > > 
> > > I am hoping that telling the kernel, as per the suggestions here, 
> > > to unpower it that the controller goes back to "sleep mode". Also 
> > > it would be convenient if can I bring the device backup with out 
> > > unplugging it.
> > > 
> > > When I have a moment at work, I will get some empirical data if 
> > > this works or not.
> > > 
> > > On Tue, Jan 23, 2024, 5:51 AM Tomas Kuchta 
> > > tomas.kuchta.li...@gmail.com
> > > wrote:
> > > 
> > > > On Tue, Jan 23, 2024, 01:00 Ted Mittelstaedt 
> > > > t...@portlandia-it.com
> > > > wrote:
> > > > 
> > > > > I've messed with this before trying to troubleshoot USB cams.
> > > > > 
> > > > > It's highly dependent on the USB hardware. Not all USB devices 
> > > > > implement "low power" mode.
> > > > > 
> > > > > Your best shot is to get a good USB 4 port hub - not a crappy 
> > > > > one - a good one and the good ones Implement power control and 
> > > > > can cut power to a USB device if you command them to.
> > > > > .
> > > > 
> > > > This is not about how the USB devices (mis)behave. They would 
> > > > not be trying to control the devices, but the USB host(s) in the 
> > > > PC/laptop, I presume.
> > > > 
> > > > USB host can, and will cut power to the bus when directed.
> > > > 
> > > > While I am as guilty as any man - the world really sucks when 
> > > > people who think they understand stuff speak with undoubted authority 
> > > > about stuff.
> > > > 
> > > > Hole it helps, -T

Reply via email to