Line 68: |
Line 68: |
| } | | } |
| | | |
− | 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''' SSH command that returns the router's RSSI 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 RSSI value: |
| | | |
− | [[Image:Configuration examples json-rpc firefox poster get gsmctl q.PNG]] | + | [[File:Configuration examples json-rpc firefox poster get gsmctl q v1.png]] |
| | | |
− | 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>.
| + | Look for '''stdout'''; what follows after is the response to the query: '''{"jsonrpc":"2.0","id":1,"result":[0,{"code":0,"stdout":"<span style="color:green">-59</span>\n"}]}'''. This tells us that the router's current signal strength is <span style="color:green">-59 dBm</span>. |
| | | |
− | You can issue almost any Linux command in a similar manner. For example, if 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: | + | You can issue many SSH commands in a similar manner. For example, if 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: |
| | | |
| { | | { |