FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14142 questions

16797 answers

27608 comments

54014 members

0 votes
180 views 3 comments
by
Hi,

I am looking for some help with turning the GSM/Mobile data on and off using JSON-RPC or SNMP (worst case using SSH to the modem and CLI). However, I also need to be able to find the current status (whether it is turned on or off at the moment).

We are using the RUT955 in places where the mobile connection might be available but very poor and would rather then turn it off and use our backup-connection which works better in these specific conditions. Is there any way to do this?

I have looked through the different guides, but can't find how to turn off the mobile wan.. I thought about using different profiles and moving between them where one has Mobile Wan enabled and the other doesn't, but would prefer to not have to do this.

Thanks in advance

1 Answer

0 votes
by

Hi,

Use this to stop and start the modem:     

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

    [

        "yourSessionID", "file", "exec",

        {

            "command":"/etc/init.d/modem",

            "params":

            [

                "start"

            ]

        }

    ]

}

Instead of start, use stop to stop the modem.

And use to view the connection state:

{
    "jsonrpc": "2.0", "id": 1, "method": "call", "params": 
    [
        "yourSessionID", "file", "exec",
        {
            "command":"gsmctl",
            "params":
            [
                "-j"
            ]
        }
    ]
}

by
Thanks a lot!

 However, the gsmctl -j is saying "disconnected" no matter if I don't have connection at all or the modem has been stopped.

I need to know whether the modem has been "stopped" or "started" and not just whether there is a connection or not. Is this possible?

Thanks
by
Unfortunately, there's no way to know the state of it. The best way to do that would be having a script, that would save the boolean value when "start" or "stop" is executed, then you could read the file where the boolean is saved and know the last value it had.

EB.
by
I was digging into this and it appears yourSessionID is not permanent but expires - and presumeably must be renewed and how is that negotation embedded back into the json scripts in the thingsboard widgets ?