I also recall reading that "Modem Manager" had been ported once or twice to OpenWRT (as I recall the latest port was said to be reasonably full-featured), but I don't immediately see those links in my bookmarks.
Thanks, I'll definitely look into this.
However, I was wondering if it is possible to do what thos "Stop" and "connect" button do in gui via command. In that case I could easily ad that in rc. And maybe right a script to check internet connection and do those things if no connection.
But not sure what it actually does.
I have dmsg and logread from both after and before pressing those buttons.
Let me know if those will be of any help.
Typically, one manages the modem, then resets/updates the interface once there is a connection. The modem takes commands over a device, and accepts/spews data over another (or a sub-channel). That data stream needs to be connected to an interface so that it can be used for networking.
I would start with the instructions on the "LTE Modem" page I linked. At least as I understand it, you don't yet have connectivity through the modem. Once you have that up and running, then working on scripts (or switching to Modem Manager) makes sense.
Ok, I'll check that page.
By the way, the modem is working just fine without any scripts or anyhitng.
It's just, I have to Stop the inferface, then Connect evertime I reboot.
So, everything required to make the modem work, is already there. I just needed a way to automate the "Stop", "connect" buttons.
When you are connected to internet then do ifconfig and see which interface is 3G device. In my post I referred to 3g because in LuCI you had 3G listed as an interface. You need to see the actual interface from the ifconfig command first. When you find the interface then put that interface to the ifdown and ifup commands and it will work.
Maybe put a little delay before executing those commands in rc.local. It maybe necessary to let the router register the device before it tries to find the interface. Looking at your original post, I think your 3g interface maybe listed as 3G and that is why it did not find 3g as an interface.
sleep 5 # wait for 5 seconds
ifdown $interface # $interface is your 3g interface
Also for your question about STOP and CONNECT -- The stop command in LuCI refers to ifdown in command-line and CONNECT refers to ifup.
Hmm ... seems you have a lot of tips, already.
I think, the most standard way would be:
network -> interfaces -> your-3g-interface -> advanced-settings -> check "bring up on boot"
mwan3 parameters you find unter: network -> load balancing
-- I'm not sure mwan3 is the right tool for your job, though, since you only have 1 WAN interface (your 3g modem) ... you could maybe do a simple hotplug script. Something along the lines of the following in a file like /etc/hotplug.d/iface/25-my-3g-modem:
if [ "$INTERFACE" = "modem" ] ; then
if [ "$ACTION" = "ifdown" ] ; then
# replace modem with the name of your interface which you can see in /etc/config/network
OP's problem is that modem device doesn't show up in the /etc/config/network because when not connected it is not a physical/logical interface yet. The modem device does show up as /dev/tty/usb0 or something like that. This is the reason ifup and ifdown is not working. I have suggested to use usb_modeswitch to see if that works.