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
355 views 2 comments
by
Hello,

How do i import de digital IO from the power connector for the TRB142 and TRB145 to Python.

I Know how to read them from the console with :

 ubus call ioman.gpio.dio0 status

 ubus call ioman.gpio.dio1 status

But i want to import them in python so i can use them in a program.

Kind regards,

1 Answer

0 votes
by anonymous
Hi,

Could you please explain to me how are you going to use them?

EB.
by
Hello EB,

I would like to use de I/O as inputs so i can send a message to our cloud.

I use a post command with an API i have written in Python.

I already use an post command for the incomming data trough RS232 and RS485.

Kind Regards,
by anonymous

One way to do that would be a script where you read and set the values and then your python code which does something on conditions met. So you just need to use these commands with ubus separately.

ubus call ioman.gpio.dio0 update '{"value": "1"}'

ubus call ioman.gpio.dio0 status