Modem Manager set bearer and connect automatically
9
votes
1
answer
22329
views
I'm trying to set up a Huawei E3276 LTE stick with German Telekom and Modem Manager on Raspberry Pi (latest Raspbian), and basically it works but I'm failing to create a configuration that is deployable to the RPi via ansible.
When I connect the LTE stick, ModemManager sets everything up correctly and I end with a wwan0 interface and a 169.254.0.0/16 address assigned to it. Afterwards, I always have to run
sudo mmcli -m 0 --simple-connect="apn=internet.t-d1.de,user=t-mobile,password=tm,number=*99#"
which triggers network manager to get me somehow an IP. Everything's fine.
Since I want to automate this, I want to get rid of manually executing the mmcli command but am currently failing.
- Option 1: cronjob and script - ugly but most likely to work. I want to avoid this
- Option 2: Configuration file for modem manager / mmcli. I did not find any configuration file where I can place this data
- Option 3: udev rule executing the command
pi@raspberrypi:~ $ cat /etc/udev/rules.d/90-lte.rules
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="0c:5b:8f:27:9a:64", RUN+="/usr/local/bin/lte_setup.sh"
pi@raspberrypi:~ $ cat /usr/local/bin/lte_setup.sh
#!/bin/sh
sleep 2
mmcli -m 0 --simple-connect='apn=internet.t-d1.de,user=t-mobile,password=tm,number=*99#'
This doesn't work and I don't actually know why.
So, the basic question: _What is the simplest way to deploy this configuration/scripts via ansible to the Raspberry Pi in order to just get a public IP automatically via Modem-/NetworkManager after pluging the E3276 in?_
One last thing: I am **not** searching for a solution using wvdial or other tools. I spent days trying to use them using "working" configurations from the Internet just to find out they are not working. ModemManager and NetworkManager have proven to work, so I'm just trying to complete the setup without building the ugly cronjob workaround.
Asked by edermi
(91 rep)
Jul 18, 2017, 09:09 AM
Last activity: Aug 31, 2017, 01:26 PM
Last activity: Aug 31, 2017, 01:26 PM