Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
en:sw:04-unipi-firmware [2019/10/28 10:59]
tomhora
en:sw:04-unipi-firmware [2021/01/14 13:25]
avsetula
Line 1: Line 1:
-======%hide UniPi ====== +====== ​Unipi Software ====== 
-====== UniPi Software ====== +This article ​includes topics related to Unipi software (repository, ​FW tools, etc.)
-This section ​includes topics related to UniPi software (repository, ​firmware, etc.)+
  
-==== Apt Repository === +===== 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/​+All tools are distributed via a Debian ​package ​repository available at https://​repo.unipi.technology/​debian/​
  
-<WRAP center round info 60%> +The APT repository is already preconfigured in our [[files:software:os-images:00-start|official images]].
-Currently the packages are supported only for Axon and Neuron generations - Evok for UniPi 1 & lite should be [[en:sw:02-sdks:01-evok|installed as described]] +
-</​WRAP>​+
  
-<WRAP center round tip 60%> +<WRAP center round info 90%> 
-Apt is already preconfigured on our Neuron ​and Axon official imagesThis guide should be followed only when installing on a clean Raspbian OS.+Currently, the packages are supported only for all controllers except Unipi 1.1 and Unipi 1.1. lite - those should be [[en:​sw:​02-apis:​01-evok|installed as described here.]]
 </​WRAP>​ </​WRAP>​
  
-Add the sources ​to the apt list +To install ​the tools to a clean Debian/​Raspbian system, follow the steps in the README file located in the repository ​https://​repo.unipi.technology/​debian/​README.apt
-<​code>​ +
-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 - +
-</​code>​+
  
-Let apt to update the unipi sources +<WRAP center round info 90%
-<code+Developmnent & Testing versions
-apt-get update +
-</​code>​+
  
-And install the required kernel and unipi-firmware packagesThis will automatically install the SysFS and Modbus TCP interfaces as well as support for RTC and serial lines.+Our tools are also distributed in testing/​development versions. If you wish to install ​those, find the exact package at https://​repo.unipi.technology/​debian/​pool/​test/ ​and just put it's whole name without the suffix, e.g. _arm64.deb, in the //apt install// command.
  
-For UniPi Neuron: +Be aware that any package ​in the testin pool might break things.
-<​code>​ +
-apt-get install neuron-kernel unipi-firmware unipi-modbus-tools +
-</​code>​ +
- +
-For UniPi Axon: +
-<​code>​ +
-apt-get install axon-kernel unipi-firmware unipi-modbus-tools +
-</​code>​ +
- +
-<WRAP center round important 60%> +
-Make sure to reboot the system ​in order to apply the changes!+
 </​WRAP>​ </​WRAP>​
  
-After reboot, you can check the service status by 
-<​code>​systemctl status unipitcp</​code>​ 
  
-The internal firmware will be automatically flashed to the current latest version. You can check the firmware version by +===== Application interfaces ===== 
-<​code>/​opt/​unipi-bin/​fwspi ​-i 0</​code>​+Available APIs are described in the [[en:sw:02-apis:01-evok|SDK section]].
  
-==== Firmware ==== +===== 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.+Firmware (the Software running within the Hardware) 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-firmware package. 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 internal firmware is NOT automatically flashed to the latest version installed using apt. This has to be done manually. 
 + 
 +=== Upgrading firmware ​in Patron/​Neuron/​Axon family PLC controllers ​===
 The firmware can be manually upgraded or checked using the fwspi tool which resides in /​opt/​unipi-bin/​ (newly in /​opt/​unipi/​tools/​). 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:+To check the firmware on the first section ​of IOs:
 <​code>​ <​code>​
-./fwspi -i 0+/​opt/​unipi/​tools/fwspi -i 0
 </​code>​ </​code>​
  
 <WRAP center round info 60%> <WRAP center round info 60%>
-To check the FW of other IO groups ​run <​code>​./fwspi -i 2</​code>​ alternatively <​code>​./fwspi -i 2</​code>​.+To check the FW of other IO sections ​run <​code>​/​opt/​unipi/​tools/fwspi -i 1</​code>​ alternatively <​code>​/​opt/​unipi/​tools/fwspi -i 2</​code>​.
 </​WRAP>​ </​WRAP>​
- 
-The upgrade to the latest version of the Firmware should be done in while the unit is connected to the internet. 
  
 <WRAP center round info 60%> <WRAP center round info 60%>
-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 <​code>​./fwspi --auto</​code>​+Firmware upgrade can be done automatically on all sections available ​using command ​<​code>​/​opt/​unipi/​tools/​fwspi ​-v --auto</​code>​
 </​WRAP>​ </​WRAP>​
  
Line 75: Line 53:
 apt install unipi-firmware apt install unipi-firmware
 </​code>​ </​code>​
-  * 2. Check the current FW version installed in the HW <​code>/​opt/​unipi-bin/fwspi -i 0</​code>​ +  * 2. Check the current FW version installed in the HW <​code>/​opt/​unipi/tools/fwspi -i 0</​code>​ 
-  * 3. Update to the latest obtained FW version <​code>/​opt/​unipi-bin/fwspi -i 0 -P</​code>​ +  * 3. Update to the latest obtained FW version <​code>/​opt/​unipi/tools/fwspi -i 0 -P</​code>​ 
-  * 4. Re-check the current FW version installed in the HW <​code>/​opt/​unipi-bin/fwspi -i 0</​code>​+  * 4. Re-check the current FW version installed in the HW <​code>/​opt/​unipi/tools/fwspi -i 0</​code>​
  
  
 == Offline firmware installation == == 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.+<WRAP center round important 60%> 
 +Online installation is always ​preferred ​because the firmware ​package can have other packages are dependencies (such as firmware-tools, kernel driver, ...). Please always use the online installation. 
 +</​WRAP>​ 
   * 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:   * 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   * 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       * 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 <​code>​dpkg -i /​tmp/​unipi-firmware_5.32_all.deb</​code>​+      * Install the package using dpkg, for example <​code>​dpkg -i /​tmp/​unipi-firmware_5.50_all.deb</​code>​
   * 2.b - Via USB flash   * 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.       * 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.
Line 92: Line 73:
       * Create a mount folder for the disk <​code>​mkdir /​media/​usbflash</​code>​       * Create a mount folder for the disk <​code>​mkdir /​media/​usbflash</​code>​
       * Mount the disk to the newly created folder <​code>​mount /dev/sda /​media/​usbflash</​code>​       * Mount the disk to the newly created folder <​code>​mount /dev/sda /​media/​usbflash</​code>​
-      * Install the package using dpkg, for example <​code>​dpkg -i /​media/​usbflash/​unipi-firmware_5.32_all.deb</​code>​  +      * Install the package using dpkg, for example <​code>​dpkg -i /​media/​usbflash/​unipi-firmware_5.50_all.deb</​code>​  
-  * 3. Check the current FW version installed in the HW <​code>/​opt/​unipi-bin/fwspi -i 0</​code>​ +  * 3. Check the current FW version installed in the HW <​code>/​opt/​unipi/tools/fwspi -i 0</​code>​ 
-  * 4. Update to the latest obtained FW version <​code>/​opt/​unipi-bin/fwspi -i 0 -P</​code>​ +  * 4. Update to the latest obtained FW version <​code>/​opt/​unipi/tools/fwspi -i 0 -P</​code>​ 
-  * 5. Re-check the current FW version installed in the HW <​code>/​opt/​unipi-bin/fwspi -i 0</​code>​+  * 5. Re-check the current FW version installed in the HW <​code>/​opt/​unipi/tools/fwspi -i 0</​code>​
  
 <WRAP center round info 60%> <WRAP center round info 60%>
-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+The configuration of the section ​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. /​opt/​unipi/​tools/fwspi -i 0 -PR 
 +</​WRAP>​ 
 + 
 +=== Upgrading firmware in RS485 Modbus extensions === 
 +xS/xG series extensions can be upgraded similarly. Instead of **fwspi** utility, just use the alternative named **fwserial** which is also included in the //​unipi-firmware-tools//​ package (installed automatically with //​unipi-firmware//​). The command-line arguments are very similar as for the fwspi, except serial port specification.  
 + 
 +<WRAP center round alert 80%> 
 +Make sure that there is no other application using/​communicating on the used port and do not disconnect power to the Controller or Extension. Any of this will lead to bricking the extension. 
 +</​WRAP>​ 
 + 
 + 
 +<WRAP center round info 80%> 
 +The -p (path) parameter must be set according to the used serial for the extension - see the [[en:​hw:​007-patron:​portmap|]],​ [[en:​hw:​02-neuron:​portmap|]] or [[en:​hw:​01-axon:​portmap|]] to find proper serial port within your unit. For example, if extension is connected to //​RS485-1/​RS485-1.1//:​ <​code>/​opt/​unipi/​tools/​fwserial -p /dev/ttyNS0 -P </​code>​. 
 +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**. 
 </​WRAP>​ </​WRAP>​