In the following we will learn how to add a power switch for LibreELEC running on a Raspberry Pi. We will use a PowerBlock to not only add a power button, but also a status LED that indicates the power status of you LibreELEC installation.
a power button and cables for attaching it to the PowerBlock
(optionally) a status LED and cables for attaching it to the PowerBlock
For these instructions we are going to install LibreELEC on a Raspberry Pi. Therefore, we go to https://libreelec.tv/raspberry-pi-4/ and click the .img.gz link to start the download.
Now we are going to load the downloaded image to an SD card. I recommend to use Etcher for that. You can find it at https://www.balena.io/etcher/. It is a tool for writing SD card images and is available for all major platforms.
When you have loaded the LibreELEC image onto the SD card, put it into the Raspberry Pi. If not already done, connect the HDMI cable and the Ethernet cable with the Raspberry Pi.
Then attach the PowerBlock to the GPIO header of the Raspberry Pi.
Attach a power button and, optionally, a status LED to the PowerBlock.
Finally, attach the USB power cable to the PowerBlock.
Switch on the Raspberry Pi with the power button and wait for LibreELEC to finish booting.
Next we want to SSH into the running LibreELEC instance. Therefore, we need the IP address of it. You can find it, e.g., via the settings – network menu from within LibreELEC. Log into LibreELEC with the tool of your choice. From a Mac or Linux command line, e.g., you could call ssh root@IP_OF_YOUR_LIBRELEC_INSTANCE. The default password of LibreELEC is libreelec.
For the installation of the PowerBlock driver we follow the instructions from the official Github repository. Install the PowerBlock service with the following command:
Copy to Clipboard
The installation finishes and the driver is started automatically.
With the driver being installed, you should be able to switch off and on the Raspberry Pi with the power button that you attached to the PowerBlock.
Necessary and Functional
These cookies are placed to make it possible to analyze this website (with Google Analytics) and optimize for the purpose of a.o. the usability.
Cookie names: _ga, _gat, _gid
These cookies are placed to show advertisements (of Google AdSense) and to get these close to your interest.
Cookie names: id, IDE, FLC, DSID, SNID, NID
These cookies are required to show the cookie notification bar, remember your cookie acceptance choice and apply this choice.
Cookie names: privacy_embeds, wpca_consent, woocommerce_cart_hash, woocommerce_items_in_cart, wp_woocommerce_session_, wp-settings-1, wp-settings-time-1