I used to access the gpio values as described in the wiki TRB141 Input/Output - Teltonika Networks Wiki, but now with the firmware update 00.07.04.3 it seems that the gpio numbers have changed? Also the ADC value has a different directory too?
Is there a wiki update somewhere or do I need to roll back to the previous firmware?
Cheers
Jules
Hello,
GPIO numbers can be found by running the command ls /sys/class/gpio/
. However, we generally recommend using ubus
to read the status of the I/O pins. This will increase compatibility between different Teltonika devices, as well as prevent such issues after the firmware updates.
To list all of the ubus
actions, run this command - ubus -v list ioman.gpio.xxxx
, where xxxx represents the pin name from the list, that can be found here: TRB141 Input/Output - Teltonika Networks Wiki
For example, to set the status of the digital input on the RUTX11, the command will look like so:
root@RUTX11:~# ubus call ioman.gpio.din1 status
{
"value": "0",
"direction": "in",
"hr_state": "Low level",
"bi_dir": false,
"invert_input": false
}
-S argument can be used to return the answer inline. Value can then be parsed by cutting all of the characters except the returned value.
Hope this helps!
Best regards,
Hi,
I also need the upto date mapping of /sys/class/gpio, particularly isolated input iio, as it was mapped to gpio1021, but this doesn’t exist. Would be great if ubus call method had the interrrupt counter.
Cheers, Dennis
This topic was automatically closed after 15 days. New replies are no longer allowed.