GPIO pin number handling
Taken from the email conversation from our college Jiri Cech.
It seems that the variable used for storing GPIO pin number overflows.
Conditions:
- i.MX 8M Mini SBC running Debian Buster (kernel 5.4.70)
- I2C expander mapped to position 504 (currently using pin numbers 509,510,511)
The daemon does not interact with the GPIO pins at all. After checking the logs, it seems that the value 509 overflow to -2 (see /sys/class/gpio/gpio-2/direction below).
Also attaching IQRF webapp configuration and list of mapped gpios as screenshots below.
● iqrf-gateway-daemon.service - IQRF Gateway Daemon
Loaded: loaded (/lib/systemd/system/iqrf-gateway-daemon.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2021-05-20 07:08:11 UTC; 18min ago
Docs: man:iqrfgd2(1)
https://docs.iqrf.org/iqrf-gateway/
Main PID: 582 (iqrfgd2)
Tasks: 18 (limit: 414)
Memory: 20.2M
CGroup: /system.slice/iqrf-gateway-daemon.service
└─582 /usr/bin/iqrfgd2 /etc/iqrf-gateway-daemon/config.json
May 20 07:08:20 unipi iqrfgd2[582]: clibuart_gpio_setup() setDir failed wait for 100 ms to next try: 9
May 20 07:08:20 unipi iqrfgd2[582]: Error during opening file (set direction): /sys/class/gpio/gpio-2/direction No such file or directory
May 20 07:08:20 unipi iqrfgd2[582]: clibuart_gpio_setup() setDir failed wait for 100 ms to next try: 10
May 20 07:08:20 unipi iqrfgd2[582]: Error during opening file: No such file or directory
May 20 07:08:20 unipi iqrfgd2[582]: Error: Cannot get TR reset msg => interface to DPA coordinator is not working - verify (CDC or SPI or UART) configuration
May 20 07:08:23 unipi iqrfgd2[582]: Error: Cannot get TR parameters msg => interface to DPA coordinator is not working - verify (CDC or SPI or UART) configuration
May 20 07:08:23 unipi iqrfgd2[582]: Loading IqrfRepo cache ...
May 20 07:08:23 unipi iqrfgd2[582]: Loading IqrfRepo cache success
May 20 07:08:23 unipi iqrfgd2[582]: Cannot load required package for: os="0000" dpa="0000"
May 20 07:08:23 unipi iqrfgd2[582]: Loaded package for: os="08B1" dpa="0300"