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
408 views 0 comments
by anonymous

Hi

Thanks for this awesome device, I love it!

I'm trying to get SIM data usage using command line (and later with JSON api etc.) from the device. Googling doesn't help as the system has changed. The following link explains to use ubus (https://community.teltonika-networks.com/43132/mdcollectdctl)

ubus call mdcollect get '{"iface_name":"wwan0","conn_period":"month","sim":1}'

But when I try to get todays data usage, it returns the same data

ubus call mdcollect get '{"iface_name":"wwan0","conn_period":"day","sim":1}'

The console output is

root@Teltonika-RUT240:~# ubus call mdcollect get '{"iface_name":"wwan0","conn_period":"month","sim":1}'
{
        "tx": 54426430,
        "rx": 424320849
}
root@Teltonika-RUT240:~# ubus call mdcollect get '{"iface_name":"wwan0","conn_period":"day","sim":1}'
{
        "tx": 54426430,
        "rx": 424320849
}

How can I get the traffic with different days? Could you please update the wiki, it would be super helpful!

And also one question related to MQTT. If I wanted to share for example this mobile data usage to an existing MQTT broker I have, is it possible with your system out-of-the-box? I installed MQTT package but still having problems to understand if this is possible.

Thanks!

Edit: My firmware is RUT2_R_00.07.02.1

1 Answer

0 votes
by anonymous

Hi,

Related to ubus command, I have tested it and found that the conn_period attribute doesn't parse its values at all. Even if you enter any random text as a value for conn_period, it will return the output for total data usage. This issue will be passed to the RnD team and you might see this fix in the next firmware version of RUTOS. 

Related to MQTT, you can share data usage to an external MQTT broker using Data to Server feature of our devices. If the device does not have the Data to server installed already, you can download and install it from the Package manager (Services->Package Manager) and you can select protocol as MQTT in Data to server instance configuration.
https://wiki.teltonika-networks.com/view/RUT955_Data_to_Server
For this, you need to configure RUT955 as Modbus slave and master. In Modbus master configuration, you need to create a request with SIM data usage register number, which can be found in the below link of the Modbus table:
https://wiki.teltonika-networks.com/view/RUT955_Monitoring_via_Modbus

Apart from that, you can configure our router as an MQTT broker bridge as well. This will allow you to send data to another remote MQTT broker.
https://wiki.teltonika-networks.com/view/RUT955_MQTT#Bridge

Regards,
Ramandeep