Allows control of individual inputs and outputs on Unipi 1x devices except 1Wire bus using the Modbus TCP protocol.
Requires OS based on Debian 12 (bookworm) like Raspberry Pi OS 64-bit or 32-bit
sudo su
echo "deb https://repo.unipi.technology/debian bookworm unipi1-main main" > /etc/apt/sources.list.d/unipi.list
wget https://repo.unipi.technology/debian/unipi_pub.gpg -O /etc/apt/trusted.gpg.d/unipi_pub.asc
apt update
apt install unipi-os-configurator unipi-os-configurator-data
apt install unipi-one-modbus
or use prepared script from Unipi repository
wget -qO - https://repo.unipi.technology/debian/raspberry-unipi1.sh | sudo bash
This installation will install all necessary programs and attempt to automatically configure unipi-one-modbus
Configuration is in the directory /etc/unipi-one-modbus.d The Unipi 1x platform does not support automatic configuration of connected modules. When using the EMO-R8 extension, it is necessary to specify this module in the /etc/unipi-id directory. The procedure is specified in the '/etc/unipi-id/README.md' file from package 'unipi-os-configurator-data'.
The default Modbus server runs at the address 127.0.0.1 and port 503. It can be changed in the configuration file.
Requires python3.11, libiio0 or pigpiod binaries and some python packages
pip3 install -r ./requirements.txt
Configuration needs to be created according to the template. It supports configuration via a directory /etc/unipi-one-modbus.d (merges all .yaml files in the directory in alphabetical order) or the configuration is in one file (/etc/unipi-one-modbus.yaml).
The hardware can be communicated either via a kernel module (recommended) or via the pigpiod daemon, which needs to be installed and started. See examples in the configs directory.
For the kernel module option, overlays need to be added to /boot/firmware/config.txt.
dtoverlay=pwm,pin=18,2
dtoverlay=mcp342x,mcp3422,addr=0x68
dtoverlay=mcp23017,mcp23008,addr=0x20,noints
Alternatively, when using EMO-R8
dtoverlay=mcp23017,mcp23008,addr=0x21,noints
dtoverlay=mcp23017,mcp23008,addr=0x22,noints
sudo su
apt-get remove unipi-one-modbus
reboot
Do you feel like contributing to unipi-one-modbus, or perhaps have a neat idea for an improvement to our system?
Great! We are open to all ideas. Get in touch with us via email to info at unipi DOT technology
Apache License, Version 2.0