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,467 views 3 comments
by

Hi,

I was wondering if anyone could tell me how to access the router model using JSON-RPC. Specifically I am looking for the text "Teltonika RUT240 LTE" as you would see if you went to the "Status" -> "System" page on the WebUI.

The text doesn't seem to be in any of the UCI settings.

Any help would be appreciated.

1 Answer

0 votes
by anonymous

Hi,

Just check on Linux PC and with this command I got system information from /etc/config/system file :

curl -d "{\"jsonrpc\":\"2.0\", \"id\":1, \"method\":\"call\", \"params\":[\"ccde05577d5a51aeb98ce926c1f6c418\", \"uci\", \"get\", {\"config\":\"system\", \"type\":\"system\"}] }" http://192.168.1.1/ubus

Best answer
by

I can't seem to get the exact router model from that command. I have included the output that I get below.

I am specifically looking for the text "Teltonika RUT240 LTE" exactly as you would see it on the "Status" -> "System" page on the WebUI.

{"jsonrpc":"2.0","id":1,"result":[0,{"values":{"system":{".anonymous":false,".type":"system",".name":"system",".index":0,"timezone":"UTC","conloglevel":"8","log_type":"circular","log_buffer_size":"128","enable_pppd_debug":"0","enable_chat_log":"1","enable_gsmd_log":"1","enable_hotplug_log":"1","enable_luci_reload_log":"0","enable_sim_switch_log":"0","device_code":"RUT24004XXXX","device_fw_version":"RUT2XX_R_00.01.02.3","routername":"RUT240","hostname":"Teltonika-RUT240.com"}}}]}

by anonymous

Yeah, the Router model "Teltonika RUT240 LTE" cannot be collected from system file, since this is static information and it's generated in router source code.

However, you can collect router model "RUT240" from system config file with JSON RPC command:

curl -d "{\"jsonrpc\":\"2.0\", \"id\":1, \"method\":\"call\", \"params\":[\"1673ac9c39a97680495a4c57d719f616\", \"uci\", \"get\", {\"config\":\"system\", \"section\":\"system\", \"option\":\"routername\"}] }" http://192.168.1.1/ubus

by
Ok. Thanks for the assistance.