7877 questions

9301 answers

14976 comments

12781 members

0 votes
112 views 0 comments
by
With CLI commands if I wanted to for example remove the set pincode for sim1 I could use either "uci set simcard.sim1.pincode=" to set it to nothing, or I could use "uci delete simcard.sim1.pincode". Both commands have the same result, however I can't seem to get this working in JSON-RPC.
With "set" I have tried setting the pincode value to nothing ("pincode": "") and to null ("pincode": null) with the following command:
{
    "jsonrpc":"2.0", "id":1, "method":"call", "params":
    [
        "8c32d44431271e7ad5ab70ef4fa0d7c9", "uci", "set",
        {
            "config": "simcard",
            "type": "sim1",
            "values": {
                "pincode": null
            }
        }
    ]
}

Neither of these removed the pincode. So I have tried to use the delete command but I'm not entirely clear on how to use it, I don't know how to select the pincode specifically, I have tried the following but it just deleted all of sim1:
{
    "jsonrpc":"2.0", "id":1, "method":"call", "params":
    [
        "59e5ce6282be430bc4da227e49f3f378", "uci", "delete",
        {
            "config": "simcard",
            "type": "sim1",
            "values": {
                "pincode": "0000"
            }
        }
    ]
}
I assume "values": { "pincode": "0000" } is ignored in this command because the syntax is wrong, but I don't know how else to try to select just the pincode.
Does anyone know how I would go about removing the pincode?

EDIT:
For anyone reading this in the future, I managed to remove the pin by using empty square brackets:
{
    "jsonrpc":"2.0", "id":1, "method":"call", "params":
    [
        "8c32d44431271e7ad5ab70ef4fa0d7c9", "uci", "set",
        {
            "config": "simcard",
            "type": "sim1",
            "values": {
                "pincode": []
            }
        }
    ]
}

1 Answer

0 votes
by

Hello,

I suggest you better try to use AT commands with JSON-RPC. There are examples how to change or remove SIM PIN via AT commands: https://wenchiching.wordpress.com/2017/06/29/at-command-to-setup-pin/

Also, if you are trying to change or delete PIN using uci commands, do not forget to send commit and reload request alongside set. There is a possibility you also need to restart the modem for PIN changes to take effect. Please refer to this guide section with uci command requests: https://wiki.teltonika-networks.com/view/RUT950_Monitoring_via_JSON-RPC_windows

Regards.