Table of Contents

unipiid

This interface can be used to identify the device. The identification information given by the API is read directly from HW. To read any information it is necessary to have root privileges.

(!)

Note:
If a user without root privileges needs access to information from this API, then the information is accessible for that user only using /run/unipi-plc/unipi-id path. See Create or refresh files in /run/unipi-plc/unipi-id path.

Help for this API can be shown by this command:

unipiid

Help example:

Usage:
    unipiid -d     - create and populate directory /run/unipi-plc/unipi-id
    unipiid NAME   - show value of parameter name
    unipiid mainboard_description attr [opt] - show list/value of optional parameters

Where NAME can be:
    product_description   product_model   product_model_full
    product_version       product_serial  product_code
    product_family        product_options
    platform_family       platform_id
    mainboard_description mainboard_id
    uboard_id
    api_version

(!)

Note:
This interface can be used only in systems running Debian 13 and newer.

API version

Like most of the other APIs, unipiid can also be subject to change in the future. Therefore, comparing the API version before any usage by a user application is strictly recommended.

unipiid api_version

Content example:

2

Product description

Overall summary of the product (Unipi PLC) in human-readable format.

unipiid product_description

Content example:

Product model:   E413
Product version: 1.0
Product serial:  1260244349
SKU:             2025058
Options:         0x02

Platform family: Edge (6)
Platform series: 0x06
RAW platform ID: 0x0606

To get and use just a single value from this list, you do not have to parse the whole complex file - use single-value files as a shorthand:

unipiid product_model
unipiid product_serial
unipiid platform_family
unipiid platform_id

Full product model

Product model with more detailed information about HW configuration. Description of the contents is in the main page for each product. Example for Unipi Edge. This can sometimes be the same as product_model.

unipiid product_model_full

Content example:

E4130SW43200-M1

Product code

Uniquely identifies the device. It consists of #SKU;Product model full_Product version;Product serial#. The same string is contained in the 2D code (data matrix) on the manufacturing label on the device.

unipiid product_code

Content example:

#2025058;E4130SW43200-M1_1.0;1260244349#

Mainboard description

The mainboard is a key part of every Unipi PLC. The mainboard contains its own EEPROM memory storing all information about itself and the whole unit.

unipiid mainboard_description

Content example:

Model:   Mainboard
Version: 4C
Serial:  00000548
ID:      0x00CC
Nvmem:   /sys/bus/i2c/devices/1-0057/eeprom

To get mainboard type only, parsing of this file is not necessary - simply use this shorthand:

unipiid mainboard_id

Upper board

Upper board identification. It returns an identification number only if an upper board is contained in the device.

unipiid uboard_id

Content example:

00e0

Fingerprint

To reliably detect if the hardware configuration of the Unipi PLC has been changed, the fingerprint value can be used. The fingerprint value is a unique hash and is computed during every boot.

unipiid fingerprint

Content example:

fcc85af4c8573f82cdd9a30bb27b4536dd68c8d6

Create or refresh files in /run/unipi-plc/unipi-id path

Calling this will create or refresh data inside files in /run/unipi-plc/unipi-id. Text files with the information itself will be created in that directory. The identification information in these files is accessible even without root privileges.

unipiid -d

Files in /run/unipi-plc/unipi-id:

$ ls -l /run/unipi-plc/unipi-id/
total 60
-rw-r--r-- 1 root root   1 Jul 16 09:19 api_version
-rw-r--r-- 1 root root  40 Jul 16 09:19 fingerprint
-rw-r--r-- 1 root root 109 Jul 16 09:19 mainboard_description
-rw-r--r-- 1 root root   4 Jul 16 09:19 mainboard_id
-rw-r--r-- 1 root root   1 Jul 16 09:19 platform_family
-rw-r--r-- 1 root root   4 Jul 16 09:19 platform_id
-rw-r--r-- 1 root root  37 Jul 16 09:19 product_code
-rw-r--r-- 1 root root 191 Jul 16 09:19 product_description
-rw-r--r-- 1 root root   4 Jul 16 09:19 product_family
-rw-r--r-- 1 root root   5 Jul 16 09:19 product_model
-rw-r--r-- 1 root root  13 Jul 16 09:19 product_model_full
-rw-r--r-- 1 root root   2 Jul 16 09:19 product_options
-rw-r--r-- 1 root root  10 Jul 16 09:19 product_serial
-rw-r--r-- 1 root root   3 Jul 16 09:19 product_version
-rw-r--r-- 1 root root   4 Jul 16 09:19 uboard_id