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
264 views 5 comments
by anonymous
Good day,

I have installed python3-light on my TRB245. Using pyserial and other gsmctl and gpsctl commands I have configured certain parameters on the device successfully. I would however like to access/control the configurable digital input/output pins through python as well. What commands or packages can be used to achieve this?

Many thanks,
Francois
by anonymous

Looking for the top digital marketing experts companies in the world? With so many options available, it can be challenging to choose the right agency that meets your needs. Look for an agency that has a proven track record of delivering results and has a team of experienced professionals.Top digital marketing experts companies in the world should be able to provide a range of services, including SEO, PPC, social media marketing, and content marketing. So, take your time to do your research and compare agencies to find the best top digital marketing experts companies in the world that can help you achieve your business goals.

https://chromeis.com/services/digital-marketing/

1 Answer

0 votes
by anonymous

Hello,

  

Thank you for reaching out!

What is the reason not to use services like gsmctl and gpsctl?

The best way to control the I/O pins would be to use ubus calls. To find the calls for the I/O, run this command:

ubus -v list | grep ioman

To actually change the status of let's say digital output, a command like this could be used:

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

And to read the status of the output, this command can be used:

ubus call ioman.gpio.dout1 status

Ubus outputs everything in JSON format, so it will be easier to interpret in Python. To find all possible options for any input, this command can be used:

ubus -v list ioman.gpio.<I/O_name>

Ubus will be as close as it gets if latency is the topmost priority. It can also be used to interact with almost any service/function of the router.

Let me know if any more information is needed!

  

Best regards,
DaumantasG

by anonymous

Hi DaumantasG,

Thank you for the feedback. Is there a way for me to set the voltage value of the output pin? I have tried the above suggestions, but it does not seem to do much with regards to outputting a voltage value? When I measure the the voltage it stays at 0V.

Many thanks,
Francois

by anonymous

Hello,

  

Which pin are you trying to change the voltage on?

TRB245 only contains digital outputs, which can only be on or off. It does have an analog input, but not an output.

So when the digital output is enabled, it will simply pass the voltage from the power socket. Also, please keep in mind the current limitations (max 30V, 300mA).

  

Best regards,
DaumantasG

by anonymous

I understand, thank you DaumantasG.

I have tried switching on all 3 of the Digital output pins using the webUI and and the ubus commands. The device is currently powered by 9V using the 2-point plug adapter, but currently non of the output pins are showing a voltage reading on the multimeter. Regardless of the ON or OFF state all pins just keeps on staying at 0V.

by anonymous

Hello,

  

Sorry, I mislead you about the output pin behavior. It does not pass the voltage from the power socket, and what you're most likely looking for, is to use it with a relay.

More forum threads about this topic can be found here and here. A relay wiring diagram can be found here.

So the way you should be testing is by measuring the resistance between D1/D2/D3 and the ground.

  

Best regards,
DaumantasG