The main documentation repository for the 🍭☁️
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long. 4.1KB

Modem Manager

Setup an LTE/3G modem. You’ll need to adapt this information to your specific modem(s) but overall the process is sound.

Inspiration / Further Reading

On The Go Help

If you’re ever in need of help on the go, man mmcli has a lot of good info as does mmcli --help.

Initial Setup

The steps below are for getting USB mode switch working which is necessary for some Huawei modems. This example is for a Huawei 366 modem. You’ll need to adjust your setup accordingly.

apt update
apt install usb-modeswitch usb-modeswitch-data
cd /etc/usb_modeswitch.d
tar -xzf /usr/share/usb_modeswitch/configPack.tar.gz
lsusb # note modem ids
# Huawei e366
usb_modeswitch --default-vendor 12d1 --default-product 1446 -c /etc/usb_modeswitch.d/12d1\:1446
lsusb # verify the modem ids changed (may take a moment to mode switch)

Modem Manager Setup / Preflight

apt update
apt install modemmanager # Install
systemctl enable ModemManager # Enable the service
systemctl start ModemManager # Start the service
mmcli --scan-modems # Scan for modems (this can take a few minutes)
mmcli --list-modems # List the modems modem manager sees
mmcli --modem 0 # Get details of first modem


If your modem doesn’t show up when running mmcli --list-modems after a few minutes you may need to reboot. Sometimes modems don’t get picked up right away after using usb_modeswitch.

Setup Auto Mode Switch

This should be setup by the usb_modeswitch package for you. Reboot and then run lspci to ensure it’s 100%.

Useful mmcli Commands / Switches

  • mmcli --monitor-modems
  • mmcli --enable
  • mmcli --disable
  • mmcli --monitor-state
  • --set-power-state-on
  • --set-power-state-low
  • --set-power-state-off

Add connection to NetworkManager

# Ensure things work
mmcli --modem 0 --enable
mmcli --modem 0 --list-bearers
mmcli --modem 0 --3gpp-scan --timeout=100

# Simple connection (this does no good in production)
mmcli --modem 0 --simple-connect="pin=1234,apn=internet"

# Setup persistent connection via NetworkManager
nmcli c add con-name "wan-wwan-1" type gsm ifname "*" apn "internet" home-only true

Location Related Commands

mmcli --modem 0 --location-status
mmcli --modem 0 --location-enable-3gpp
mmcli --modem 0 --location-enable-gps-nmea
mmcli --modem 0 --location-enable-gps-raw
mmcli --modem 0 --location-get