UniPi

UniPi Software

This section includes topics related to UniPi software (repository, firmware, etc.)

Apt Repository

UniPi firmware, as well as some other UniPi-created SW, is distributed via a Debian repository available at https://repo.unipi.technology/debian/

Currently the packages are supported only for Axon and Neuron generations - Evok for UniPi 1 & lite should be installed as described

Apt is already preconfigured on our Neuron and Axon official images. This guide should be followed only when installing on a clean Raspbian OS.

Add the sources to the apt list

wget https://repo.unipi.technology/debian/unipi.list -O /etc/apt/sources.list.d/unipi.list
wget https://repo.unipi.technology/debian/unipi_pub.gpg -O - | apt-key add -

Let apt to update the unipi sources

apt-get update

And install the required kernel and unipi-firmware packages. This will automatically install the SysFS and Modbus TCP interfaces as well as support for RTC and serial lines.

For UniPi Neuron:

apt-get install neuron-kernel unipi-firmware unipi-modbus-tools

For UniPi Axon:

apt-get install axon-kernel unipi-firmware unipi-modbus-tools

Make sure to reboot the system in order to apply the changes!

After reboot, you can check the service status by

systemctl status unipitcp

The internal firmware will be automatically flashed to the current latest version. You can check the firmware version by

/opt/unipi-bin/fwspi -i 0

Firmware

Firmware (aka the Software running within the Hardware) is a big part of our hardware (except UniPi 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-firmware package.

Upgrading firmware

The firmware can be manually upgraded or checked using the fwspi tool which resides in /opt/unipi-bin/ (newly in /opt/unipi/tools/).

To check the firmware on the first group of IOs:

./fwspi -i 0

To check the FW of other IO groups run

./fwspi -i 2

alternatively

./fwspi -i 2

.

The upgrade to the latest version of the Firmware should be done in while the unit is connected to the internet.

The steps below describe only FW upgrade on group 1 (the number 0 for parameter -i). Firmware upgrade can be done automatically on all groups using

./fwspi --auto
Online firmware installation
  • 1. Obtain the latest firmware version
    apt update
    apt install unipi-firmware
  • 2. Check the current FW version installed in the HW
    /opt/unipi-bin/fwspi -i 0
  • 3. Update to the latest obtained FW version
    /opt/unipi-bin/fwspi -i 0 -P
  • 4. Re-check the current FW version installed in the HW
    /opt/unipi-bin/fwspi -i 0
Offline firmware installation

Online installation is always preffered because the firwmare package can have other packages are dependencies (such as firmware-tools). Please always use the online installation.

  • 1. Download the latest version of the unipi-firmware package from https://repo.unipi.technology/debian/pool/ Then it is needed to get it to the unit. There are two ways to do that:
  • 2.a - Using SCP
    • Copy if from your PC to the unit using SCP (a WinSCP, Filezilla or other software can be used) to the /tmp/ folder
    • Install the package using dpkg, for example
      dpkg -i /tmp/unipi-firmware_5.32_all.deb
  • 2.b - Via USB flash
    • Copy the downloaded file from your PC to the root of the FAT32 formated USB flash and insert the USB flash to any USB port of the unit.
    • Switch to root user
      sudo su
    • Find out the name of the inserted flash disk (usually it is sda1)
      fdisk -l
    • Create a mount folder for the disk
      mkdir /media/usbflash
    • Mount the disk to the newly created folder
      mount /dev/sda /media/usbflash
    • Install the package using dpkg, for example
      dpkg -i /media/usbflash/unipi-firmware_5.32_all.deb
  • 3. Check the current FW version installed in the HW
    /opt/unipi-bin/fwspi -i 0
  • 4. Update to the latest obtained FW version
    /opt/unipi-bin/fwspi -i 0 -P
  • 5. Re-check the current FW version installed in the HW
    /opt/unipi-bin/fwspi -i 0

The configuration of the group can be erased to the default state. This is done during the firmware upgrade by calling the fwspi utility also with -R parameter. E.g. ./fwspi -i 0 -PR