IOT-DIN-IMX8PLUS: Debian Linux: How-To Guide

From Compulab Mediawiki
Jump to: navigation, search

Overview

The default run-time Linux filesystem image for the CompuLab IOT-DIN-IMX8PLUS Internet of Things Gateway is based on Debian GNU/Linux BookWorm. The default Debian Linux image includes more than 650 software packages. Among them:

  • Core system
  • Debian package management system
  • SSH server and client
  • PulseAudio configuration and usage utilities
  • NetworkManager
  • ModemManager
  • Bluez5 Bluetooth tools and daemons
  • Docker

Serial Console

IOT-DIN-IMX8PLUS provides a serial console on the front panel micro-USB DBG connector.

Connecting to a host PC

  1. Use a micro-USB cable to connect the Console connector to a USB port on your host PC.
  2. Make sure the CP2104 driver is available with your operating system, otherwise install CP2104 driver onto the host PC from https://www.silabs.com/documents/public/software/CP210x_Windows_Drivers_with_Serial_Enumeration.zip
  3. Identify the host PC interface and port number that will be used for communication with the device:
    • In most Linux PCs, the serial port will be denoted as one of the following (where n is a positive integer): /dev/ttyUSB0, /dev/ttyUSB1 ... /dev/ttyUSBn
    • In Windows PCs, the serial port usually will be denoted as one of the following (where n is a positive integer): COM1, COM2 ... COMn
  4. Start a terminal emulation program (such as PuTTY on Windows or minicom on Linux).
  5. In the port configuration section of the terminal emulation program select the port identified in previous step and set the following serial port parameters:
Baud Rate Data Bits Stop Bits Parity Flow Control
115200 8 1 none none

Connection and Login

This Debian rootfs comes with a default sudo user compulab. User password has to be set at the very first login.

Compulab Release compulab-imx8mp 3.1 24.02 based on
Debian GNU/Linux 12 compulab-imx8mp ttymxc1

compulab-imx8mp login: compulab
You are required to change your password immediately (administrator enforced).
New password: 
Retype new password: 

To login into the Linux system, use a terminal emulator as described here, or connect through the network (ssh).

Package Management

The IOT-DIN-IMX8PLUS Debian Linux image includes everything required to use the Debian package management utilities.
Use apt and dpkg for managing software packages.

Device Serial Number and Configuration

Product information is stored in on-board EEPROM.

  • To read the product serial number, issue the folowing command:
compulab@compulab-imx8mp:/$ cat /proc/device-tree/baseboard-sn
1240509004602

Note "-" sign which appears on the label is intentionally replaced by "0"

  • To read the product configuration part number, issue the following command:
compulab@compulab-imx8mp:/$ cat /proc/device-tree/baseboard-options
C1800QM-D4-N32-JEG25G-XL

Device Tree

Available Device Tree Files

IOT-DIN-iMX8PLUS Debian package includes the following dtb files:

<fdt_file_name> Description Remarks
iotdin-imx8p.dtb default hardware configuration

Set a device tree

IOT-DIN-iMX8PLUS Debian provides two methods to switch between dtb files:

  • U-Boot environment

The U-boot fdtfile variable contains the device tree name that will be loaded into the RAM. This variable can be changed by:

Environment Command
U-Boot setenv fdtfile <fdt_file_name>; saveenv;
Linux fw_setenv fdtfile <fdt_file_name>

Docker

The Docker Engine is preinstalled.

  • The following command downloads a test image and runs it in a container. The container sample prints a message and exits.
compulab@compulab-imx8mp:~$ sudo docker run -it ubuntu
latest: Pulling from library/ubuntu
aa21f24e1940: Pull complete
...
Digest: sha256:e3f92abc0967a6c19d0dfa2d55838833e947b9d74edbcb0113e48535ad4be12a
Status: Downloaded newer image for ubuntu:latest
root@0d6b133a7a93:/# cat /etc/issue
Ubuntu 24.04 LTS \n \l

Cellular Modem

IOT-DIN-IMX8PLUS cellular interface is implemented with a mini-PCIe cellular modem module and a nano-SIM socket.
Cellular module is an optional module and should be pre-installed into the gateway. Verify your gateway configuration for modem functionality.

To set up IOT-DIN-IMX8PLUS for cellular functionality, insert a tray with active SIM card into designated socket. Please refer to IOT-DIN-IMX8PLUS user's manual for details.
Cellular antenna should be connected to SMA connector B on the front panel.

Cellular Connection

The ModemManager can be used to log into almost any Internet Service Provider with simple configuration setup.

In the following example:

  • Replace ISP-APN with the APN name of the cellular provider.
compulab@compulab-imx8mp:~$ sudo nmcli connection add type gsm ifname '*' con-name CellularCon apn <ISP-APN>
  • Connect cellular network
compulab@compulab-imx8mp:~$ sudo nmcli connection up CellularCon
  • Disconnect cellular network
compulab@compulab-imx8mp:~$ sudo nmcli connection down CellularCon

GPS

IOT-DIN-IMX8PLUS features an optional GPS interface implemented with the cellular modem module.
Cellular module is an optional module and should be pre-installed into the gateway. Verify your gateway configuration for modem functionality.

GPS antenna

A GPS antenna is required for GPS operation. GPS antenna is not included with IOT-DIN-IMX8PLUS. Any active GPS antenna with a male SMA connector can be used with IOT-DIN-IMX8PLUS.
GPS antenna should be attached to SMA connector A on the gateway.

Admolition note.png GPS antenna should be positioned at least 1m away from the gateway

Using GPS

The cgps client can be used to display the GPS information.
The ModemManager can be used to check the modem status. For example, the following command shows the presence of the modem and the id of its interfaces.

root@compulab-imx8mp:~# mmcli -m 0

The cgps client utility depends on the gpsd daemon (starts automatically after the initialization command is performed).

  • Initialization of the GPS interface:
root@compulab-imx8mp:~# sed -i "/^DEVICES=.*/c\DEVICES=\"/dev/ttyUSB1\"" /etc/default/gpsd
  • Enable the GPS with the following AT commands:
root@compulab-imx8mp:~# echo AT+QGPS= 1 | socat - /dev/ttyUSB2,crnl
  • Full power cycle is required before using GPS. Shut down the gateway, remove main DC power for at least 20 sec and restart.
  • Start the cgps client to display GPS information.

The synchronization process might take a few minutes.

root@compulab-imx8mp:~# cgps
┌───────────────────────────────────────────┐┌─────────────────────────────────┐
│    Time:       2024-05-04T14:13:30.000Z   ││PRN:   Elev:  Azim:  SNR:  Used: │
│    Latitude:    32.65985123 N             ││  71    29    123    22      Y   │
│    Longitude:   35.10027205 E             ││  85    27    047    22      Y   │
│    Altitude:   102.700 m                  ││                                 │
│    Speed:      0.00 kph                   ││                                 │
│    Heading:    128.7 deg (true)           ││                                 │
│    Climb:      6.00 m/min                 ││                                 │
│    Status:     3D FIX (53 secs)           ││                                 │
│    Longitude Err:   n/a                   ││                                 │
│    Latitude Err:    n/a                   ││                                 │
│    Altitude Err:    +/- 18 m              ││                                 │
│    Course Err:      n/a                   ││                                 │
│    Speed Err:       n/a                   ││                                 │
│    Time offset:     -3.682                ││                                 │
│    Grid Square:     KM72np                ││                                 │
└───────────────────────────────────────────┘└─────────────────────────────────┘
  • Disable the GPS with the following AT commands:
root@compulab-imx8mp:~# echo AT+QGPSEND | socat - /dev/ttyUSB2,crnl

Industrial Interfaces

IOT-DIN-IMX8PLUS implements following industrial interfaces on the 16-pin industrial terminal block:

  • 1x RS232 (2-wire)
  • 1x RS485 (half-duplex)
  • 1x CAN 2.0B
  • 2x digital inputs + 2x digital outputs.

Please refer to Industrial I/O Connector pin-out for more details.

Industrial I/O modules do not require any special configuration.

CAN bus

IOT-DIN-IMX8PLUS CAN 2.0B port is implemented with i.MX8M Plus CAN controller.
CAN signals are routed to industrial I/O connector
Please refer to IOT-DIN-IMX8PLUS user's manual for Industrial I/O Connector pin-out.

  • can0: always enabled and accessible

The following example demonstrates how to configure and use the permanent CAN interface can0.

CAN interface configuration

  • Configure the CAN interface bit-rate to 1 Mbits/sec:
compulab@@compulab-imx8mp:~$ sudo ip link set can0 type can bitrate 1000000
  • Enable the CAN interface:
compulab@@compulab-imx8mp:~$ sudo ip link set can0 up
  • Expected result:
[...] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready

Send/Receive packets

Use cansend and candump utilities to send and receive packets via CAN interface.

  • Send standard CAN frame (on the first device):
compulab@@compulab-imx8mp:~$ sudo cansend can0 111#1122334455667788
  • Send extended CAN frame (on the first device):
compulab@@compulab-imx8mp:~$ sudo cansend can0 11111111#1122334455667788
  • CAN frames (extended mode) generator, random payload, interval between two successive frames 50 msec:
compulab@@compulab-imx8mp:~$ sudo cangen -g 50 -e -D r -v can0
...
  can0  1E5137F4#0F.4D.8B.7A.25.4D.DB.21
  can0  1B6C965C#8C.DE.96.58.69.5F.D5.26
  can0  1BD23086#8D.DB.C4.3E.81.57.BA.34
  can0  127B2322#F4.16.31.2E.34.04.62
  can0  1A6366DB#A8.73.C0.37.D8
  can0  03620EE4#
  can0  023AC34D#C6.08.BD.2A.04.B3.BF.43
  can0  1C19AD2E#09.C1.B3.26.23.E5.6A.5A
  can0  02BCA994#48.32.46.7C.F0.3F.29.1E
  can0  08104C67#59.9F.FE.44
  can0  1C280582#6F.D4.9C.38.A5.28.A3
  can0  0BC219EE#D9.2C.05
  can0  04AA80B8#A1.93
  can0  1A3E2392#AD.98
  can0  0025950E#E3.99.38
...
  • Dump all received data frames as well as error frames:
compulab@iot-gate-imx8plus:~$ sudo candump any,0:0,#FFFFFFFF
...
  can0  0CC89C1A   [1]  51
  can0  0A097EFB   [0] 
  can0  02B59BD5   [5]  68 6F 47 64 D9
  can0  03743A1E   [7]  FA BF E4 38 3E BF C8
  can0  13C9B644   [8]  30 FB 60 6F E1 FC 55 65
  can0  018A8975   [0] 
  can0  0C9C8179   [0] 
  can0  011F5D90   [6]  65 DB DD 5A AA F9
  can0  07B7FD18   [6]  CC 96 26 1D 13 7C
  can0  1FBD7177   [8]  69 BF 8D 1E 4C 0D 73 02
  can0  107A7E2D   [2]  25 D3
  can0  12B9E279   [8]  89 77 B7 54 BD 98 83 06
  can0  112A44EA   [8]  9E 95 D9 6B 60 CE B4 52
  can0  0ADF9869   [3]  C8 A0 27
  can0  1580C274   [5]  B2 7A F7 43 04
  can0  06DDDBCC   [7]  AF 19 88 04 E4 D8 95
  can0  127FA5CE   [8]  F7 54 57 20 45 17 3D 12
  can0  09A37893   [0] 
  can0  01BA4332   [6]  0B AF 0C 2E AB 25
  can0  180A8AD5   [5]  68 BE F7 5A C0
  can0  06DC994E   [7]  20 9E E9 7B B8 31 BC
...

RS232

RS232 function is implemented with MAX3221 (or compatible) transceiver interfaced with i.MX8M Plus UART port.

Configuration and Access

RS232 interface can be accessed in Linux via ttyRS232 tty device.

RS485

RS485 function is implemented with MAX13488 (or compatible) transceiver interfaced with i.MX8M Plus UART port.

Configuration and Access

RS485 interface can be accessed in Linux via ttyRS485 tty device.

RS485 has an optional hardware-enabled termination. Please consult with the reference guide for enabling instructions.

Modbus RS485

The following example demonstrates how to use RS485 in a Modbus RS485 Network. IOT-DIN-IMX8PLUS performs as a Master device and queries XY-MD02 temperature and humidity sensor.

Software installation

Download and install modpoll - a command line based Modbus master simulator and test utility.

compulab@compulab-imx8mp:~$ wget https://www.modbusdriver.com/downloads/modpoll.tgz -P /tmp/
...
compulab@compulab-imx8mp:~$ sudo tar -xvf /tmp/modpoll.tgz -C /opt/
...

Device connection

  • Connect XY-MD02 sensor to appropriate Industrial I/O connector pins as below:
  • A+: XY-MD02 A+ to IOT-DIN-iMX8PLUS I/O PIN 8
  • B-: XY-MD02 B- to IOT-DIN-iMX8PLUS I/O PIN 7
-------------------                            --------------------
|                 |                            |   IOTDIN-IMX8P   |
|                 *--(+)---< <------- 5V-30V   |                  |
|                 |                            |                  |
|                 *--(-)---< <-------- GND     |                  |
| XY-MD02 (RS485) |                            |------            |
|                 *--(A+)--< <--...--> >-(8)-*-|     | Industrial |
|                 |                            | J4  | I/O        |
|                 *--(B-)--< <--...--> >-(7)-*-|     | Connector  |
|                 |                            |------            |
-------------------                            -------------------- 

Read data

  • Read temperature once:
compulab@compulab-imx8mp:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 2 -1 /dev/ttyRS485
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2021 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: Modbus RTU, FC4
Slave configuration...: address = 1, start reference = 2, count = 1
Communication.........: /dev/ttyRS485, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, input register table

-- Polling slave...
[2]: 250
  • Poll temperature:
compulab@compulab-imx8mp:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 2 /dev/ttyRS485
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2021 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: Modbus RTU, FC4
Slave configuration...: address = 1, start reference = 2, count = 1
Communication.........: /dev/ttyRS485, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, input register table

-- Polling slave... (Ctrl-C to stop)
[2]: 254
-- Polling slave... (Ctrl-C to stop)
[2]: 254
-- Polling slave... (Ctrl-C to stop)
[2]: 254
...
  • Read humidity once:
compulab@compulab-imx8mp:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 3 -1 /dev/ttyRS485
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2021 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: Modbus RTU, FC4
Slave configuration...: address = 1, start reference = 3, count = 1
Communication.........: /dev/ttyRS485, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, input register table

-- Polling slave...
[3]: 515
  • Poll humidity:
compulab@compulab-imx8mp:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 3 /dev/ttyRS485
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2021 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: Modbus RTU, FC4
Slave configuration...: address = 1, start reference = 3, count = 1
Communication.........: /dev/ttyRS485_A, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, input register table

-- Polling slave... (Ctrl-C to stop)
[3]: 894
-- Polling slave... (Ctrl-C to stop)
[3]: 895
-- Polling slave... (Ctrl-C to stop)
[3]: 896
...
  • Read temperature & humidity once:
compulab@compulab-imx8mp:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 2 -r 2 -1 /dev/ttyRS485
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2021 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: Modbus RTU, FC4
Slave configuration...: address = 1, start reference = 2, count = 2
Communication.........: /dev/ttyRS485, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, input register table

-- Polling slave...
[2]: 263
[3]: 606
  • Poll temperature & humidity:
compulab@compulab-imx8mp:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 2 -r 2 /dev/ttyRS485
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2021 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: Modbus RTU, FC4
Slave configuration...: address = 1, start reference = 2, count = 2
Communication.........: /dev/ttyRS485_A, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, input register table

-- Polling slave... (Ctrl-C to stop)
[2]: 263
[3]: 545
-- Polling slave... (Ctrl-C to stop)
[2]: 263
[3]: 543
-- Polling slave... (Ctrl-C to stop)
[2]: 263
[3]: 542
...
  • Read slave address, baudrate, temperature & humidity corrections:
compulab@compulab-imx8mp:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 4 -c 4 -r 258 -1 /dev/ttyRS485
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2021 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: Modbus RTU, FC3
Slave configuration...: address = 1, start reference = 258, count = 4
Communication.........: /dev/ttyRS485, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table

-- Polling slave...
[258]: 1
[259]: 9600
[260]: 0
[261]: 0

Digital I/O

IOT-DIN-IMX8PLUS features 2 digital inputs and 2 digital outputs.
2 digital inputs are implemented with the CLT03-2Q3 digital termination following EN 61131-2. 2 digital outputs are implemented with the TPS272C solid-state relay following EN 61131-2.
Please refer to IOT-DIN-IMX8PLUS user's manual for Industrial I/O Connector pin-out.

----------------
|  IOTD-IMX8P   |
|         ______|     
|        | VIN 1|  +24VDC               
|        | DI0 2|  <<------|
|        | DO0 3|  >>------|
|   T.B. | DI1 4|  <<------|
|        | DO1 5|  >>------|
|        | COM 6|  0V
|        |      |
----------------   


Admolition note.png External voltage supply in the range 6-24VDC must be supplied via DIO_VIN pin for correct operation of digital outputs. Please refer to Industrial I/O Connector pin-out for more details.

Configuration and Access

The example below shows how to access Digital inputs and outputs.

Digital Outputs

  • Drive OUT0 pin HI:
compulab@compulab-imx8mp:~$ sudo gpioset 3 30=1
  • Drive OUT1 pin HI:
compulab@compulab-imx8mp:~$ sudo gpioset 4 4=1


Admolition note.png gpioget function doesn't allow to verify the pin state. gpioget function will always return 0 on the OUT1 and OUT2 pin

Another way to set the pin state is the usage of dioset bash script located at /opt/iotdin-imx8p/shell

  • Setup alias for more convenient work:
compulab@compulab-imx8mp:~$ dioset=/opt/iotdin-imx8p/shell/dioset
  • Drive OUT0 pin HI:
compulab@compulab-imx8mp~$ sudo ${dioset} -m M 0 1
  • Drive OUT0 pin LOW:
compulab@compulab-imx8mp~$ sudo ${dioset} -m M 0 0
  • Drive OUT1 pin HI:
compulab@compulab-imx8mp~$ sudo ${dioset} -m M 1 1
  • Drive OUT1 pin LOW:
compulab@compulab-imx8mp~$ sudo ${dioset} -m M 1 0

Digital Inputs

  • Read IN0 pin state:
compulab@compulab-imx8mp:~$ sudo gpioget 4 3
  • Read IN1 pin state:
compulab@compulab-imx8mp:~$ sudo gpioget 4 0

Another way to set the pin state is the usage of dioget bash script located at /opt/iotdin-imx8p/shell

  • Setup alias for more convenient work:
compulab@compulab-imx8mp:~$ dioget=/opt/iotdin-imx8p/shell/dioget
  • Read IN0 pin state:
compulab@compulab-imx8mp~$ sudo ${dioget} -m M 0
  • Read IN1 pin state:
compulab@compulab-imx8mp~$ sudo ${dioget} -m M 1

TPM

IOT-DIN-IMX8PLUS assembled with a TPM 2.0 add-on board implemented with Infineon SLB9673.

Verification that the TPM device was created:


  • Install the tpm2-tools package:
compulab@compulab-imx8mp:~$ sudo apt-get update && sudo apt-get install tpm2-tools
  • Validate basic functionality
compulab@compulab-imx8mp:~$ sudo tpm2_getrandom 32

The correct result will be returned generated 32-symbol key.

RTC

IOT-DIN-IMX8PLUS RTC is implemented with the AM1805 real-time clock (RTC) chip.
Back-up battery keeps the RTC running to maintain clock and time information whenever the main power supply is not present.

Accessing and setting the RTC

  • To access the RTC time and date run:
compulab@compulab-imx8mp:~$ sudo hwclock
2024-08-04 12:38:10.577874+00:00
  • To set the date and write it into the RTC do the following:
compulab@compulab-imx8mp:~$ sudo date -s "31 Dec 2023 10:00:00"
Fri Dec 31 10:00:00 IST 2021
compulab@compulab-imx8mp:~$ sudo hwclock -w
compulab@compulab-imx8mp:~$ sudo hwclock 
2023-12-31 10:00:08.317403+02:00

Watchdog

IOT-DIN-IMX8PLUS watchdog function is implemented with the i.MX8M Plus watchdog.
By default watchdog is not configured.

compulab@compulab-imx8mp:~$ systemctl show | grep RuntimeWatchdog
RuntimeWatchdogUSec=0

The value RuntimeWatchdogUSec=0 means watchdog logic is disabled: no watchdog device is opened, configured, or pinged

Watchdog configuration

  • Edit /etc/systemd/system.conf file to configure watchdog related parameters, in particular RuntimeWatchdogSec and ShutdownWatchdogSec.

# comment-out sign should be removed from the relevant line in the file.

RuntimeWatchdogSec - specifies the watchdog timeout for runtime services, meaning services that are actively running during normal system operation. The value is in seconds and should be set to a positive integer.
ShutdownWatchdogSec - specifies the watchdog timeout for the shutdown process, insuring the system doesn't hang indefinitely during the shutdown. The value is in seconds and should be set to a positive integer.
  • Reboot the device
  • Verify watchdog configuration
compulab@compulab-imx8mp:~$ systemctl show | grep RuntimeWatchdog
RuntimeWatchdogUSec=10s

Watchdog testing

  • Run the following command to simulate kernel panic:
compulab@compulab-imx8mp:~$ echo "c" | sudo tee -a /proc/sysrq-trigger
  • As a result, the watchdog is not fed and the system reboots after 10 sec.

Low Power Modes

IOT-DIN-IMX8PLUS supports the following low-power modes:

  • Sleep mode - RAM content is preserved, and the system can quickly wake up into the operating system. Power consumption in sleep mode is ~0.25W.
  • Power-off mode - RAM content is not preserved, and the system will restart into a clean boot. Power consumption in power-off mode is ~0.02W.

IOT-DIN-IMX8PLUS supports two wake-up sources:

  • Short press on the power button
  • Timer alarm set in internal RTC (rtc1)
Admolition important.png Only the internal RTC (rtc1) can be used for the wake-up alarm. Main DC power must be present to preserve alarm settings.

Low power mode examples

Admolition note.png Make sure that remote power button event is ignored and does not cause machine power-off: uncomment and set HandlePowerKey field to ignore value in the /etc/systemd/logind.conf
  • Sleep mode with exit by remote power button event:
compulab@compulab-imx8mp:~$ echo mem | sudo tee -a /sys/power/state
  • Sleep mode with exit by RTC wake-up call or remote power button event:
compulab@compulab-imx8mp:~$ sudo rtcwake --device /dev/rtc1 -s 60 -m mem
  • Power-off mode with boot on RTC wake-up call:
compulab@compulab-imx8mp:~$ sudo rtcwake --device /dev/rtc1 -s 60 -m off
In this example system reboots after 60 seconds.


Admolition note.png Low power sleep modes activation can sometimes cause incorrect behavior in cellular modem due to race conditions among their multiple USB devices during wake-up.

LEDs

IOT-DIN-IMX8PLUS features two user Bi-Color (Red + Green) LEDs named A and B LEDs are controlled via GPIO pins and can be accessed via sysfs interface.

  • LEDs are referred to as Green_A, Red_A, Green_B and Red_B
  • Choose a LED (LED B Red in this example):
compulab@compulab-imx8mp:~$ LED=Red_B
  • Turn the LED ON
compulab@compulab-imx8mp:~$ echo "1" | sudo tee -a /sys/class/leds/${LED}/brightness
  • Turn the LED OFF
compulab@compulab-imx8mp:~$ echo "0" | sudo tee -a /sys/class/leds/${LED}/brightness
  • Set LED's trigger
compulab@compulab-imx8mp:~$ echo "heartbeat" | sudo tee -a /sys/class/leds/${LED}/trigger