Skip to content

Instantly share code, notes, and snippets.

@vasilisvg
Created November 7, 2019 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vasilisvg/cf89650e33724ecaf1c0a00041cb1356 to your computer and use it in GitHub Desktop.
Save vasilisvg/cf89650e33724ecaf1c0a00041cb1356 to your computer and use it in GitHub Desktop.

Saving power on your raspberry pi

Most of my Raspberry Pis do one single thing well. Which means that there is probably quite some stuff that can be disabled. For instance, if you use your Pi without a monitor, you can disable the firewire. And if you don’t need an ethernet and don’t need a USB connection, you should disable those. It will save quite some energy.

Shut off your Pi

I guess the number one tip is to shut down your Pi when you don’t need it. For some applications a simple on/off button would work. Here’s a nice, very simple explanation of how to do that.

Disable the USB and Ethernet block

If you don’t need ethernet, and you don’t need USB you can disable the complete USB and Ethernet block. This saves a lot of power. One of my Pis streams music from a record player to an airplay receiver and with USB/Ethernet disabled the GPU temperature is a constant 38.6ºC. When I keep it enabled the temperature rises to 46.7ºC. If you don’t need it, don’t heat it, I guess.

Disabling the complete block is done with this command:

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

If you want to disable this block every time the Pi boots you could easily add this command to your crontab:

sudo crontab -e

And now add this line to it:

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

If you want to re-enable the block, remove this line from your crontab and reboot. As far as I know you can only disable the complete block.

Disable bluetooth, disable LEDs, disable Wifi

If you don’t need any of these things, disable the ones you don’t need.

sudo nano /boot/config.txt

Add these lines to the file

# Disable bluetooth
dtoverlay=pi3-disable-bt-overlay
dtoverlay=pi3-disable-bt

# Disable the ACT LED.
dtparam=act_led_trigger=none
dtparam=act_led_activelow=off
# Disable the PWR LED.
dtparam=pwr_led_trigger=none
dtparam=pwr_led_activelow=off

# Disable Wifi
dtoverlay=pi3-disable-wifi

Disable firewire

Disabling firewire is done with this command:

sudo /opt/vc/bin/tvservice -o

If you want to disable firewire every time the Pi boots you could easily add this command to your crontab:

sudo crontab -e

And now add this line to it:

@reboot sudo /opt/vc/bin/tvservice -o

If you want to re-enable the block, remove this line from your crontab and reboot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment