X3000 modem connect/disconnect via CLI

Hi all
Is there a shell command/script/whatever to tell the modem to connect or disconnect? i.e. the scripting equivalent of the "Auto setup" button?

In a perfect world it would also be great to be able to initiate a sim switch via a shell command.

Thanks
Sean

1 Like

Swap to SIM 2: gl_modem -B 0001:01:00.0 AT AT+QUIMSLOT=2
Swap to SIM 1: gl_modem -B 0001:01:00.0 AT AT+QUIMSLOT=1

Check modem bus:
ps |grep modem

"bus":"<depend on the modem process parameter -B>"

Modem disable:

curl -k http://127.0.0.1/rpc -H 'glinet: 1' -d '{"jsonrpc":"2.0","method":"call","params":["","m
odem","disconnect",{"bus":"0001:01:00.0"}],"id":1}'

Modem enable:

curl -k http://127.0.0.1/rpc -H 'glinet: 1' -d '{"jsonrpc":"2.0","method":"call","params":["","m
odem","set_auto_connect",{"bus":"0001:01:00.0"}],"id":1}'

Thanks Bruce - all working well for me
Cheers
Sean