FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
225 views 1 comments
by anonymous

Hi, I have a RUTX09 and am developing an application - the SDK is great btw. My challenge is to drive the digital output on pin 4 of the power connector. I can see there is a documented http interface, but as the app is running locally then directly accessing the output via libgpiod is preferable. I can't however find any documentation on where the output is located. I've tried scanning the gpiochip0 and 1 under /dev to no avail. Many thanks in advance.

1 Answer

0 votes
by anonymous

Hello,

Thank you for reaching out!

I believe the solution you're trying to achieve could be done using the ubus commands. For RUTX09, possible values for dout1 (digital output) can be found by running a command:

ubus -v list ioman.gpio.dout1

To change the status of digital output, a command like this should be used:

ubus call ioman.gpio.dout1 update '{"value":"1"}' (to enable the output)

or

ubus call ioman.gpio.dout1 update '{"value":"0"}' (to disable the output)

Status can be read using this command:

ubus call ioman.gpio.dout1 status

These are basically the same commands as the HTTP method passes to the ubus. The same commands can be used for input configuration.
If you're looking for something different, let me know and I'll investigate further.

Best regards,
DaumantasG

by anonymous
Hi,

Thank you for the quick reply, appreciated.

My application is C++, so yes I can use system(...) to execute the command lines you suggest - I did see this in the documentation.

I was hoping to use the C libgpiod libraries to drive the output line directly, as this is lighter than a call to system(..). libgpiod being available via your SDK. The gpiod API to do this requires knowledge of the chip and line that the output resides on. Looking at /dev/ there are two name general purpose io chips 'gpiochip0' and 'gpiochip1'. I ran some test code over these hoping the numerous output lines would be labelled, but they are all "unnamed".

Thank you again.

Best regards