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
1,692 views 3 comments
by
It is not clear what the best approach is to obtain gps data and UTC time.

I have two devices connected, wireless, to the RUT955: a windows PC and an embedded system (Linux OS).

The idea is to use python to obtain UTC and GPS data (Latitude, Longitude) from the RUT955 using for example requests (https://requests.readthedocs.io/en/master/).

What is the best approach.

1 Answer

0 votes
by anonymous
Hi,

You can simply get data from router via SSH, command: gpsctl.

Also using JSON: https://wiki.teltonika-networks.com/view/Monitoring_via_JSON-RPC

Or using Modbus: https://wiki.teltonika-networks.com/view/RUT955_Modbus or SNMP: https://wiki.teltonika-networks.com/view/RUT955_SNMP

More details about GPS you can find here: https://wiki.teltonika-networks.com/view/RUT955_GPS
by
Yes this works fine but in case of JSON, you must send your router credentials in order to get your session ID.

I have no experience using SNMP. Any examples, in Python, are welcome.

Why is it not possible to perform this with MQTT.
by anonymous
Hi,

Via MQTT these parameters are not included, support only these parameters: https://wiki.teltonika-networks.com/view/Monitoring_via_MQTT#How_MQTT_works

Unfortunately we do not have example how to use SNMP via Python, but details about SNMP you can find here: https://wiki.teltonika-networks.com/view/RUT955_SNMP
by
# A solution for modbus TCP use pymodbus
from pymodbus.client.sync import ModbusTcpClient

host = 'your_host'
port = your_port

client = ModbusTcpClient(host, port)
client.connect()

response = client.read_holding_registers(reg_address, nmb_registers, unit=device_id)
print(response.registers)