7877 questions

9301 answers

14975 comments

12781 members

0 votes
240 views 7 comments
by

I'm using JSON-RPC to make an HTTP request to the RUT950. The request I'm making asks the router to scan for network operators and return them, which takes about 20 seconds when done in putty. The command is "gsmctl -A AT+COPS=?", in JSON-RPC I have written this as:
{
    "jsonrpc": "2.0", "id": 1, "method": "call", "params": [
        "<session ID here>", "file", "exec",
        {
            "command":"gsmctl",
            "params": [
                "-A",
                "AT+COPS=?",
            ]
        }
    ]
}

When testing this request in postman it always loads for exactly 9 seconds before returning the following:
{"jsonrpc":"2.0","id":1,"result":[7]}

The client is set to never time out so my assumption is that the RUT950 is set to timeout after 9 seconds, does anyone know how to increase this?

1 Answer

0 votes
by
Hello,

It seems that you are correct about RUT950 timeout limitations. I forwarded your issue to our RnD department and will let you know if it is possible to increase the timeout time.

Regards.
Best answer
by
Got the answer from our RnD department. Right now it is not possible to set timeout time longer than 9 seconds because it would require some firmware changes. It is not in the to-do list for the next 2 firmware releases, but maybe after that, it will be implemented.
by
Thanks for the help, would you happen to know if there is currently a way to request the network operators aside from the CLI? I'm trying to make it possible to manually select one from my own program, but I'm currently stuck on how to perform the scan.
by

Unfortunately, there are only 2 ways to scan operators.

  • Scan using AT commands as you tried before;
  • Scan via WebUI button which in the background still calls out AT+COPS? command
by
I'm a bit confused about how the WebUI can make the request without timing out, what is it doing differently from my own request? Would I be able to do the same thing?
by
Your request does not time out and when you scan operators, you actually are doing it successfully. The issue is that the JSON query does not wait longer than 9 seconds right now and you get empty results, while your router still scanning for operators.
by
Thanks for the help so far, I have 2 more questions:
1. Since the scan continues, could I manually wait a set amount of time (say 30 seconds) to wait for the scan to finish and then make a second request to retrieve the finished scan data?

2. Would it be possible to instead make the same request that the WebUI makes, but from my own function? I noticed it doesn't make use of /ubus.
I tried to match the headers and URL (http://192.168.1.1/cgi-bin/luci/;stok=5ed5096df8cdbb20ba33a8b0deb3b148/admin/status/start_dmn?_=0.33833189060284674) for that request but the response I got was just telling me I needed to log in.
by
Hi,

I have run into the same problem as mentioned above. Is this problem solved? How can you increase the timeout time of the JSON-RPC request?

Kind regards

Sander