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
168 views 1 comments
by anonymous

Hello, 

I am trying to get access to my RUT955 over JSON so I can get GPS coordinates.

After successfully logging into the router I cannot get coordinates.

Here are the steps which I did (following the documentation):

POST @ http://192.168.0.1/ubus

I am logging in and getting session without any problems.

----------------------------------SEND----------------------------------------

{

    "jsonrpc":"2.0", "id":1, "method":"call", "params":

    [

        "00000000000000000000000000000000", "session", "login",

        {

            "username":"admin", "password":"AltproRAS90"

        }

    ]

}

 ----------------------------------SEND----------------------------------------

----------------------------------RECEIVE--------------------------------------- 

{

  "jsonrpc": "2.0",

  "id": 1,

  "result": [0, {

    "ubus_rpc_session": "7b78d382cc4d454b55f4cabdafd882ed",

    "timeout": 300,

    "expires": 299,

    "acls": {

      "access-group": {

        "core": ["read", "write"],

        "network/dns": ["read", "write"],

        "network/firewall/attack_prevention": ["read", "write"],

  ..... and all the rest .......      

  

}

 ----------------------------------RECEIVE--------------------------------------- 

I am trying to get GPS but no coordinates are returned just this message.

  ----------------------------------SEND----------------------------------------

{

    "jsonrpc": "2.0", "id": 1, "method": "call", "params":

    [

      "581a05de18fd543582af4feb11d4bcbf","file", "exec",

         {

           "command":"gpsctl", "params":["-ix"]

         }

    ]

}

  

  ----------------------------------SEND----------------------------------------

  ----------------------------------RECEIVE--------------------------------------- 

RESPONSE ERROR: {"jsonrpc":"2.0","id":1,"result":[6]}

  ----------------------------------RECEIVE--------------------------------------- 

I am trying to get serial number ... but again same message is returned.

  ----------------------------------SEND---------------------------------------- 

{

    "jsonrpc": "2.0", "id": 1, "method": "call", "params":

    [

        "581a05de18fd543582af4feb11d4bcbf","file", "exec",

        {

            "command":"mnf_info", "params":["name", "sn", "mac"]

        }

    ]

}

  ----------------------------------SEND---------------------------------------- 

   ----------------------------------RECEIVE--------------------------------------- 

RESPONSE ERROR: {"jsonrpc":"2.0","id":1,"result":[6]}

  ----------------------------------RECEIVE--------------------------------------- 

What could be the cause for such behaviour?

Thank you in advance for helping out.

1 Answer

0 votes
by anonymous
Hi,

Could you please give me some information on this:

1. What is the firmware version that you're using?

2. What are the exact posts that you're sending into JSON? I mean the ones that you mentioned as "SEND" but I believe you missed some of the text.

3. Have you tried executing simple posts that are given as example in our wiki to see if it works?

https://wiki.teltonika-networks.com/view/RUT955_Monitoring_via_JSON-RPC_linux

EB.
by anonymous

Hi,

thank you for helping out.

1. Version is:

image

2. What are the exact posts that you're sending into JSON? I mean the ones that you mentioned as "SEND" but I believe you missed some of the text.

This are the exact posts I have tried. I have shorted first receive because this system wouldn't accept such long copy-paste.

Strange thing is that loging-in works fine... why would other commands fails.

If I am doing something wrong... wouldn't loging-in be the first issue I would encounter.

I have followed the steps from the link you have supplied which I found earlier.

3. Have you tried executing simple posts that are given as example in our wiki to see if it works?

Yes, exactly those. This is where I have found all of the information I have used.

BR.