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

Hi, I'm trying to configure my default sim in my router using a json requests, the current default sim is 1:
result from uci get simcard.simcard.default: sim1
the requests are like this:
UCI SET

request

{
    "jsonrpc":"2.0""id":1"method":"call""params":
    [
        "sessionID""uci""set",
        {
            "config":"simcard",
            "type":"simcard",
            "match":{
                "default":"sim1"
            },
            "values":{
                "default":"sim2"
            }
        }
    ]
}
Response:
{
    "jsonrpc""2.0",
    "id"1,
    "result": [
        0
    ]
} UCI COMMIT
request
{
    "jsonrpc":"2.0""id":1"method":"call""params":
    [
        "sessionID""uci""commit",
        {
            "config":"simcard"
        }
    ]
}
response
{
    "jsonrpc""2.0",
    "id"1,
    "result": [
        0
    ]
}
and finally luci reload
request
{
    "jsonrpc":"2.0""id":1"method":"call""params":
    [
        "sessionID""file""exec",
        {
            "command":"luci-reload"
        }
    ]
}
response
(after 9 secs)
{
    "jsonrpc""2.0",
    "id"1,
    "result": [
        7
    ]
}
but then i try again to get the default sim: uci get simcard.simcard.default = "sim2" looks good but eventually the actual default sim doesnt change, maybe I'm missing something

1 Answer

0 votes
by anonymous
Call B_ND_ !!! :)

Seriously,  im having the same problem

Seems that "luci-reload" doesn't work using JSON? I don't see it execute in the logread -f
by anonymous
yea, I found a walkaround,
just /etc/init.d/sim_switch_conf reload
then /etc/init.d/sim_switch restart