This is the command line and python functions to control the 8-RELAYS Stackable Card for Raspberry Pi Ver. 3. If you have Ver. 1-2 with screw-type connectors download from here.
Don't forget to enable I2C communication:
~$ sudo raspi-config
A good article about I2C on Raspberry can be found here.
If you use Ubuntu you need to install bash raspi-config
first:
~$ sudo apt update
~$ sudo apt install raspi-config
~$ git clone https://github.com/SequentMicrosystems/8relay-rpi.git
~$ cd 8relay-rpi/
~/8relay-rpi$ sudo make install
Now you can access all the functions of the relays board through the command "8relay". Use -h option for help:
~$ 8relay -h
If you clone the repository any update can be made with the following commands:
~$ cd 8relay-rpi/
~/8relay-rpi$ git pull
~/8relay-rpi$ sudo make install