7951 questions

9403 answers

15104 comments

12979 members

0 votes
74 views 2 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.