Changes

Line 84: Line 84:  
[[Image:Configuration examples json-rpc firefox poster gsmctl q.PNG]]
 
[[Image:Configuration examples json-rpc firefox poster gsmctl q.PNG]]
   −
The Response was {"jsonrpc":"2.0","id":1,"result":[0,{"code":0,"stdout":"<span style="color:green">-59</span>\n"}]} </font>
+
The Response '''{"jsonrpc":"2.0","id":1,"result":[0,{"code":0,"stdout":"<span style="color:green">-59</span>\n"}]}''' tells us that the router's current signal strength is <span style="color:green">-59 dBm </span>.
 +
 
 +
You can issue almost any SSH command in a similar manner. For example, you wish to check the '''network''' config file. The SSH command to do so would be '''cat /etc/config/network''', which, translated to JSON-RPC, would be:
 +
 
 +
{"jsonrpc": "2.0", "id": 1, "method": "call", "params": [ "a74c8e07646f0da2bfddce35bf3de1f3", "file", "exec", { "command": "<span style="color:orange">cat</span>", "params":["<span style="color:orange">/etc/config/network</span>"] } ] }"
 +
 
 +
</font>

Navigation menu