Raspberry Pi
Adding cellular connectivity to your Raspberry Pi 3 or 4
Last updated
Adding cellular connectivity to your Raspberry Pi 3 or 4
Last updated
Adding cellular connectivity to your Raspberry Pi can be done in a few simple steps.
Monogoto SIM
Raspberry Pi 3 or 4
USB adapter with mini PCIe and SIM slot (example)
Mini PCIE cellular modem, for example:
Sierra Wireless MC7700 (LTE)
Telit ME910C1-WW mini PCle (LTE-M & NB-IoT)
Quectel EC25 mini PCle (LTE)
Access the Raspberry Pi by connecting a screen and keyboard (recommended) or connect over SSH.
Open the terminal and validate if the NetworkManager and ModemManager are installed.
Make sure that the Raspberry Pi runs NetworkManager version 1.3 or higher and ModemManager version 1.14 or higher. If this is not the case, update or install the NetworkManager and ModemManager using the command:
In addition, install the libqmi-utils and udhcpc packages.
Add the mini PCle cellular modem to the USB adapter
Add the Monogoto SIM to the USB adapter
Connect the cellular PCle card to the Raspberry Pi, using the USB port
Open the CLI (Command Line Interface) and see of the USB with cellular modem gets detected:
Example response:
The cellular modem requires the driver qmi_wwan
, to verify if the driver is compatible with the modem, enter lsusb -t
:
Check what USB port the cellular modem is connected to.
Example response:
Start and enable the NetworkManager, when doing so you will be asked to fill out your root password.
After enabling the NetworkManager, the Wifi connection of your Raspberry Pi breaks.
To activate your Wifi again, enter:
Expected response:
Create a new connection with name monogoto
and set the APN to data.mono
:
Expected response:
To test if the connection was successfully added, a new file with the name monogoto.nmconnection
is created and added to the directory system-connections
When opening this file (using sudo vi
) it should show something like:
Manually start the connection using the command:
Expected response:
The connection with name monogoto
should be linked to the device called cdc-wdm0
. If the connection is active, everything is displayed in green.
Expected response:
Enter the following command to activate the cdc-wdm0
device:
Expected response:
List the connected modems:
Expected response:
Replace 0
with the value you found when running mmcli -L
Example response:
Check if the cellular interface is added, and if an IP address was derived. Look for the interface with name wwan0
Expected response:
If no wwan0
interface is visible, disconnect the USB with PCIe and reboot the Raspberry Pi. Connect the USB dongle again after the Raspberry Pi has fully booted.
Expected response:
The lower the metric number, the higher the priority of the connection. In the above example, the wlan0
(wifi) interface has a higher priority than the wwan0
(cellular) interface.
Change priority of the connections (optional)
To change the priorities of the connections, the metric numbers needs to be adapted. To do so, go to the directory: /etc/NetworkManager/system-connections
Open the file (using sudo vi
) monogoto.nmconnection
Add the line route-metric=200
under the section [ipv4]
. The file becomes:
Restart the NetworkManager
Validate the connectivity priorities by entering:
Expected response:
Ping IP address 8.8.8.8
to validate the data connection:
When multiple connections are up and running, specify the use of the wwan0
interface through: ping -I wwan0 8.8.8.8
Optionally, you can disable other interfaces (for example the wlan0
) using the command: ip link set dev wlan0 down
Example response:
If no wwan0
interface is visible, or the pings result in errors, disconnect the USB with PCIe and reboot the Raspberry Pi. Connect the USB dongle again after the Raspberry Pi has fully booted.
To find NetworkManager logs, enter: systemctl status NetworkManager
Did you manage to connect your Raspberry Pi to Monogoto? Great work! Have a look at the Things logs in the Monogoto Hub to find more details about the established connection.