1

I am seeking ways to reduce power consumption on my raspberry pi 3B+. I've read that one of the most efficient ways is to turn off the USB chip. This link shows how to do so via the toggle commands.

Turn OFF USB chip

echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/unbind

Turn ON USB chip

echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/bind


But I do not think that this is a permanent method, i.e. the USB chip turns on whenever I reboot the raspberry pi.

Is there a way to turn it off permanently?

  • That's the best you've got without physical destruction of the hardware. – Dougie Dec 21 '19 at 13:31
  • I think I was looking more for adding a line of code into the /boot/config.txt , thats the way I've done it for switching off the LEDs and the HDMI port. Is the same method not possible for USB? – Tian Dec 21 '19 at 14:03
  • 2
    There's nothing like that. Create a systemd service to run your echo commands and get that started during boot-up. – Dougie Dec 22 '19 at 0:46
  • doesn't turning off USB also turn off ethernet? – Jaromanda X Dec 22 '19 at 2:53
  • You can add echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/unbind in /etc/rc.local befor Exit 0. – M. Rostami Dec 22 '19 at 10:55
2

Usually hardware is managed with options in /boot/config.txt. Available options can be found in /boot/overlays/README. I have searched there for .*usb.* without a match. So it seems there is no option for the kernel to disable the USB chip on boot up. You should use a systemd service to execute your command on boot up. Create a new service with:

rpi ~$ sudo systemctl --force --full edit turn_off_usb.service

In the empty editor insert these statements:

[Unit]
Description=Turn off USB chip
After=basic.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c 'echo "1-1" > /sys/bus/usb/drivers/usb/unbind'

[Install]
WantedBy=basic.target

Enable the new service with:

rpi ~$ sudo systemctl enable turn_off_usb.service
# check with
rpi ~$ systemctl status turn_off_usb.service
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.