I decided to continue tinkering with my MiFi. As it has been quite some time, I forgot a lot of things that I already tried. I also see that there is a brand-new software (3.211) that changed some stuff in the UI. And I see that software that I couldn’t get to work back then (pyserial…) is available as a package. Awesome.
What I’m trying now is starting/stopping the 4G internet connection from the CLI, either from the shell or via python. I see that gl_modem has new connect-auto and new-connect-auto. They indeed connect the wwan automagically. Awesome.
But what do I do when I want to disconnect the 4G connection? gl_modem disconnect does run through similar steps as the connect, but does nothing. Connection stays up. What am I missing?
thanks a lot
gl_modem disconnect does not work for some reason. I have no idea how to use it.
ifconfig wwan0 down
You can also use uci to disable modem connection.
The hint with ifconfig does work, together with an ifconfig wwan0 up right before I run gl_modem new-connect-auto again. Seems a bit inelegant, but it works.
If I may ask… gl_modem is your closed source tool. If you don’t know how to use it, and don’t know the reason why disconnect does not work… how are mere mortals supposed to find out?
And what actions does the big red “Disconnect” button execute on the web interface (the one that appears after clicking “Auto Setup” or running new-connect-auto?
It is a tool used by the developers. It is not released to the public. A released tool should comes with good documents.
As it is not released tool so I cannot guess how it works.
OK, I did some reverse-tinkering. I found that running
/sbin/uci set network.modem_1_1_2.disabled='1'
/sbin/uci commit network
will indeed shut down the 4G and it will stay down. I have therefore what I need.