Changes

no edit summary
Line 1: Line 1:  +
<p style="color:red">The information on this page is updated in accordance with the [https://wiki.teltonika-networks.com/view/FW_%26_SDK_Downloads'''00.07.4'''] firmware version .</p>
 
==Introduction==
 
==Introduction==
<span style="color: red;">The information in this page is updated in accordance with the <span style="color: #0054A6;"><b>RUTXXX_R_00_07_02</b></span> firmware version.</span>
      
'''JSON-RPC''' is a remote procedure call protocol encoded in JSON. It is a very simple protocol (and very similar to XML-RPC), defining only a few data types and commands. JSON-RPC allows for notifications (data sent to the server that does not require a response) and for multiple calls to be sent to the server which may be answered out of order.
 
'''JSON-RPC''' is a remote procedure call protocol encoded in JSON. It is a very simple protocol (and very similar to XML-RPC), defining only a few data types and commands. JSON-RPC allows for notifications (data sent to the server that does not require a response) and for multiple calls to be sent to the server which may be answered out of order.
Line 27: Line 27:  
----
 
----
 
First, you must obtain a '''Session ID'''. In order to do so, you must send a HTTP POST request to the router asking for it.
 
First, you must obtain a '''Session ID'''. In order to do so, you must send a HTTP POST request to the router asking for it.
<ul>
+
 
<li>Enter the router's IP address into the URL field '''http://192.168.1.1/ubus''' (''use LAN IP for local access, WAN IP for remote access'').</li>
+
1. Enter the router's IP address into the URL field '''http://192.168.1.1/ubus''' (''use LAN IP for local access, WAN IP for remote access''),<br>
<li>Change the orange code fields with router's username and password        (''Or change it into the '''Postman User Auth.''' field.'')</li>
+
2. Open the '''Body''' section,<br>
<li>Then paste the following command into the '''Body or Content to send''' field:</li>
+
3. Select '''raw''',<br>
</ul>
+
4. Then paste the following command into the '''Body or Content to send''' field:
    
  {
 
  {
Line 38: Line 38:  
         "00000000000000000000000000000000", "session", "login",
 
         "00000000000000000000000000000000", "session", "login",
 
         {
 
         {
             "username":"<span style="color:orange">'''root'''</span>", "password":"<span style="color:orange">'''admin01'''</span>"
+
             "username":"<span style="color:orange">'''admin'''</span>", "password":"<span style="color:orange">'''admin01'''</span>"
 
         }
 
         }
 
     ]
 
     ]
 
  }
 
  }
   −
''The section highlighted in orange is the router's admin password which by default is admin01. Replace this part with your own router's password.''<br>
+
'''Note''': The section highlighted in orange is the router's admin password which by default is admin01. Replace this part with your own router's password.
<ul>
+
 
<li>Once you have everything in order, click '''Send''':</li>
+
5. Once you have everything in order, click '''Send''',<br>
</ul>
+
6. The output should contain the '''Session ID'''.
[[File:GETTING ID.jpg|border|class=tlt-border]]
+
[[File:Postman login.png|border|center|class=tlt-border|697x621px]]
<br>
+
 
<ul>
+
 
Here's what the response should look like (The Session ID is shown in the sixth red rectangle):
+
Copy the Session ID since you'll be needing it when issuing other commands to the router.
   −
<li>Copy the Session ID since you'll be needing it when issuing other commands to the router.</li>
  −
</ul>
   
'''NOTE:''' if later on your commands stop working and you get a Response like this: <br>
 
'''NOTE:''' if later on your commands stop working and you get a Response like this: <br>
   Line 70: Line 68:  
----
 
----
 
Now that you have obtained a Session ID, you can issue commands to the router. Let's start with commands that return information about the router.
 
Now that you have obtained a Session ID, you can issue commands to the router. Let's start with commands that return information about the router.
====Getting '''[[RSSI]]'''====
+
====Getting signal levels====
 
----
 
----
 
  {
 
  {
Line 86: Line 84:  
  }
 
  }
   −
The test highlighted in red is your Session ID, and highlighted in orange are the command and the parameter. In this example, we're using a '''gsmctl -q''' command that returns the router's RSSI (signal strength) value.
+
The test highlighted in red is your Session ID, and highlighted in orange are the command and the parameter. In this example, we're using a '''gsmctl -q''' command that returns the router's signal levels.
   −
[[File:GETTING RSSI3.jpg|border|class=tlt-border]]
+
[[File:Postman gsmct signal.png|border|center|class=tlt-border|730x662px]]
   −
Look for '''stdout''' in the post response: <span style="color:green">'''"stdout":"-69\n'''</span>". This tells us that the router's current signal strength is <span style="color:green">'''-69 dBm'''</span>.
+
Look for '''stdout''' in the post response: <span style="color:green">'''"stdout": "RSSI: -54\nRSRP: -87\nSINR: 8\nRSRQ: -12\n"'''</span>. This tells us that the router's current signal strength levels.
 
----
 
----
   Line 112: Line 110:  
Again the command and the parameter are highlighted in orange. In this case the '''cat''' command is used to view the contents of the  '''/etc/config/network''' file. The Response is:
 
Again the command and the parameter are highlighted in orange. In this case the '''cat''' command is used to view the contents of the  '''/etc/config/network''' file. The Response is:
   −
[[File:GETTING NETWORK.jpg|border|class=tlt-border]]
+
[[File:Postman network config.png|border|center|class=tlt-border|732x660px]]
    
===Setting router parameters===
 
===Setting router parameters===
 
----
 
----
   −
To set parameters, is necessary to use three commands, they are '''set''', '''commit''' and '''luci-reload'''
+
To set parameters, is necessary to use three commands, they are '''set''', '''commit''' and '''reload_config'''
 
<ul>
 
<ul>
 
<li> The First one is used to set router parameters</li>
 
<li> The First one is used to set router parameters</li>
 
<li> The second one is used to commit the changes from RAM to flash memory </li>
 
<li> The second one is used to commit the changes from RAM to flash memory </li>
 
<li> The third one is used to the changes take effect</li>
 
<li> The third one is used to the changes take effect</li>
</ul><br>
+
</ul>
 
We'll not go into detail on UCI commands in this article, but you can check out our '''[[UCI command usage]]''' guide for detailed examples.  
 
We'll not go into detail on UCI commands in this article, but you can check out our '''[[UCI command usage]]''' guide for detailed examples.  
  −
   
====UCI SET====
 
====UCI SET====
 
----
 
----
The '''uci set''' command is used to set router parameters. <br>
+
The '''uci set''' command is used to set router parameters.
 +
 
 
As an example, let's try to change the router's WiFi SSID. The command to do so looks like this:
 
As an example, let's try to change the router's WiFi SSID. The command to do so looks like this:
   Line 155: Line 152:     
<li>Finally, highlighted in green is the value that will replace the old value.  '''''(In this case, it change the router's SSID to <span style=color:green>9999</span>.)'''''</li>
 
<li>Finally, highlighted in green is the value that will replace the old value.  '''''(In this case, it change the router's SSID to <span style=color:green>9999</span>.)'''''</li>
<li>Note: You should be sure that all the fields are correctly written</li><br>
   
</ul>
 
</ul>
If the issued command was a success, you should see a Response like this:<br>
+
If the issued command was a success, you should see a Response like this:
   −
[[File:CHANGING SSID.jpg|border|class=tlt-border]]
+
[[File:Postman uci set wireless.png|border|center|class=tlt-border|724x689px]]
    
====UCI COMMIT====
 
====UCI COMMIT====
Line 174: Line 170:  
     ]
 
     ]
 
  }
 
  }
<br>
+
 
<li>When committing changes, you will need to specify the name of the file where the changes took place '''''(In this case, <span style=color:orange>wireless</span> config, which is highlighted in orange).</li><br>
+
'''Note''': when committing changes, you will need to specify the name of the file where the changes took place (In this case, <span style=color:orange>wireless</span> config, which is highlighted in orange).
 +
 
 
If the commit was successful, you should see the same message as before:
 
If the commit was successful, you should see the same message as before:
   −
[[File:COMMIT.jpg|border|class=tlt-border]]
+
[[File:Postman uci commit.png|border|center|class=tlt-border|729x532px]]
   −
====LUCI-RELOAD====
+
====RELOAD_CONFIG====
 
----
 
----
The last step to take in order for the changes to take effect is the '''luci-reload''' command which restarts all of the router's services. The ''luci-reload'' command looks like this:
+
The last step to take in order for the changes to take effect is the '''reload_config''' command which restarts all of the router's services. The ''reload_config'' command looks like this:
    
  {
 
  {
Line 189: Line 186:  
         "428a9fa57f1a391db0bd1b865fa16bb5", "file", "exec",  
 
         "428a9fa57f1a391db0bd1b865fa16bb5", "file", "exec",  
 
         {
 
         {
             "command": "<span style=color:orange>luci-reload</span>"
+
             "command": "<span style=color:orange>reload_config</span>"
 
         }  
 
         }  
 
     ]
 
     ]
 
  }
 
  }
 
The command itself is highlighted in orange.<br>
 
The command itself is highlighted in orange.<br>
[[File:LUCI RELOAD.jpg|border|class=tlt-border]]<br>
+
[[File:Postman uci reload.png|border|center|class=tlt-border|730x586px]]
 +
 
 +
Navigate to the router's '''WebUI → Network → Wireless''' and see if the SSID has changed.
 +
<div style="display: flex; justify-content: center; align-items: center;"> <p>'''Before'''</p></div>
 +
[[File:Postmna ssid before.png|border|center|class=tlt-border|768x157px]]
 +
 
 +
<div style="display: flex; justify-content: center; align-items: center;"> <p>'''After'''</p></div>
 +
[[File:Webui ssid changed.png|border|center|class=tlt-border|778x156px]]
    
====Setting Multiple Parameters====
 
====Setting Multiple Parameters====
Line 222: Line 226:  
The command above will change the router's DHCP Server's current Start address, Address limit and Lease time values '''''(highlighted in orange)''''' to custom values provided in the '''"values"''' section of the command '''''(highlighted in green)'''''.
 
The command above will change the router's DHCP Server's current Start address, Address limit and Lease time values '''''(highlighted in orange)''''' to custom values provided in the '''"values"''' section of the command '''''(highlighted in green)'''''.
   −
[[File:Networking rutxxx configuration examples dhcp server v1.jpg|border|class=tlt-border|520x520]]
+
<div style="display: flex; justify-content: center; align-items: center;"> <p>'''Before'''</p></div>
[[File:Networking rutxxx configuration examples dhcp server v2.jpg|border|class=tlt-border|520x520]]<br>
+
[[File:Postman dhcp before.png|border|center|class=tlt-border|792x263px]]
 +
 
 +
<div style="display: flex; justify-content: center; align-items: center;"> <p>'''After'''</p></div>
 +
[[File:Postman dhcp after.png|border|center|class=tlt-border|799x264px]]
   −
'''Note: Remember always to use the commands in the order (set, commit, luci-reload)'''
+
'''Note''': Remember always to use the commands in the order (set, commit, reload_config)
    
==Some Additional Commands==
 
==Some Additional Commands==
    
If the commands found in the guide above did not suffice your needs, this section provides a list of additional ones. The commands presented in this section will be for both Linux and Windows operating systems. They should be used as syntax examples for your own purposes.
 
If the commands found in the guide above did not suffice your needs, this section provides a list of additional ones. The commands presented in this section will be for both Linux and Windows operating systems. They should be used as syntax examples for your own purposes.
<br><br>
   
===WiFi clients list===
 
===WiFi clients list===
 
----
 
----
Line 251: Line 257:  
'''The response''' should look something like this:
 
'''The response''' should look something like this:
 
  {"jsonrpc":"2.0","id":1,"result":[0,{"results":
 
  {"jsonrpc":"2.0","id":1,"result":[0,{"results":
  [{"mac":"<span style=color:green>E4:02:9B:88:09:AA</span>","signal":<span style=color:blue>-32</span>,"noise":<span style=color:blue>-88</span>,"inactive":<span style=color:blue>10</span>,"rx":
+
  [{"mac":"<span style=color:green>E4:02:9B:XX:XX:XX</span>","signal":<span style=color:blue>-32</span>,"noise":<span style=color:blue>-88</span>,"inactive":<span style=color:blue>10</span>,"rx":
 
  {"rate":<span style=color:blue>1000</span>,"mcs":<span style=color:blue>0</span>,"40mhz":<span style=color:blue>false</span>,"short_gi":<span style=color:blue>false</span>},"tx":
 
  {"rate":<span style=color:blue>1000</span>,"mcs":<span style=color:blue>0</span>,"40mhz":<span style=color:blue>false</span>,"short_gi":<span style=color:blue>false</span>},"tx":
 
  {"rate":<span style=color:blue>72200</span>,"mcs":<span style=color:blue>7</span>,"40mhz":<span style=color:blue>false</span>,"short_gi":<span style=color:blue>true</span>}},
 
  {"rate":<span style=color:blue>72200</span>,"mcs":<span style=color:blue>7</span>,"40mhz":<span style=color:blue>false</span>,"short_gi":<span style=color:blue>true</span>}},
  {"mac":"<span style=color:green>D8:C7:71:47:90:E1</span>","signal":<span style=color:blue>-12</span>,"noise":<span style=color:blue>-88</span>,"inactive":<span style=color:blue>400</span>,"rx":
+
  {"mac":"<span style=color:green>D8:C7:71:XX:XX:XX</span>","signal":<span style=color:blue>-12</span>,"noise":<span style=color:blue>-88</span>,"inactive":<span style=color:blue>400</span>,"rx":
 
  {"rate":<span style=color:blue>1000</span>,"mcs":<span style=color:blue>0</span>,"40mhz":<span style=color:blue>false</span>,"short_gi":<span style=color:blue>false</span>},"tx":
 
  {"rate":<span style=color:blue>1000</span>,"mcs":<span style=color:blue>0</span>,"40mhz":<span style=color:blue>false</span>,"short_gi":<span style=color:blue>false</span>},"tx":
 
  {"rate":<span style=color:blue>72200</span>,"mcs":<span style=color:blue>7</span>,"40mhz":<span style=color:blue>false</span>,"short_gi":<span style=color:blue>true</span>}}]}]}
 
  {"rate":<span style=color:blue>72200</span>,"mcs":<span style=color:blue>7</span>,"40mhz":<span style=color:blue>false</span>,"short_gi":<span style=color:blue>true</span>}}]}]}
    
To obtain these values, the Linux '''iwinfo''' command and '''assoclist''' parameter (red) are used. Highlighted in green are the devices connected to the router via WiFi as identified by their MAC addresses. The response information about the connection with the device, such as signal strength, noise, time of inactivity (idle time), rx, tx rate, etc., is highlighted in blue.  
 
To obtain these values, the Linux '''iwinfo''' command and '''assoclist''' parameter (red) are used. Highlighted in green are the devices connected to the router via WiFi as identified by their MAC addresses. The response information about the connection with the device, such as signal strength, noise, time of inactivity (idle time), rx, tx rate, etc., is highlighted in blue.  
<br><br><br><br>
   
===WiFi information===
 
===WiFi information===
 
----
 
----
Line 281: Line 286:     
  {"jsonrpc":"2.0","id":1,"result":[0,
 
  {"jsonrpc":"2.0","id":1,"result":[0,
  {"phy":"<span style=color:blue>phy0</span>","ssid":"<span style=color:blue>HAL9000</span>","bssid":"<span style=color:blue>00:1E:42:16:D6:68</span>","country":"<span style=color:blue>00</span>","mode":"<span style=color:blue>Master</span>","channel":<span style=color:blue>6</span>,"frequency":<span style=color:blue>2437</span>,"txpower":<span style=color:blue>20</span>,
+
  {"phy":"<span style=color:blue>phy0</span>","ssid":"<span style=color:blue>HAL9000</span>","bssid":"<span style=color:blue>00:1E:42:XX:XX:XX</span>","country":"<span style=color:blue>00</span>","mode":"<span style=color:blue>Master</span>","channel":<span style=color:blue>6</span>,"frequency":<span style=color:blue>2437</span>,"txpower":<span style=color:blue>20</span>,
 
  "quality":<span style=color:blue>22</span>,"quality_max":<span style=color:blue>70</span>,"signal":<span style=color:blue>22</span>,"noise":<span style=color:blue>-61</span>,"bitrate":<span style=color:blue>72200</span>,"encryption":
 
  "quality":<span style=color:blue>22</span>,"quality_max":<span style=color:blue>70</span>,"signal":<span style=color:blue>22</span>,"noise":<span style=color:blue>-61</span>,"bitrate":<span style=color:blue>72200</span>,"encryption":
 
  {"enabled":<span style=color:blue>false</span>},"hwmodes":["<span style=color:blue>b</span>","<span style=color:blue>g</span>","<span style=color:blue>n</span>"],"hardware":{"name":"<span style=color:blue>Generic MAC80211</span>"}}]}
 
  {"enabled":<span style=color:blue>false</span>},"hwmodes":["<span style=color:blue>b</span>","<span style=color:blue>g</span>","<span style=color:blue>n</span>"],"hardware":{"name":"<span style=color:blue>Generic MAC80211</span>"}}]}
    
As with the clients list command described above, to obtain this information the Linux '''iwinfo''' command is used, but this time with the '''info''' parameter (red). The relevant information, such as WiFi SSID, WiFi MAC address, WiFi channel, Encryption type, etc., is highlighted in blue
 
As with the clients list command described above, to obtain this information the Linux '''iwinfo''' command is used, but this time with the '''info''' parameter (red). The relevant information, such as WiFi SSID, WiFi MAC address, WiFi channel, Encryption type, etc., is highlighted in blue
<br><br><br><br>
   
===Manufacturing information===
 
===Manufacturing information===
 
----
 
----
Line 297: Line 301:  
         "805725a19ab0fba6c2b44ecf2f952fb9","file", "exec",
 
         "805725a19ab0fba6c2b44ecf2f952fb9","file", "exec",
 
         {
 
         {
             "command":"<span style=color:red>mnf_info</span>", "params":["<span style=color:red>name</span>", "<span style=color:red>sn</span>", "<span style=color:red>mac</span>"]
+
             "command":"<span style=color:red>mnf_info</span>", "params":["<span style=color:red>--name</span>", "<span style=color:red>--batch</span>"]
 
         }
 
         }
 
     ]
 
     ]
Line 303: Line 307:     
'''Linux:'''
 
'''Linux:'''
  curl -d "{ \"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"call\", \"params\": [ \"805725a19ab0fba6c2b44ecf2f952fb9\",\"file\", \"exec\",{ \"command\":\"<span style=color:red>mnf_info</span>\", \"params\":[\"<span style=color:red>name</span>\", \"<span style=color:red>sn</span>\", \"<span style=color:red>mac</span>\"] } ] }" http://<span style=color:black>192.168.1.1</span>/ubus
+
  curl -d "{ \"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"call\", \"params\": [ \"805725a19ab0fba6c2b44ecf2f952fb9\",\"file\", \"exec\",{ \"command\":\"<span style=color:red>mnf_info</span>\", \"params\":[\"<span style=color:red>--name</span>\", \"<span style=color:red>--batch</span>\"] } ] }" http://<span style=color:black>192.168.1.1</span>/ubus
    
'''Response:'''
 
'''Response:'''
  {"jsonrpc":"2.0","id":1,"result":[0,{"code":0,"stdout":"<span style=color:blue>RUT950HG12C0</span>\n<span style=color:blue>1367435694</span>\n<span style=color:blue>001e4216d666</span>\n"}]}
+
  {"jsonrpc":"2.0","id":1,"result":[0,{"code":0,"stdout":"<span style=color:blue>"RUT955003XXX</span>\n<span style=color:blue>0105</span>\n<span style=color:blue>001e4216d666</span>\n"}]}
    
To obtain the manufacturing information the '''mnf_info''' (highlighted in red) command is used. In this case a query was sent asking for the device's Product Code (name), Serial Number (sn) and MAC Address (mac) (highlighted in red in the query; returned values highlighted in blue). Using ''mnf_info'', you can "ask" the router for any type of manufacturing information. Here is the list of possible ''mnf_info'' parameters:
 
To obtain the manufacturing information the '''mnf_info''' (highlighted in red) command is used. In this case a query was sent asking for the device's Product Code (name), Serial Number (sn) and MAC Address (mac) (highlighted in red in the query; returned values highlighted in blue). Using ''mnf_info'', you can "ask" the router for any type of manufacturing information. Here is the list of possible ''mnf_info'' parameters:
   −
* '''mac''' - returns the router's LAN MAC address
+
* '''--mac''' - returns the router's LAN MAC address
* '''maceth''' - returns the router's WAN MAC address
+
* '''--maceth''' - returns the router's WAN MAC address
* '''name''' - returns the router's Product Code
+
* '''--name''' - returns the router's Product Code
* '''wps''' - returns the router's WPS PIN number
+
* '''--wps''' - returns the router's WPS PIN number
* '''sn''' - returns the router's Serial number
+
* '''--sn''' - returns the router's Serial number
* '''batch''' - returns the router's Batch number
+
* '''--batch''' - returns the router's Batch number
* '''hwver''' - returns the router's Hardware Revision number
+
* '''--hwver''' - returns the router's Hardware Revision number
* '''simpin''' - returns the router's SIM card's PIN (as it is specified in the '''[[RUT955 Mobile|Mobile]]''' section)
+
* '''--simpin''' - returns the router's SIM card's PIN (as it is specified in the '''[[RUT955 Mobile|Mobile]]''' section)
* '''blver''' - returns the router's Bootloader version
+
* '''--blver''' - returns the router's Bootloader version
<br><br><br>
   
===GPS Data===
 
===GPS Data===
 
----
 
----
Line 340: Line 343:  
  {"jsonrpc":"2.0","id":1,"result":[0,{"code":0,"stdout":"<span style=color:blue>-23.612625\n-46.626355\</span>n"}]}
 
  {"jsonrpc":"2.0","id":1,"result":[0,{"code":0,"stdout":"<span style=color:blue>-23.612625\n-46.626355\</span>n"}]}
 
The blue part in the code are the Latitude and Longitude.
 
The blue part in the code are the Latitude and Longitude.
<br><br><br>
   
===Firmware number===
 
===Firmware number===
 
----
 
----
Line 363: Line 365:     
This command ('''file''', '''read''', highlighted in red) is an alternative to the Linux '''cat''' command. All you need is to specify the path (in this case '''/etc/version''', highlighted in red) to the file that you wish to read.
 
This command ('''file''', '''read''', highlighted in red) is an alternative to the Linux '''cat''' command. All you need is to specify the path (in this case '''/etc/version''', highlighted in red) to the file that you wish to read.
<br><br><br><br>
+
<br>
 
===Reboot===
 
===Reboot===
 
----
 
----
Line 383: Line 385:     
The success response for this command is an empty message. If the response contains no data, the command was executed successfully.  
 
The success response for this command is an empty message. If the response contains no data, the command was executed successfully.  
<br><br><br><br>
   
===Set SIM card information===
 
===Set SIM card information===
 
----
 
----
Line 414: Line 415:  
  {"jsonrpc":"2.0","id":1,"result":[<span style=color:blue>0</span>]}
 
  {"jsonrpc":"2.0","id":1,"result":[<span style=color:blue>0</span>]}
   −
The command used is ''uci set'' (highlighted in red). The config file name is '''simcard''', section '''sim1''', options '''mtu''' and '''service''' (configs, sections and options highlighted in orange). The response shown above is a positive response, but don't forget to execute ''uci commit'' and ''luci-reload'' afterwards or else your changes will not take effect.
+
The command used is ''uci set'' (highlighted in red). The config file name is '''simcard''', section '''sim1''', options '''mtu''' and '''service''' (configs, sections and options highlighted in orange). The response shown above is a positive response, but don't forget to execute ''uci commit'' and ''reload_config'' afterwards or else your changes will not take effect.
 +
 
 +
==See Also==
 +
You may learn more about UCI commands [[UCI_command_usage|here]].
 +
 
 +
==External links==
 +
https://www.postman.com/ - API software.
   −
[[Category: RutOS Configuration Examples]]
+
[[Category:Router control and monitoring]]

Navigation menu