IOT-GATE-IMX8PLUS and SBC-IOT-IMX8PLUS: Debian Linux: How-To Guide
Contents
- 1 Overview
- 2 Serial Console
- 3 Connection and Login
- 4 Package Management
- 5 Device Serial Number and Configuration
- 6 Kernel
- 7 Device Tree
- 8 Docker
- 9 Gateway Configurator
- 10 Cellular Modem
- 11 GPS
- 12 WiFi
- 13 CAN bus
- 14 Industrial Interfaces and Add-on Boards
- 15 Industrial I/O Interfaces
- 16 Add-on boards
- 17 RTC
- 18 Watchdog
- 19 Low Power Modes
- 20 LEDs
Overview
The example run-time Linux filesystem image for the CompuLab IOT-GATE-IMX8PLUS Internet of Things Gateway and SBC-IOT-IMX8PLUS Internet of Things Single Board Computer is based on Debian GNU/Linux Bullseye. The default Debian buster 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-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS provides a serial console on the front panel micro-USB Console connector.
Connecting to a host PC
- Use a micro-USB cable to connect the Console connector to a USB port on your host PC.
- 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
- 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
- Start a terminal emulation program (such as PuTTY on Windows or minicom on Linux).
- 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:
Debian GNU/Linux 11 iot-gate-imx8plus ttymxc1 iot-gate-imx8plus 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-GATE-IMX8PLUS / SBC-IOT-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@iot-gate-imx8plus:~$ cat /proc/device-tree/baseboard-sn
- To read the product configuration part number, issue the following command:
compulab@iot-gate-imx8plus:~$ cat /proc/device-tree/baseboard-options
Kernel
Available Linux Kernel images
IOT-GATE-iMX8PLUS Debian package includes the following kernel images:
| Kernel Image | Description |
| Image-6.6.52-4.0 | default kernel based on NXP lf-6.6.y |
| Image | symbolic link points to the Image-6.6.52-4.0 |
| Image-6.6.52-rt43-4.0 | kernel based on NXP lf-6.6.y with PREEMPT_RT patches applied and CONFIG_PREEMPT_RT enabled |
| Image-rt | symbolic link points to the Image-6.6.52-rt43-4.0 |
Switching Kernel Image
The U-boot image variable contains the Linux kernel image name that will be loaded into the RAM. This variable can be changed by:
| Environment | Command |
| U-Boot | setenv image <kernel_image_name>; saveenv;
|
| Linux | fw_setenv image <kernel_image_name>
|
Device Tree
Available Device Tree Files
IOT-GATE-iMX8PLUS Debian package includes the following dtb files:
| <fdt_file_name> | Description | Remarks |
| iot-gate-imx8plus.dtb | default hardware configuration | |
| iot-gate-imx8plus-m2tpm.dtb | default hardware configuration + TPM add-on board | TPM add-on uses the M.2 expansion socket (P19). Cannot be combined with any other add-on board |
| iot-gate-imx8plus-brkout_pwm_gpio.dtb | default hardware configuration + break-out add-on board (2x PWMs, 4x GPIOs) | Break-out add-on uses the M.2 expansion socket (P19). Cannot be combined with any other add-on board |
| iot-gate-imx8plus-m2emmc.dtb | default hardware configuration + eMMC/TPM add-on board | eMMC/TPM add-on uses the M.2 expansion socket (P19). Cannot be combined with any other add-on board |
| iot-gate-imx8plus-m2adc.dtb | default hardware configuration + ADC/TPM add-on board | ADC/TPM add-on uses the M.2 expansion socket (P19). Cannot be combined with any other add-on board |
| iot-gate-imx8plus-m2m2.dtb | default hardware configuration + WMN/IMU/TPM add-on board | WMN/IMU/TPM add-on uses the M.2 expansion socket (P19). Cannot be combined with any other add-on board |
Set a device tree
IOT-GATE-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>
|
- GRUB environment
| Environment | Command/Procedure |
| GRUB Boot Menu | Goto "Advanced Boot Options" and choose a device tree from the provided dtb list. |
| Linux | grub-editenv /boot/EFI/BOOT/grubenv set fdt_file=<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@iot-gate-imx8plus:~$ sudo docker run -it ubuntu ... 0;root@3bd6e27ea2a7: /root@3bd6e27ea2a7:/# cat /etc/issue Ubuntu 22.04.3 LTS \n \l ...
Gateway Configurator
During O/S boot IOT-GATE-IMX8PLUS automatically runs the Gateway configurator script that detects WiFi/Bluetooth modules and Cellular modem, and configures the virtual device files used to address these devices and other ones like user LEDs
The script creates access files for all permanent and detected optional devices and interfaces.
Gateway Interfaces
Gateway interfaces access directory example:
/run/iot-gate-imx8plus/gateway/access
|-- leds
| |-- green_1 -> /sys/class/leds/Green_1
| |-- green_2 -> /sys/class/leds/Green_2
| |-- powerled_red -> /sys/class/leds/PowerLED_Red
| |-- red_1 -> /sys/class/leds/Red_1
| `-- red_2 -> /sys/class/leds/Red_2
`-- network
|-- bluetooth -> /sys/class/bluetooth/hci0
|-- modem
| |-- at1 -> /dev/ttyModemAT1
| |-- at2 -> /dev/ttyModemAT2
| |-- gps -> /dev/ttyModemGPS
| `-- qcdm -> /dev/ttyModemQCDM
`-- wlan -> /sys/class/net/wlan0
Cellular Modem
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS cellular interface is implemented with a mini-PCIe cellular modem module and a
nano-SIM socket. To set up IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS for cellular functionality, install an active SIM card into
the front panel nano-SIM socket (U10).
Cellular module should be installed into mini-PCIe socket P3.
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@iot-gate-imx8plus:~$ sudo nmcli connection add type gsm ifname '*' con-name CellularCon apn <ISP-APN>
- Connect cellular network
compulab@iot-gate-imx8plus:~$ sudo nmcli connection up CellularCon
- Disconnect cellular network
compulab@iot-gate-imx8plus:~$ sudo nmcli connection down CellularCon
Modem Reset
The cellular modem module can be forced into hardware reset by toggling GPIO2_IO20.
Use the following command to reset the modem:
compulab@iot-gate-imx8plus:~$ sudo gpioset 1 20=0 ; sleep 0.3 ; sudo gpioset 1 20=1
GPS
IOT-GATE-IMX8PLUS features an optional GPS interface implemented with the cellular modem module.
GPS antenna
GPS antenna is required for GPS operation. GPS antenna is not included with IOT-GATE-IMX8PLUS. Any active GPS antenna with a male SMA connector can be used with IOT-GATE-IMX8PLUS.
GPS antenna should be attached to the AUX SMA connector on the gateway.
| 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.
mmcli -m 0 mmcli -m 0 --location-enable-gps-raw mmcli -m 0 --location-get
The cgps client utility depends on the gpsd daemon (starts automatically after the initialization command is performed).
- Initialization of the GPS interface:
sed -i "/^DEVICES=.*/c\DEVICES=\"/dev/ttyUSB1\"" /etc/default/gpsd systemctl restart gpsd
- Enable the GPS for the current boot session with the following AT command:
echo AT+QGPS= 1 | socat - /dev/ttyUSB2,crnl
- Enable the GPS to start permanently on boot using the following AT command:
echo 'AT+QGPSCFG="autogps", 1' | socat - /dev/ttyUSB2,crnl
- To disable the GPS start on boot issue the following AT command:
echo 'AT+QGPSCFG="autogps", 0' | socat - /dev/ttyUSB2,crnl
- Start the cgps client to display GPS information.
The synchronization process might take a few minutes.
root@iot-gate-imx8plus:~# cgps lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqklqqqqqqqqqqqqqqqqqqSeen 12/Used 6k x Time: 2024-09-17T11:05:07.000Z (0) xxGNSS PRN Elev Azim SNR Usex x Latitude: 32.65947347 N xxGP 3 3 55.0 115.0 35.0 Y x x Longitude: 35.09990893 E xxGP 4 4 56.0 21.0 41.0 Y x x Alt (HAE, MSL): 163.800, 143.800 m xxGP 6 6 34.0 292.0 32.0 Y x x Speed: 0.00 km/h xxGP 9 9 52.0 313.0 33.0 Y x x Track (true, var): 0.0, 3.1 deg xxGP 16 16 23.0 84.0 41.0 Y x x Climb: 0.00 m/min xxGP 26 26 12.0 50.0 34.0 Y x x Status: 3D FIX (1 secs) xxGP 1 1 0.0 0.0 35.0 N x x Long Err (XDOP, EPX): 0.81, +/- 12.1 m xxGP 2 2 5.0 175.0 0.0 N x x Lat Err (YDOP, EPY): 1.63, +/- 24.4 m xxGP 7 7 45.0 216.0 0.0 N x x Alt Err (VDOP, EPV): 0.80, +/- 18.4 m xxGP 11 11 3.0 323.0 0.0 N x x 2D Err (HDOP, CEP): 0.80, +/- 19.0 m xxGP 30 30 11.0 219.0 0.0 N x x 3D Err (PDOP, SEP): 1.10, +/- 20.9 m xxSB128 41 0.0 0.0 40.0 N x x Time Err (TDOP): 1.72 xx x x Geo Err (GDOP): 3.31 xx x x ECEF X, VX: n/a n/a xx x x ECEF Y, VY: n/a n/a xx x x ECEF Z, VZ: n/a n/a xx x x Speed Err (EPS): +/- 175 km/h xx x x Track Err (EPD): n/a xx x x Time offset: 0.028433633 s xx x x Grid Square: KM72np18 xx x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
- Disable the GPS with the following AT commands:
root@iot-gate-imx8plus:~# echo AT+QGPSEND | socat - /dev/ttyUSB2,crnl
WiFi
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features an optional 802.11ax WiFi interface, implemented with the Intel WiFi 6 AX210 module.
The NetworkManager can be used to manage WiFi interface.
WiFi Interface
- For the IOT-GATE-IMX8PLUS with WiFi option (WB) the configurator script will create the following access files:
/run/iot-gate-imx8plus/gateway/access/network |-- ... `-- wlan -> /sys/class/net/wlan0
- Display WiFi network interface info
compulab@compulab-imx8mp:~$ wlan=$(basename $(readlink -f /run/iot-gate-imx8plus/gateway/access/network/wlan))
compulab@compulab-imx8mp:~$ sudo ifconfig ${wlan}
compulab@compulab-imx8mp:~$ sudo iwconfig ${wlan}
Enable/Disable WiFi Interface
- To enable WiFi interface:
compulab@iot-gate-imx8plus:~$ sudo nmcli radio wifi on
- To disable WiFi interface:
compulab@iot-gate-imx8plus:~$ sudo nmcli radio wifi off
Network Scanning
- Sample WiFi scanning:
compulab@iot-gate-imx8plus:~$ nmcli dev wifi list
- The output will show the list of Access Points and Ad-Hoc cells in range.
Connecting to Access Point
In the following example:
- Replace <SSID> and <PASSWORD> with the actual access point parameters:
compulab@iot-gate-imx8plus:~$ sudo nmcli device wifi connect <SSID> password <PASSWORD> name WifiCon
- Disconnect wireless network:
compulab@iot-gate-imx8plus:~$ sudo nmcli connection down WifiCon
- Connect wireless network again:
compulab@iot-gate-imx8plus:~$ sudo nmcli connection up WifiCon
Creating Access Point
| Debian 12 ipv4 forwarding must be turned on manually |
- Enable port forwarding:
compulab@iot-gate-imx8plus:~$ sudo sed -i 's/^#\(net.ipv[4,6].*forward\)/\1/' /etc/sysctl.conf
- Enable wireless AP (replace <SSID> and <PASSWORD> with desired access point parameters):
sudo nmcli device wifi hotspot ssid <SSID> password <PASSWORD> con-name HotspotCon
- Disable wireless AP:
compulab@iot-gate-imx8plus:~$ sudo nmcli connection down HotspotCon
- Enable wireless AP again:
compulab@iot-gate-imx8plus:~$ sudo nmcli connection up HotspotCon
CAN bus
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features up to two CAN 2.0B ports implemented with i.MX8M Plus CAN controllers.
- canE: permanent: always enabled and accessible
- canC: optional: always enabled, but can be accessed only when CAN I/O module is installed
| IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS CAN signals are routed to industrial I/O connector (P8) |
The following example demonstrates how to configure and use the permanent CAN interface canE.
CAN interface configuration
- Configure the CAN interface bit-rate to 1 Mbits/sec:
compulab@iot-gate-imx8plus:~$ sudo ip link set canE type can bitrate 1000000
- Enable the CAN interface:
compulab@iot-gate-imx8plus:~$ sudo ip link set canE up
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@iot-gate-imx8plus:~$ sudo cansend canE 111#1122334455667788
- Send extended CAN frame (on the first device):
compulab@iot-gate-imx8plus:~$ sudo cansend canE 11111111#1122334455667788
- CAN frames (extended mode) generator, random payload, interval between two successive flames 50 msec:
compulab@iot-gate-imx8plus:~$ sudo cangen -g 50 -e -D r -v canE ... canE 1E5137F4#0F.4D.8B.7A.25.4D.DB.21 canE 1B6C965C#8C.DE.96.58.69.5F.D5.26 canE 1BD23086#8D.DB.C4.3E.81.57.BA.34 canE 127B2322#F4.16.31.2E.34.04.62 canE 1A6366DB#A8.73.C0.37.D8 canE 03620EE4# canE 023AC34D#C6.08.BD.2A.04.B3.BF.43 canE 1C19AD2E#09.C1.B3.26.23.E5.6A.5A canE 02BCA994#48.32.46.7C.F0.3F.29.1E canE 08104C67#59.9F.FE.44 canE 1C280582#6F.D4.9C.38.A5.28.A3 canE 0BC219EE#D9.2C.05 canE 04AA80B8#A1.93 canE 1A3E2392#AD.98 canE 0025950E#E3.99.38 ...
- Dump all received data frames as well as error frames:
compulab@iot-gate-imx8plus:~$ sudo candump any,0:0,#FFFFFFFF ... canE 0CC89C1A [1] 51 canE 0A097EFB [0] canE 02B59BD5 [5] 68 6F 47 64 D9 canE 03743A1E [7] FA BF E4 38 3E BF C8 canE 13C9B644 [8] 30 FB 60 6F E1 FC 55 65 canE 018A8975 [0] canE 0C9C8179 [0] canE 011F5D90 [6] 65 DB DD 5A AA F9 canE 07B7FD18 [6] CC 96 26 1D 13 7C canE 1FBD7177 [8] 69 BF 8D 1E 4C 0D 73 02 canE 107A7E2D [2] 25 D3 canE 12B9E279 [8] 89 77 B7 54 BD 98 83 06 canE 112A44EA [8] 9E 95 D9 6B 60 CE B4 52 canE 0ADF9869 [3] C8 A0 27 canE 1580C274 [5] B2 7A F7 43 04 canE 06DDDBCC [7] AF 19 88 04 E4 D8 95 canE 127FA5CE [8] F7 54 57 20 45 17 3D 12 canE 09A37893 [0] canE 01BA4332 [6] 0B AF 0C 2E AB 25 canE 180A8AD5 [5] 68 BE F7 5A C0 canE 06DC994E [7] 20 9E E9 7B B8 31 BC ...
Industrial Interfaces and Add-on Boards
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS implements industrial interfaces with four I/O slots (IE) that can be fitted with up-to four different I/O modules. Slots are referred to as A, B, C and D.
Available I/O modules types:
- RS232 (2-wire)
- RS485 (half duplex)
- Digital I/O (4x DI + 4x DO)
- CAN 2.0B
In addition to the four I/O slots, the platform includes a permanent CAN 2.0B interface. This interface is treated as an additional I/O slot, referred to as Slot E, and is always populated with a CAN I/O module.
| IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS industrial I/O signals are routed to Industrial I/O Connector (P8) |
Please refer to Industrial I/O Connector pin-out for more details.
| So far industrial I/O modules do not require any special configuration. |
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features expansion interface via M.2 Key-E socket P19. The expansion connector allows integration of custom add-on boards into IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS. The expansion connector features embedded interfaces such as I2C, SPI, PWM, GPIO, etc.
| Please refer to Expansion Connector pin-out for more details. |
Available add-on boards:
- TPM 2.0: implemented with Infineon SLB9670
- Break-out: exposes expansion connector signals on 100-mil headers
- eMMC/TPM: provides additional storage volume as well as TPM 2.0
- ADC/TPM: provides four single-ended analog input channels (0-3) as well as TPM 2.0
- IMU/TPM: provides 6-axis Motion Tracking device (3-axis gyroscope + 3-axis accelerometer) as well as TPM 2.0
- WMN/IMU/TPM: provides Nordic NRF52840 mesh communication card, 6-axis Motion Tracking device and well as TPM 2.0
The expansion connector is treated as an additional I/O slot, referred to as Slot X.
I/O Modules Configuration
I/O expansion modules and add-on boards are managed as a front-plane of virtual slots that map device access files to physical I/O modules per their positions in the stack.
During O/S boot IOT-GATE-IMX8PLUS automatically runs the configurator script that detects installed modules and add-on boards and configures the virtual device files used to address the hardware.
| Add-on boards require proper device tree configuration for correct operation |
The script creates the front-plane file directory that includes type and access files for all populated slots.
I/O Stack Front-Plane
During O/S boot the configurator script creates the I/O Stack front-plane file directory that includes type and access files for all populated populated I/O slots from A to E as well expansion slot X.
/run/iot-gate-imx8plus/io_stack/frontplane
Front-plane directory structure
Example I/O stack:
+-------+-------+-------+-------+-------+-------+-------+ | Slot | A | B | C | D | E | X | +-------+-------+-------+-------+-------+-------+-------+ | IE | RS485 | RS232 | CAN | DI4O4 | CAN | eMMC | +-------+-------+-------+-------+-------+-------+-------+
Front-plane file directory:
/run/iot-gate-imx8plus/io_stack/frontplane
|-- A
| |-- access
| | `-- tty -> /dev/ttymxc0
| `-- type.RS485
|-- B
| |-- access
| | `-- tty -> /dev/ttymxc2
| `-- type.RS232
|-- C
| |-- access
| | `-- can -> /sys/class/net/canC
| `-- type.CAN
|-- D
| |-- access
| | |-- di.map
| | `-- do.map
| `-- type.DI4O4
|-- E
| |-- access
| | `-- can -> /sys/class/net/canE
| `-- type.CAN
`-- X
|-- access
| |-- blkdev -> /dev/mmcblk1
| |-- tpm -> /sys/class/tpm/tpm0
| `-- tpmrm -> /sys/class/tpmrm/tpmrm0
`-- type.eMMC
Industrial I/O Interfaces
RS232
RS232 function is implemented with MAX3221 (or compatible) transceiver interfaced with i.MX8M Plus UART ports.
RS232 modules can be installed into I/O slots A, B and C (configuration options FARS2, FBRS2, FCRS2). Up to three RS232 modules can be installed simultaneously.
Configuration and Access
Once properly installed in a specific I/O slot, the RS232 interface can be accessed seamlessly in Linux.
During O/S boot IOT-GATE-IMX8PLUS will automatically detect an installed RS232 I/O module and create necessary access files in the /dev directory as well as in the front-plane directory. For additional details please refer to the Configuration chapter.
Example
For an RS232 module installed in slot B the configurator script will create the following access files:
- /dev directory:
... /dev/ttyIEB -> ttymxc2 ... /dev/ttyRS232_B -> ttyIEB ...
- I/O Stack frontplane directory:
/run/iot-gate-imx8plus/io_stack/frontplane |-- B | |-- access | | `-- tty -> /dev/ttymxc2 | `-- type.RS232
Use either /dev/ttyRS232_B or /run/iot-gate-imx8plus/io_stack/frontplane/B/access/tty symbolic link to access port
compulab@compulab-imx8mp:~$ tty=$(readlink -e /run/iot-gate-imx8plus/io_stack/frontplane/B/access/tty)
compulab@compulab-imx8mp:~$ stty -F ${tty}
speed 9600 baud; line = 0;
-brkint -imaxbel
RS485
RS485 function is implemented with MAX13488 (or compatible) transceiver interfaced with i.MX8M Plus UART ports.
RS485 modules can be installed in I/O slots A, B and C (configuration options FARS4, FBRS4, FCRS4). Up to three RS485 modules can be installed simultaneously.
Configuration and Access
Once properly installed in a specific I/O slot, the RS485 interface can be accessed seamlessly in Linux.
During O/S boot IOT-GATE-IMX8PLUS will automatically detect an installed RS485 I/O module and create necessary access files in the /dev directory as well as in the front-plane directory. For additional details please refer to the Configuration chapter.
Example
For an RS485 module installed in slot A the configurator script will create the following access files:
- /dev directory:
... /dev/ttyIEA -> ttymxc0 ... /dev/ttyRS485_A -> ttyIEA ...
- I/O Stack frontplane directory:
/run/iot-gate-imx8plus/io_stack/frontplane |-- A | |-- access | | `-- tty -> /dev/ttymxc0 | `-- type.RS485
Use either /dev/ttyRS485_A or /run/iot-gate-imx8plus/io_stack/frontplane/A/access/tty symbolic link to access port
compulab@compulab-imx8mp:~$ tty=$(readlink -e /run/iot-gate-imx8plus/io_stack/frontplane/A/access/tty)
compulab@compulab-imx8mp:~$ stty -F ${tty}
speed 9600 baud; line = 0;
-brkint -imaxbel
Termination Resistor
The RS485 I/O module has an optional software-enabled termination. Please note that the termination is disabled each time the device goes through power-cycle.
Linux commands to switch termination state:
| I/O Slot | Enable termination | Disable termination |
|---|---|---|
| A | gpioset 5 12=0 | gpioset 5 12=1 |
| B | gpioset 5 13=0 | gpioset 5 13=1 |
| C | gpioset 5 14=0 | gpioset 5 14=1 |
Modbus RS485
The following example demonstrates how to use RS485 module installed into industrial I/O slot A in a Modbus RS485 Network. IOTG-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@iot-gate-imx8plus:~$ wget https://www.modbusdriver.com/downloads/modpoll.tgz -P /tmp/ ... compulab@iot-gate-imx8plus:~$ 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-GATE-iMX8PLUS / SBC-IOT-IMX8PLUS P8-01
- B-: XY-MD02 B- to IOT-GATE-iMX8PLUS / SBC-IOT-IMX8PLUS P8-03
-------------------- ------------------------- | | | | | *--(+)---< <------------- 5V-30V | IOTG-IMX8PLUS | | | | (SBC-IOT-IMX8PLUS) | | *--(-)---< <-------------- GND |------ ------------ | | XY-MD02 (RS485) | | |==| IE-RS485 | | | *--(A+)--< <---...---> >---(1)---*-| | ------------ | | | | P8 | Slot A | | *--(B-)--< <---...---> >---(3)---*-| | | | | |------ | -------------------- -------------------------
Read data
- Read temperature once:
compulab@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 2 -1 /dev/ttyRS485_A 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_A, 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@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 2 /dev/ttyRS485_A 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_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]: 254 -- Polling slave... (Ctrl-C to stop) [2]: 254 -- Polling slave... (Ctrl-C to stop) [2]: 254 ...
- Read humidity once:
compulab@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 3 -1 /dev/ttyRS485_A 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... [3]: 515
- Poll humidity:
compulab@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 1 -r 3 /dev/ttyRS485_A 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@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 2 -r 2 -1 /dev/ttyRS485_A 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... [2]: 263 [3]: 606
- Poll temperature & humidity:
compulab@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 3 -c 2 -r 2 /dev/ttyRS485_A 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@iot-gate-imx8plus:~$ /opt/modpoll/arm-linux-gnueabihf/modpoll -b 9600 -p none -t 4 -c 4 -r 258 -1 /dev/ttyRS485_A 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_A, 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
Digital I/O module features 4 digital inputs and 4 digital outputs and can be installed into slot D (configuration option FDIO).
Four digital inputs are implemented with the CLT3-4B digital termination following EN 61131-2.
Four digital outputs are implemented with the VNI4140K solid-state relay following EN 61131-2.
| Digital I/O module requires an external voltage supply up to 24V to be properly connected. Please refer to Industrial I/O Connector pin-out for more details. |
Configuration and Access
Show DIO to GPIO chip/line mapping
DIO modules can be accessed using either the DIO utilities developed by Compulab and included in the Debian Linux image, or the GPIO utilities provided by the gpiod package.
Use dioinfo to show Digital Input and Output GPIO chip/line mapping.
compulab@compulab-imx8mp:~$ dioinfo=/opt/iot-gate-imx8plus/shell/dioinfo
compulab@compulab-imx8mp:~$ sudo ${dioinfo}
Stack Slot D: DI4O4 (4x DI; 4x DO)
~~~~~~~~~~~~~~~~~
Digital GPIO GPIO
Signal Chip Line
~~~~~~~~~~~~~~~~~
DI 0: 4 3
DI 1: 4 0
DI 2: 3 31
DI 3: 3 29
~~~~~~~~~~~~~~~~~
DO 0: 3 30
DO 1: 4 4
DO 2: 0 1
DO 3: 3 12
~~~~~~~~~~~~~~~~~
Reading Digital Inputs
Example: Read IN3 pin state (LO):
- iotg-imx8plus-dio:
compulab@iot-gate-imx8plus:~$ sudo iotg-imx8plus-dio -i 3
- dioget:
compulab@iot-gate-imx8plus:~$ sudo /opt/iot-gate-imx8plus/shell/dioget 3
- gpioget:
compulab@iot-gate-imx8plus:~$ sudo gpioget 3 29
Setting Digital Outputs
Example: Drive OUT2 pin HI:
- iotg-imx8plus-dio:
compulab@iot-gate-imx8plus:~$ sudo iotg-imx8plus-dio -o 2 1
- dioset:
compulab@iot-gate-imx8plus:~$ sudo /opt/iot-gate-imx8plus/shell/dioset 2 1
- gpioset:
compulab@iot-gate-imx8plus:~$ sudo gpioset 0 1=1
CAN
CAN function is implemented with i.MX8M Plus Flexible Controller Area Network (FlexCAN) communication controller.
CAN module can be installed into I/O slot C (configuration option FCCAN).
In addition, the system includes a permanent CAN interface, which can be treated as I/O slot E. Users may assume that slot E is always populated with a CAN module.
Configuration and Access
Once properly installed, CAN I/O module can be accessed seamlessly in Linux.
During O/S boot IOT-GATE-IMX8PLUS will automatically detect an installed CAN I/O modules and create necessary access files in the front-plane directory. For additional details please refer to the Configuration chapter.
Refer to the CAN bus section for configuration and usage example.
Example
For the CAN module installed in slot C and for the permanent CAN interface in slot E the configurator script will create the following access files:
/run/iot-gate-imx8plus/io_stack/frontplane ... |-- C | |-- access | | `-- can -> /sys/class/net/canC | `-- type.CAN ... |-- E | |-- access | | `-- can -> /sys/class/net/canE | `-- type.CAN
Add-on boards
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features expansion interface via M.2 Key-E socket P19. The expansion connector allows integration of custom add-on boards into IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS. The expansion connector features embedded interfaces such as I2C, SPI, PWM, GPIO, etc.
| Please refer to Expansion Connector pin-out for more details. |
Available add-on boards:
- TPM 2.0: implemented with Infineon SLB9670
- Break-out: exposes expansion connector signals on 100-mil headers
- eMMC/TPM: provides additional storage volume as well as TPM 2.0
- ADC/TPM: provides four single-ended analog input channels (0-3) as well as TPM 2.0
- IMU/TPM: provides 6-axis Motion Tracking device (3-axis gyroscope + 3-axis accelerometer) as well as TPM 2.0
- WMN/IMU/TPM: provides Nordic NRF52840 mesh communication card, 6-axis Motion Tracking device and well as TPM 2.0
TPM
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS can be optionally (configuration option FXTPM) assembled with a TPM 2.0 add-on board implemented with Infineon SLB9670.
| Some other add-on boards - namely ADC, eMMC, IMU, and NWM - also feature a TPM 2.0 device |
Configuration and Access
- Install TPM add-on board into M.2 Socket (P19) if required
- Boot Linux kernel with iot-gate-imx8plus-m2tpm.dtb device tree
For the TPM add-on board properly installed and booted with the appropriate device tree the configurator script will create the following access files:
/run/iot-gate-imx8plus/io_stack/frontplane
`-- X
|-- access
| |-- tpm -> /sys/class/tpm/tpm0
| `-- tpmrm -> /sys/class/tpmrm/tpmrm0
`-- type.TPM
- Verify that the TPM device was created:
compulab@iot-gate-imx8plus:~$ ls -lh /dev/tpm*
- Otherwise load TPM kernel object:
compulab@iot-gate-imx8plus:~$ sudo modprobe tpm_tis_spi
- Install the tpm2-tools package:
compulab@iot-gate-imx8plus:~$ sudo apt-get update && sudo apt-get install tpm2-tools
- Validate basic functionality
compulab@iot-gate-imx8plus:~$ sudo tpm2_getrandom 16
eMMC
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS can be optionally (configuration option FXNxx) assembled with eMMC/TPM add-on board implemented with:
- 32/64/128GB eMMC flash secondary storage device
- Infineon SLB9670 TPM 2.0
- 32/64/128GB eMMC flash secondary storage device
Configuration and Access
- Install eMMC add-on board into M.2 Socket (P19) if required
- Boot Linux kernel with iot-gate-imx8plus-m2emmc.dtb device tree
For the eMMC add-on board properly installed and booted with the appropriate device tree the configurator script will create the following access files:
/run/iot-gate-imx8plus/io_stack/frontplane
`-- X
|-- access
| |-- blkdev -> /dev/mmcblk1
| |-- tpm -> /sys/class/tpm/tpm0
| `-- tpmrm -> /sys/class/tpmrm/tpmrm0
`-- type.eMMC
- Verify that the mmcblk1 block device was created
compulab@iot-gate-imx8plus:~$ lsblk /dev/mmcblk1
- Set alias for smooth access:
compulab@compulab-imx8mp:~$ emmc=$(readlink -e /run/iot-gate-imx8plus/io_stack/frontplane/X/access/blkdev)
- List the eMMC partitions:
compulab@compulab-imx8mp:~$ sudo sfdisk -l ${emmc}
ADC
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS can be optionally (ordering option FXADC) assembled with ADC/TPM add-on board implemented with:
- TI ADS1015 analog-to-digital converter (ADC) that provides four single-ended analog input channels (0-3). Inputs operate between 0-10V or 4-20mA ranges for use with industrial sensors. The add-on can be set into current or voltage input mode via wire jumper
- Infineon SLB9670 TPM 2.0
Configuration and Access
- The ADC add-on board should be installed into expansion socket (P19)
- Boot Linux kernel with iot-gate-imx8plus-m2adc.dtb device tree
For the ADC add-on board properly installed and booted with the appropriate device tree the configurator script will create the following access files:
/run/iot-gate-imx8plus/io_stack/frontplane
`-- X
|-- access
| |-- adc -> /sys/bus/iio/devices/iio:device0
| |-- tpm -> /sys/class/tpm/tpm0
| `-- tpmrm -> /sys/class/tpmrm/tpmrm0
`-- type.ADC
Reading Analog Inputs
Example: Read all channels AIN0 - AIN3:
- Set aliases for smooth access:
compulab@compulab-imx8mp:~$ adc_dev=$(readlink -e /run/iot-gate-imx8plus/io_stack/frontplane/X/access/adc)
compulab@compulab-imx8mp:~$ adc=$(cat ${adc_dev}/name)
- Read raw unscaled measurement of channels AIN0 - AIN3:
compulab@iot-gate-imx8plus:~$ for i in {0..3} ; do sudo cat ${adc_dev}/in_voltage${i}_raw ; done
- With ainget:
compulab@iot-gate-imx8plus:~$ sudo /opt/iot-gate-imx8plus/shell/ainget
IMU
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS can be optionally (ordering option FXIMU) assembled with IMU/TPM add-on board implemented with:
- TDK ICM-42605 6-axis MEMS MotionTracking device that combines a 3-axis gyroscope and a 3-axis accelerometer
- Infineon SLB9670 TPM 2.0
- TDK ICM-42605 6-axis MEMS MotionTracking device that combines a 3-axis gyroscope and a 3-axis accelerometer
- The IMU add-on board should be installed into expansion socket (P19)
- Boot Linux kernel with iot-gate-imx8plus-m2m2.dtb device tree
Configuration and Access
For the WMN/IMU add-on board properly installed and booted with the appropriate device tree the configurator script will create the following access files:
/run/iot-gate-imx8plus/io_stack/frontplane
`-- X
|-- access
| |-- imu:accel -> /sys/bus/iio/devices/iio:device1
| |-- imu:gyro -> /sys/bus/iio/devices/iio:device0
| |-- subtype.IMU
| |-- tpm -> /sys/class/tpm/tpm0
| `-- tpmrm -> /sys/class/tpmrm/tpmrm0
`-- type.M2
List IMU devices:
compulab@iot-gate-imx8plus:~$ lsiio
Accessing accelerometer
- Set aliases for smooth access:
compulab@compulab-imx8mp:~$ accel_dev=$(readlink -e /run/iot-gate-imx8plus/io_stack/frontplane/X/access/imu:accel)
compulab@compulab-imx8mp:~$ accel=$(cat ${accel_dev}/name)
- Read raw unscaled acceleration measurement on x axis:
compulab@compulab-imx8mp:~$ cat ${accel_dev}/in_accel_x_raw
- Read the scale value:
compulab@compulab-imx8mp:~$ cat ${accel_dev}/in_accel_scale
- Capture, convert and output data from IIO device buffer (all available channels) with iio_generic_buffer utility:
compulab@compulab-imx8mp:~$ sudo iio_generic_buffer -a -g -c 1 -l 50 -n ${accel}
Accessing gyroscope
- Set aliases for smooth access:
compulab@compulab-imx8mp:~$ gyro_dev=$(readlink -e /run/iot-gate-imx8plus/io_stack/frontplane/X/access/imu:gyro)
compulab@compulab-imx8mp:~$ gyro=$(cat ${gyro_dev}/name)
- Read raw unscaled angular rate z axis:
compulab@compulab-imx8mp:~$ cat ${gyro_dev}/in_anglvel_z_raw
- Read the scale value:
compulab@compulab-imx8mp:~$ cat ${gyro_dev}/in_anglvel_scale
- Capture, convert and output data from IIO device buffer (all available channels) with iio_generic_buffer utility:
compulab@compulab-imx8mp:~$ sudo iio_generic_buffer -a -g -c 1 -l 40 -n ${gyro}
Break-out
Break-out add-on board exposes expansion connector signals on 100-mil headers.
The IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS Debian Linux image contains iot-gate-imx8plus-brkout_pwm_gpio.dtb device tree.
It provides break-out add-on board usage example by configuring:
- 2x PWMs
- 4x GPIOs
- 1x I2C
| Interface/Bus | Name in Linux | Signal Name | Channel/Offset | Header-Offset |
| PWM3 | pwmchip0 | PWM3_OUT | 0 | P5-09 |
| PWM4 | pwmchip1 | PWM4_OUT | 0 | P5-07 |
| GPIO5 | gpiochip4 | GPIO5_IO10 | 10 | P5-13 |
| GPIO5_IO11 | 11 | P5-11 | ||
| GPIO5_IO12 | 12 | P5-14 | ||
| GPIO5_IO13 | 13 | P5-15 | ||
| I2C5 | i2c-4 | I2C5_SDA | P5-08 | |
| I2C5_SCL | P5-10 |
PWM
The following example demonstrates how to use pwmchip0 from Linux shell.
- Boot Linux kernel with iot-gate-imx8plus-brkout_pwm_gpio.dtb device tree
- Export PWM channel 0 on pwmchip0:
echo "0" | sudo tee -a /sys/class/pwm/pwmchip0/export
- Setup PWM signal period of 100usec and duty cycle of 30%:
echo 100000 | sudo tee -a /sys/class/pwm/pwmchip0/pwm0/period
echo 30000 | sudo tee -a /sys/class/pwm/pwmchip0/pwm0/duty_cycle
- Enable PWM signal:
echo 1 | sudo tee -a /sys/class/pwm/pwmchip0/pwm0/enable
- Disable PWM signal:
echo 0 | sudo tee -a /sys/class/pwm/pwmchip0/pwm0/enable
- Un-export PWM channel 0 on pwmchip0:
echo "0" | sudo tee -a /sys/class/pwm/pwmchip0/unexport
RTC
IOT-GATE-IMX8PLUS / SBC-IOT-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@iot-gate-imx8plus:~$ sudo hwclock 2022-08-04 12:38:10.577874+00:00
- To set the date and write it into the RTC do the following:
compulab@iot-gate-imx8plus:~$ sudo date -s "31 Dec 2021 10:00:00" Fri Dec 31 10:00:00 IST 2021 compulab@iot-gate-imx8plus:~$ sudo hwclock -w compulab@iot-gate-imx8plus:~$ sudo hwclock 2021-12-31 10:00:08.317403+02:00
Watchdog
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS watchdog function is implemented with the i.MX8M Plus watchdog.
By default watchdog is not configured.
compulab@iot-gate-imx8plus:~$ 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.
- 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@iot-gate-imx8plus:~$ systemctl show | grep RuntimeWatchdog
RuntimeWatchdogUSec=10s
Watchdog testing
- Run the following command to simulate kernel panic:
compulab@iot-gate-imx8plus:~$ sudo su
root@iot-gate-imx8plus:/home/compulab# echo "c" > /proc/sysrq-trigger
- As a result, the watchdog is not fed and the system reboots after 10 sec.
Low Power Modes
IOT-GATE-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-GATE-IMX8PLUS supports two wake-up sources:
- Short press on the power button
- Timer alarm set in internal RTC (rtc1)
| 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
| Make sure that power button press 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 power button press:
compulab@compulab-imx8mp:~$ echo mem | sudo tee -a /sys/power/state
- Sleep mode with exit by RTC wake-up call or power button press:
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.
LEDs
IOT-GATE-IMX8PLUS / SBC-IOT-IMX8PLUS features two user Bi-Color (Red + Green) LEDs found on front panel.
LEDs are controlled via GPIO pins and can be accessed via sysfs interface.
- LEDs are referred to as Green_1, Red_1, Green_2 and Red_2
- Choose a LED (LED2 Red in this example):
compulab@iot-gate-imx8plus:~$ LED=Red_2
- Turn the LED ON
compulab@iot-gate-imx8plus:~$ echo "1" | sudo tee -a /sys/class/leds/${LED}/brightness
- Turn the LED OFF
compulab@iot-gate-imx8plus:~$ echo "0" | sudo tee -a /sys/class/leds/${LED}/brightness
- Set LED's trigger
compulab@iot-gate-imx8plus:~$ echo "heartbeat" | sudo tee -a /sys/class/leds/${LED}/trigger