Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

PowerBlock Driver

This is the driver for the PowerBlock, which is an extension board for the Raspberry Pi (TM). The driver itself is denoted as powerblock in the following. The driver provides a service for interacting with the power button signal as well as driving the optionally attached LED.

The following description is intended to be used in combination with a Raspberry Pi and a Linux-based operating system running on the Raspberry Pi. There is a driver for Windows 10 IoT Core that can be found at


There comes an installation script with this reposity that does all the steps described below: This script compiles the driver, installs the binary and configuration files, and installs the PowerBlock service.

To run the quick installation, you just need to call this one line from the Raspbian console

wget -O - | sudo bash

To uninstall the service you can simply call sudo ./ from within the PowerBlock directory.


The configuration file of powerblock is located at /etc/powerblockconfig.cfg. It uses simple .ini file syntax = for setting the the values of its configuration parameters.

The parameters are explained in detail in the following:

  • activated: Can be set to
    • 1: Activates the handling of the power switch signals of the PowerBlock.
    • 0: Deactivates the handling of the power switch signals of the PowerBlock.
  • statuspin: Raspberry BCM pin used for status signaling (default: 17) connects to S2 on PowerBlock
  • shutdownpin: Raspberry BCM pin used for shutdown signaling (default: 18) connects to S1 on Powerblock
  • logging: Enables or disables logging via syslog to /var/log/syslog. The logging is enabled if set to 1.


The PowerBlock driver logs certain events in the file /var/log/syslog.

Shutdown Script

When the driver observes a shutdown signal from the PowerBlock, a shutdown Bash script is called. You can find and edit it at /etc/

LibreELEC Installation

This section is about installing the PowerBlock service on LibreELEC. In the following, it is assumed that we install the driver on a fresh, unmodified LibreELEC installation.

First, use SSH to log into the running LibreELEC instance. This can be done, e.g., with the command ssh root@IP_OF_LIBREELEC. The default password is libreelec.

Being logged in, the actual driver installation is done with this command:

wget -O - | bash

And that's it!

Have fun!