The Raspberry Pi that is used on Andino boards provides enough processing power to be used as a relatively capable router. This is especially true in the case of the Andino Gateway, which has several network interfaces that can be used. But using the Andino 4G, other Andino boards can also be used for similar purposes.
This page gives detailed instructions for how to install and use the modem-manager and network-manager tools, which are used connecting to modems and managing the various connections within Raspberry Pi OS. Specifically, the installation of the Andino LTE 4G modem will be explained.
As a prerequisite, it will be assumed that you have already set up Raspberry Pi OS (for example by using one of our setup scripts) as explained in our Baseboard Setup instructions. As a first step for the setup of the 4G modem, we need to install some software (if not already done). Just in case, try to install the following packages:
sudo apt install modemmanager libqmi-utils network-manager
As for hardware installation, make sure to first power off the Raspberry Pi. Afterwards, connect the Andino 4G modem to the Raspberry Pi via USB, insert the SIM card (full-sized SIM required) and connect the antenna to the corresponding connector. You can now turn the Pi back on (power cycle) and log back in via SSH.
First, we need to find out some information about the modem. To see a list of all available modems, run
mmcli -L
This should output only one entry:
/org/freedesktop/ModemManager1/Modem/0 \[QUALCOMM INCORPORATED\] 0
The last part of the modem path shows the number of the modem. In this case, the number of the modem is 0 - this can be used to show more information about the modem by running (replace 0 with the number of your modem):
sudo mmcli -m 0
We now get quite a lot of informatino about our modem. The Status-section is especially interesting - we can see here that no connection has been established yet since our SIM card is still locked:
-----------------------------------
General | dbus path: /org/freedesktop/ModemManager1/Modem/0
| device id: 67d231c42ce6340315777d36203c220c2e07de0b
-----------------------------------
Hardware | manufacturer: QUALCOMM INCORPORATED
| model: 0
| firmware revision: LE11B13SIM7600M22
| carrier config: TF_Germany_VoLTE
| carrier config revision: 05010C14
| h/w revision: 10000
| supported: gsm-umts, lte
| current: gsm-umts, lte
| equipment id: 862798062015116
-----------------------------------
System | device: /sys/devices/platform/scb/fe9c0000.xhci/usb1/1-1/1-1.2
| drivers: qmi_wwan, option1
| plugin: simtech
| primary port: cdc-wdm0
| ports: cdc-wdm0 (qmi), ttyUSB0 (qcdm), ttyUSB1 (gps),
| ttyUSB2 (at), ttyUSB3 (at), ttyUSB4 (audio), wwan0 (net)
-----------------------------------
Status | lock: sim-pin
| unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
| state: locked
| power state: on
| signal quality: 0% (cached)
-----------------------------------
Modes | supported: allowed: 2g; preferred: none
| allowed: 3g; preferred: none
| allowed: 4g; preferred: none
| allowed: 2g, 3g; preferred: 3g
| allowed: 2g, 3g; preferred: 2g
| allowed: 2g, 4g; preferred: 4g
| allowed: 2g, 4g; preferred: 2g
| allowed: 3g, 4g; preferred: 4g
| allowed: 3g, 4g; preferred: 3g
| allowed: 2g, 3g, 4g; preferred: 4g
| allowed: 2g, 3g, 4g; preferred: 3g
| allowed: 2g, 3g, 4g; preferred: 2g
| current: allowed: 2g, 3g, 4g; preferred: 4g
-----------------------------------
Bands | supported: egsm, dcs, utran-1, utran-5, utran-8, eutran-1, eutran-3,
| eutran-5, eutran-7, eutran-8, eutran-20, eutran-38, eutran-40,
| eutran-41
| current: egsm, dcs, utran-1, utran-5, utran-8, eutran-1, eutran-3,
| eutran-5, eutran-7, eutran-8, eutran-20, eutran-38, eutran-40,
| eutran-41
-----------------------------------
IP | supported: ipv4, ipv6, ipv4v6
-----------------------------------
SIM | dbus path: /org/freedesktop/ModemManager1/SIM/0
If you removed the PIN code from your SIM card, you can usually skip this step. The SIM card can simply be unlocked by inserting the 4-didit PIN code with the following command:
sudo mmcli -i 0 --pin=<pin_code>
If you have already entered the PIN code wrong to many times, you will need to use the PUK instead. This can be done using:
sudo mmcli -i 0 --puk=<puk_code>
After the SIM card has been unlocked, the modem can now be enabled using the following command:
sudo mmcli -m 0 --enable --timeout=180
If the unlock has been successful, you should get the following output:
successfully enabled the modem
When running sudo mmcli -m 0 again, we should now see in the Status section that the modem is now unlocked and (ideally) already connected:
-----------------------------------
Status | lock: sim-pin2
| unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
| state: registered
| power state: on
| access tech: lte
| signal quality: 65% (recent)
-----------------------------------
To enable internet access, an APN now also needs to be specified. The address of the APN of your provider can usually easily be found by simply searching for it. The APN is usually either just a host or a domain/subdomain (e.g. internet / web.vodafone.de / ...)
sudo mmcli -m 0 --simple-connect="apn=internet"
We can now enable and start the NetworkManager and ModemManager services:
sudo systemctl enable NetworkManager
sudo systemctl start NetworkManager
sudo systemctl enable ModemManager
sudo systemctl start ModemManager
Then, we can print out a list of all devices using:
nmcli device
This should already show us our LTE modem, which here is still displayed as disconnected.
eth0 ethernet connected Wired connection 1
cdc-wdm0 gsm disconnected --
lo loopback unmanaged --
We can now enable the device by setting up a new connection. This can be done by running the following command (replace the string after apn with your provider's apn again):
sudo nmcli connection add type gsm ifname '*' con-name andino-lte apn "internet"
If the connection could be created as expected, you should see the following:
Connection 'lte-modem' (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) successfully added.
When running nmcli device you should now see that the connection has been enabled:
DEVICE TYPE STATE CONNECTION
eth0 ethernet connected Wired connection 1
cdc-wdm0 gsm connected lte-modem
lo loopback unmanaged --