The command line interface (CLI) included in this repository gives you full access to every feature of the card. It is the quickest way to get started and is all you need to operate the card.
If you would rather use a different platform, you can access the same functionality through dedicated, ready-to-use integrations:
- Python Library
- Node-RED example based on "exec" node
- Node-RED "8relind" node
- Modbus RTU slave
- Home Assistant Integration
- Arduino Library
For a firmware update, please follow the instructions in the link below:
Note: This repository contains the command line and Python functions to control Ver. 4 of the card. If you use Ver. 3.x, download from here. If you have Ver. 1-2 with screw-type connectors, download from here.
1. Enable I2C communication
This only needs to be done once on each Raspberry Pi.
On Raspberry Pi OS, install raspi-config first:
sudo apt update
sudo apt install raspi-configThen run:
sudo raspi-configFollow the steps in the 3 screenshots below to enable I2C communication. After that, reboot the Raspberry Pi for the changes to take effect.
Reboot the Raspberry Pi:
sudo reboot2. Install git and build-essential packages
sudo apt update
sudo apt install git build-essentialInstall the CLI with:
cd
git clone https://github.com/SequentMicrosystems/8relind-rpi.git
cd 8relind-rpi/
sudo make installTo update to the latest version:
cd ~/8relind-rpi/
git pull
sudo make installYou can now access all the functions of the Eight Relays 4A/120V 8-Layer Stackable HAT for Raspberry Pi through the "8relind" command. Use the -h option for help:
8relind -hFor more detailed help on a specific function, use the -h option after the function name. For example:
8relind -h readExample output:
8relind -h readOutputs:
read: Read relays status
Usage: 8relind <id> read <channel>
Usage: 8relind <id> read
Example: 8relind 0 read 2; Read Status of Relay #2 on Board #0



