Software installation and configuration
All features of Strato Pi UPS are controlled via dedicated GPIO, the I
2
C bus and a soft
serial RX/TX interface to the embedded micro-controller and can be used with most
operating systems and programming languages.
The following software installation notes are based on the Raspbian operating system.
Installing the Strato Pi utility
The Strato Pi utility is a simple command-line script to control Strato Pi’s buzzer, watchdog
and UPS functions.
Run the following commands to download and install the Strato Pi utility:
$
cd /usr/local/bin
$
sudo wget http://sferalabs.cc/files/strato/strato
$
sudo chmod 755 strato
You can run the Strato Pi utility without arguments to print its options:
$
strato
Usage: strato beep on|off|length_millis|length_millis pause_millis repeats
strato watchdog enable|disable|heartbeat|timeout
strato shutdown
strato battery
All commands should be run as superuser, so always use sudo to run strato.
Installing the Strato Pi kernel module
The Strato Pi kernel module can be used to easily access Strato Pi's features via sysfs file
system.
Refer to the following instructions to download and install the module or go to:
https://github.com/sfera-labs/strato-pi-kernel-module
for updated instructions, usage details and examples.
Download and install:
$
sudo apt install git raspberrypi-kernel-headers
$
git clone --depth 1 --recursive https://github.com/sfera-labs/strato-pi-
kernel-module.git
$
cd strato-pi-kernel-module
$
make
$
sudo make install
$
dtc -@ -Hepapr -I dts -O dtb -o stratopi.dtbo stratopi.dts
$
sudo cp stratopi.dtbo /boot/overlays/
Add the following line to /boot/config.txt:
dtoverlay=stratopi
Optionally, to be able to use the sysfs files not as super user, create a new group "stratopi"
and set it as the module owner group by adding an udev rule:
$
sudo groupadd stratopi
$
sudo cp 99-stratopi.rules /etc/udev/rules.d/
16
Strato Pi UPS User Guide