Firmware (the software running on the IO boards) is a big part of our hardware (except Unipi 1.1) and gets updated during the time as things are getting fixed or new functionality is being added.
The Firmware is a standard part of our OS images and is also distributed in our repository in the unipi-firmware6 package.
Package update does not flash the firmware onto the IO boards, this requires a manual intervention.
The first necessary step is to connect to the unit via SSH. How to connect via SSH is explained in SSH access. How to find or set the password for SSH is also described in the article about Passwords.
To update the firmware, you need to obtain the update package. We strongly recommend online update, as offline update might need expert Debian knowledge.
sudo apt update && sudo apt upgrade
sudo reboot
Attention:
This option is for experts only, as it might require to bring newer versions of other packages, we highly recommend using the online installation method.
dpkg -i /tmp/unipi-firmware_5.50_all.deb
sudo su
fdisk -l
mkdir /media/usbflash
mount /dev/sda /media/usbflash
dpkg -i /media/usbflash/unipi-firmware_5.50_all.deb
There are two tools for managing firmware of Unipi products:
The tools are located in /opt/unipi/tools/ directory and have to be run as root.
This is an example that will get the current firmware version of board on section 1.
sudo /opt/unipi/tools/fwspi -u 1
Note, the parameter -u specifies the board Modbus address - board section.
The internal IO boards are fixed, so only information needed is the section number.
sudo /opt/unipi/tools/fwspi -u 1
sudo /opt/unipi/tools/fwspi -av
xS/xG series extensions can be upgraded similarly. Apart from Modbus address, you also need to specify the port and other RS-485 parameters, if they do not use the default setting.
Attention:
Make sure that there is no other application using/communicating on the used port and do not disconnect power to the unit or Extension. Any of this will lead to bricking the extension.
Note:
The -p (port) parameter must be set according to the used serial for the extension - see the serial port mapping for Unipi Edge, Unipi Patron, Unipi Neuron or Unipi Axon to find proper serial port within your unit. For example, if extension is connected to RS485-1/RS485-1.1:
sudo /opt/unipi/tools/fwserial -p /run/unipi-plc/by-sys/rs485-1/tty -P
Note that the fwserial assumes that extension's Modbus address, baud rate and parity are in the factory-default state, ie 19200 baud 8N1 with address 15, if you have a different configuration, you need to specify as parameters:
-b, --baud <bps> baudrate, default 19200
-o, --stopbits <n> stop bits (1|2), default 1
-r*, --parity <type> parity (N|E|O), default N
* -r is currently available only on systems running Debian 13
When the extension is on port /run/unipi-plc/by-sys/rs485-1/tty, Modbus address 6, baudrate 9600 and parity even:
sudo /opt/unipi/tools/fwserial -p /run/unipi-plc/by-sys/rs485-1/tty -u 6 -b 9600 --parity E
sudo /opt/unipi/tools/fwserial -p /run/unipi-plc/by-sys/rs485-1/tty -u 6 -b 9600 --parity E -Pv
Direct update from older firmwares (5.x and below) is not possible, an upgrade needs to be performed. The only change is that parameter -U (or parameter -a and doing the command for each board separately) is used instead of -P, see the examples for both commands:
sudo /opt/unipi/tools/fwspi -u 1 -Uv
sudo /opt/unipi/tools/fwserial -p /run/unipi-plc/by-sys/rs485-1/tty -u 15 -Uv
When updating the firmware, you can also reset the configuration (AO type, MWD, default states) to the default state with the -R parameter. For example:
sudo /opt/unipi/tools/fwspi -u 1 -PRv