View previous topic :: View next topic |
Author |
Message |
The Main Man Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 27 Nov 2014 Posts: 1172 Location: /run/user/1000
|
Posted: Wed Oct 23, 2019 12:25 pm Post subject: Disable USB port ? |
|
|
Got a new mouse, and it has a very bright light coming out of it, mostly through scroll wheel, it makes problems during a night when I go to sleep.
Now, I know I can cover it with something or plug it off, or open it and do something with it etc.
But I'm wondering is there a way to disable USB port via some terminal command, piece of software or something like that, because I would prefer that option first.
I tried to google it, there was one option with powertop, that didn't work, then few commands via terminal, that didn't work as well, mostly because the posts were old and it was for older kernels.
So, can it be done ? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mike155 Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
The Main Man Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 27 Nov 2014 Posts: 1172 Location: /run/user/1000
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
krinn Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/gallery/Blade Runner/movie_blade_runner_howl.gif)
Joined: 02 May 2003 Posts: 7470
|
Posted: Thu Oct 24, 2019 12:31 pm Post subject: |
|
|
Code: | dmesg
...
[ 4963.102582] input: Logitech USB Laser Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13:1.0/0003:046D:C062.0005/input/input17
|
the thing to get is that the mouse is input17 (for now)
off: echo remove > /sys/class/input/input17/event0/uevent
on: echo add > /sys/class/input/input17/event0/uevent
ps: i don't have a fancy light to see if it power it off for real, but at least, the mouse stop working in the UI |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
The Main Man Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 27 Nov 2014 Posts: 1172 Location: /run/user/1000
|
Posted: Thu Oct 24, 2019 12:43 pm Post subject: |
|
|
It disabled the mouse, but the light was still on.
Thanks for trying! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
krinn Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/gallery/Blade Runner/movie_blade_runner_howl.gif)
Joined: 02 May 2003 Posts: 7470
|
Posted: Thu Oct 24, 2019 12:57 pm Post subject: |
|
|
well, i'm not in mood for disabling my whole usb port holding the mouse, but if you're in, maybe disable the usb port the mouse is attach to would do
you can get it with udevadm info /sys/class/input/input17
ps: of course you better make sure your keyboard isn't attach to that port too, else, you will have a little problem trying to send the add event next ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
The Main Man Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 27 Nov 2014 Posts: 1172 Location: /run/user/1000
|
Posted: Thu Oct 24, 2019 1:23 pm Post subject: |
|
|
I'm in the mood
I don't get it how to disable the port though, here's the output :
Code: | $ udevadm info /sys/class/input/input11
P: /devices/pci0000:00/0000:00:01.2/0000:01:00.0/usb1/1-4/1-4:1.0/0003:0000:0538.0001/input/input11
E: DEVPATH=/devices/pci0000:00/0000:00:01.2/0000:01:00.0/usb1/1-4/1-4:1.0/0003:0000:0538.0001/input/input11
E: EV=17
E: ID_BUS=usb
E: ID_INPUT=1
E: ID_INPUT_MOUSE=1
E: ID_MODEL=USB_OPTICAL_MOUSE
E: ID_MODEL_ENC=\x20USB\x20OPTICAL\x20MOUSE
E: ID_MODEL_ID=0538
E: ID_PATH=pci-0000:01:00.0-usb-0:4:1.0
E: ID_PATH_TAG=pci-0000_01_00_0-usb-0_4_1_0
E: ID_REVISION=0100
E: ID_SERIAL=0000_USB_OPTICAL_MOUSE
E: ID_TYPE=hid
E: ID_USB_DRIVER=usbhid
E: ID_USB_INTERFACES=:030102:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=0000
E: ID_VENDOR_ENC=0000
E: ID_VENDOR_ID=0000
E: KEY=70000 0 0 0 0
E: MODALIAS=input:b0003v0000p0538e0111-e0,1,2,4,k110,111,112,r0,1,8,B,am4,lsfw
E: MSC=10
E: NAME=" USB OPTICAL MOUSE"
E: PHYS="usb-0000:01:00.0-4/input0"
E: PRODUCT=3/0/538/111
E: PROP=0
E: REL=903
E: SUBSYSTEM=input
E: UNIQ=""
E: USEC_INITIALIZED=6241323 |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Ant P. Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Fri Oct 25, 2019 8:39 am Post subject: |
|
|
You can tell the kernel to put it in powersaving mode automatically after a timeout, which should kill the LED until you wake it up with a click.
Here's a config file I use for mine:
/etc/udev/rules.d/local-usb.rules: |
ACTION!="add|change", GOTO="local_usb_end"
SUBSYSTEM!="usb", GOTO="local_usb_end"
# keyboard
ATTR{idVendor}=="045e", ATTR{idProduct}=="00db", ATTR{power/control}="auto", ATTR{power/autosuspend}="300"
# mice
ATTR{idVendor}=="045e", ATTR{idProduct}=="0039", ATTR{power/control}="auto", ATTR{power/autosuspend}="900"
ATTR{idVendor}=="045e", ATTR{idProduct}=="076c", ATTR{power/control}="auto", ATTR{power/autosuspend}="900"
# tablet
ATTR{idVendor}=="172f", ATTR{idProduct}=="0031", ATTR{power/control}="auto" # default timeout of 5 is fine
LABEL="local_usb_end"
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
The Main Man Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 27 Nov 2014 Posts: 1172 Location: /run/user/1000
|
Posted: Fri Oct 25, 2019 9:06 am Post subject: |
|
|
Doesn't work, after I made that file I did '/etc/init.d/udev reload' , hope that was enough.
btw I changed timeouts to 5, just to test it out.
Is idProduct relevant maybe or something else in that config that I should perhaps change ?
edit:
I changed idVendor to 0000 and idProduct to 0538, but still no luck |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
krinn Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/gallery/Blade Runner/movie_blade_runner_howl.gif)
Joined: 02 May 2003 Posts: 7470
|
Posted: Fri Oct 25, 2019 1:12 pm Post subject: |
|
|
kajzer wrote: | Code: | P: /devices/pci0000:00/:00:010000.2/0000:01:00.0/usb1/1-4/1-4:1.0/0003:0000:0538.0001/input/input11 |
|
/sys/class/pci_bus/0000:00/device/00:010000.2/usb1/
(but your path have another bus 0000:01:00.0 in between so i'm less sure about the path, seek usb1 name to find the right path, you have the product file to see if its the controller and the uevent file there to try disable it)
Code: | pwd
/sys/class/pci_bus/0000:00/device/0000:00:14.0/usb1
cat product
xHCI Host Controller
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
The Main Man Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 27 Nov 2014 Posts: 1172 Location: /run/user/1000
|
Posted: Fri Oct 25, 2019 4:01 pm Post subject: |
|
|
Well, I get what you're saying and what needs to be done, but having a hard time finding that path.
There are many combinations and seems like I have to manually go through each in order to find the right one.
Can't really deal with that at the moment so I'll try it when I can. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Ant P. Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Fri Oct 25, 2019 11:12 pm Post subject: |
|
|
Your mouse also needs to be powersaving-capable. Chances are they skipped that part, because they couldn't even be bothered to get a real vendor ID. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
The Main Man Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 27 Nov 2014 Posts: 1172 Location: /run/user/1000
|
Posted: Sat Oct 26, 2019 12:16 am Post subject: |
|
|
When I say it doesn't work I mean the light is still on but the mouse is disabled.
It's like doing it the other way krinn suggested.
I mean here's the log , it gets disabled, it gets enabled again on move/click.
Code: | [ +0.411666] usb 1-4: new low-speed USB device number 8 using xhci_hcd
[ +0.315088] input: USB OPTICAL MOUSE as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/usb1/1-4/1-4:1.0/0003:0000:0538.0006/input/input17
[ +0.000102] hid-generic 0003:0000:0538.0006: input,hidraw0: USB HID v1.11 Mouse [ USB OPTICAL MOUSE] on usb-0000:01:00.0-4/input0
[ +12.874338] usb 1-4: USB disconnect, device number 8
[ +0.408244] usb 1-4: new low-speed USB device number 9 using xhci_hcd
[ +0.315759] input: USB OPTICAL MOUSE as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/usb1/1-4/1-4:1.0/0003:0000:0538.0007/input/input18
[ +0.000120] hid-generic 0003:0000:0538.0007: input,hidraw0: USB HID v1.11 Mouse [ USB OPTICAL MOUSE] on usb-0000:01:00.0-4/input0
[ +7.291391] usb 1-4: USB disconnect, device number 9
[ +0.407475] usb 1-4: new low-speed USB device number 10 using xhci_hcd
[ +0.316221] input: USB OPTICAL MOUSE as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/usb1/1-4/1-4:1.0/0003:0000:0538.0008/input/input19
[ +0.000118] hid-generic 0003:0000:0538.0008: input,hidraw0: USB HID v1.11 Mouse [ USB OPTICAL MOUSE] on usb-0000:01:00.0-4/input0
[ +14.233223] usb 1-4: USB disconnect, device number 10
[ +0.393021] usb 1-4: new low-speed USB device number 11 using xhci_hcd
[ +0.314932] input: USB OPTICAL MOUSE as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/usb1/1-4/1-4:1.0/0003:0000:0538.0009/input/input20
[ +0.000242] hid-generic 0003:0000:0538.0009: input,hidraw0: USB HID v1.11 Mouse [ USB OPTICAL MOUSE] on usb-0000:01:00.0-4/input0
[ +9.986627] usb 1-4: USB disconnect, device number 11
[ +0.410938] usb 1-4: new low-speed USB device number 12 using xhci_hcd
[ +0.317095] input: USB OPTICAL MOUSE as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/usb1/1-4/1-4:1.0/0003:0000:0538.000A/input/input21
[ +0.000124] hid-generic 0003:0000:0538.000A: input,hidraw0: USB HID v1.11 Mouse [ USB OPTICAL MOUSE] on usb-0000:01:00.0-4/input0 |
That's why I think that disabling the port power is the way to go.
Telling the kernel that specific usb port doesn't exist, if possible.
Last edited by The Main Man on Sat Oct 26, 2019 12:21 am; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Jaglover Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/179708169458f2999e44e26.gif)
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
The Main Man Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 27 Nov 2014 Posts: 1172 Location: /run/user/1000
|
Posted: Sat Oct 26, 2019 12:22 am Post subject: |
|
|
Jaglover wrote: | How about taking that mouse apart and applying a piece of tape or nail polish on that LED. ![Razz :P](images/smiles/icon_razz.gif) |
Eventually that's going to happen ![Very Happy :D](images/smiles/icon_biggrin.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
eccerr0r Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
Joined: 01 Jul 2004 Posts: 9891 Location: almost Mile High in the USA
|
Posted: Sat Oct 26, 2019 12:54 am Post subject: |
|
|
A lot of computers cannot disable the power on USB ports while the computer is on.
A lot of mice do not know how to deal with power save.
Chances are, removing/masking the LED and/or replacing the sensor illumination LED with an infrared one is all you can do. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
The Main Man Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 27 Nov 2014 Posts: 1172 Location: /run/user/1000
|
Posted: Sat Oct 26, 2019 6:05 pm Post subject: |
|
|
Yeah, well I kinda like the light when I'm not sleeping, was hoping that maybe there's a way.
Maybe I'll find it, not really in a rush, will not give up, for now covering the mouse with dark cloth works fine. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|