My HTPC is setup for dualboot LibreELEC with Windows 10 and Windows is only used for games and emulators.
I own a Dolphinbar to be able to use my Wii remotes with Dolphin(Wii emulator) and anyone having the Dolphinbar knows it has those bright blue leds facing you, which can be very distracting when watching a movie in the dark.
Since the Dolphinbar, in my case, is useless in LibreELEC and don't feel like having to move it or unplug/plug it every time i decided to disable it when LibreELEC boots via the USB port and share this little guide in case someone else is facing a similar situation(this guide will not work for every situations).
Here is how it's done (i will use my Dolphinbar as an example);
-First you need to find the USB port of the device by sending the command below via SSH
In my case it gives me this output
QuoteDisplay More
Bus 002 Device 002: ID 8087:8001 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8009 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 1915:0196 Nordic Semiconductor ASA
Bus 003 Device 003: ID 0e8f:3013 GreenAsia Inc.
Bus 003 Device 002: ID 0e8f:3013 GreenAsia Inc.
Bus 003 Device 006: ID 8087:07dc Intel Corp.
Bus 003 Device 005: ID 057e:0306 Nintendo Co., Ltd Wii Remote Controller RVL-003
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The Bus ID of the Dolphinbar is: 057e:0306
-Now we are going to find where the device is located by sending the command "grep"+ the second part of the Bus ID, which in my case would be: 0306, use your Bus ID
In my case it gives me this output
Quote
/sys/bus/usb/devices/3-10/idProduct:0306
The location of your device will be displayed after "/devices" which in my case is: 3-10, and now we can disable the specific USB port of the Dolphinbar by sending 2 commands via SSH.
Now let's make sure those commands work via SSH before putting them in "autostart.sh" for them to take effect at every boot.
-Using the location of your device, which in my case the Dolphinbar is located at "3-10" use your device location after /devices, send these 2 commands via SSH;
If it worked your device should now be disabled/powered off and you can now create an "autostart.sh" file and place it at: storage/.config
Now we need to edit the "autostart.sh" file and we will add a little delay to those commands because if they are executed too early during boot they might not take effect.
-Again using the location of your device, which in my case the Dolphinbar is located at "3-10" edit the "autostart.sh" like so;
#!/bin/sh
sleep 3; echo "0" > "/sys/bus/usb/devices/3-10/power/autosuspend_delay_ms" &
sleep 5; echo "auto" > "/sys/bus/usb/devices/3-10/power/control"
You can increase or decrease the delay but in my case the minimum delay for this to work is, "sleep 1" for the first command and "sleep 2" for the second.
Save it and if you need to make it executable send this command;
Now after rebooting the system your USB device should automatically disable itself not long after the Kodi splash screen.