We are trying to HTTP Post a daily LTE usage of the modem RUT240 and RUT241. We have been looking in the Event Juggler option, which looks pretty good, but we can’t get the data usage.
As we were looking for solutions, we thought in using a script which uses mdcollectdctl as stated in this documentation and send it to our server via Webhook, but after not getting anything via the Juggler (interval trigger, working with another network state values, but not with this script), we found in the integrated CLI that the stated package not exists.
Is any further install needed or it is deprecated?
You can call API on the device by using /sbin/api application or from a remote/local server by following the tutorials in the website I mentioned above.
Hello, as @pwsh suggested, I would also recommend looking into our API documentation & utilizing it to read the data. Let us know if this solution works for you.
Thanks @pwsh and @MatasR!, I was trying the API when I published the post, I see that we can use the /sbin/api to avoid generating the token and so on. That’s really great.
But I get two unexpected errors:
1 - Every call i get this Permission denied almost twice until I get the response from the API
2 - I can’t get a proper response from the data_usage API, while in the dasboard I can see how the usage was registered. Maybe the call is wrong with the timestamp, but I get an empty object.
admin@RUT200:~$ /sbin/api GET /data_usage/day/status
touch: /var/run/board_modem.lock: Permission denied
Can't open /var/run/board_modem.lock
touch: /var/run/board_modem.lock: Permission denied
Can't open /var/run/board_modem.lock
touch: /var/run/board_modem.lock: Permission denied
Can't open /var/run/board_modem.lock
{"http_body":{"success":true,"data":[]},"http_code":200}
admin@RUT200:~$ /sbin/api GET /data_usage/custom/status?from=1749915195&to=1752507195
admin@RUT200:~$ touch: /var/run/board_modem.lock: Permission denied
Can't open /var/run/board_modem.lock
touch: /var/run/board_modem.lock: Permission denied
Can't open /var/run/board_modem.lock
touch: /var/run/board_modem.lock: Permission denied
Can't open /var/run/board_modem.lock
{"http_body":{"success":true,"data":[]},"http_code":200}