Build your own LoRaWAN gateway using a Raspberry Pi, RAK Wireless concentrator hat and connect it to LTE-M to offload the LoRaWAN data using a SIMCom cellular modem and Monogoto SIM. The gateway firmware can be built and managed with Balena.
PrerequisitesThis story is a follow-up of the the Hackster projectDeploy a Basics Station TTS LoRa Gateway with balena. It assumes you already have a LoRaWAN gateway up and running with Basics Station firmware, connected to The Things Network.
Why LTE-M?LTE-M, also known as LTE Cat-M1 or eMTC is a low power, wide area network (LPWAN) technology, optimized for low-cost and long-range applications which don't require large bandwidth. LTE-M usually support up to 375kbps data throughput, which is perfect when used to offload LoRaWAN gateway traffic.
Before purchasing a LTE-M modem, make sure to validate that your country has an active LTE-M network running. Have a look at the GSMA coverage map to get an overview of all available networks.
To start off, add the miniPCIe LTE-M modem to the USB dongle. In this example, the SIM7000E is used, alternatives are the SIM7000G or SIM7070G.
Add the Monogoto SIM with global connectivity to the USB dongle and connect an antenna to the USB dongle using the uFL connector.
Connect the LTE modem to the Raspberry Pi using the USB port.
Using MonogotoMonogoto is a global cellular network provider. Monogoto SIMs can be used to connect with 500+ mobile operators globally.
You can request a free SIM here.
Monogoto SIM come without a PIN and are already activated. To start using the SIM, you only need to set the APN to: data.mono
.
Management and monitoring of the SIM can be done via the Monogoto Console, access is provided together with the SIM.
Setting up BalenaLog in to your Balena account and select the LoRaWAN gateway you want to add cellular connectivity to.
Configure the balena Network ManagerStart a Terminal session by clicking select a target - HostOS - >_ Start Terminal Session
Open the folder system-connections:
cd /etc/NetworkManager/system-connections
Create a new file called monogoto by entering the command:
vi monogoto
Press i
to edit the file you just created and paste the following content:
[connection]
id=monogoto
type=gsm
autoconnect=true
[gsm]
apn=data.mono
[serial]
baud=115200
[ipv4]
method=auto
route-metric=200
[ipv6]
addr-gen-mode=stable-privacy
method=auto
The text you just pasted contains Monogoto's APN: data.mono
ℹ️️ With route-metric
you can define the priority of the technology. A lower metric means a higher priority. If you leave out this line, the RPI will first try to connect using Wifi or wired ethernet, before connecting to cellular.
Save the file by pressing esc, followed by :wq
and press enter to write and close the file.
Minimize the terminal, and click Reboot
After a reboot, you should see 2 local IP addresses. One is your local network, one is from Monogoto.
ℹ️️ Important note. It may take several minutes before the cellular module selects a network and a cell tower to connect with. Be patient.Validate cellular Connection
To find more details about the cellular connection and to validate its priority relative to other connection types, enter:
ip route
This should return something like:
default via 10.136.XX.XX dev wwp1s0u1u1i5 metric 200
default via 192.168.2.254 dev wlan0 metric 600
wwp1s0u1u1i5
indicates the cellular connection type (this may have a different name in your case), wlan0
indicates a WiFi connection. Lower metrics have higher priority, meaning that in my case the Raspberry Pi first tries to connect over cellular before looking for WiFi.
Test the cellular connection by sending a ping:Replace wwp1s0u1u1i8
with the name of your connection type
ping -I wwp1s0u1u1i8 8.8.8.8
ℹ️️ End the ping session through Control+C
Example response:
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=49 time=114.677 ms
64 bytes from 8.8.8.8: seq=1 ttl=49 time=140.060 ms
64 bytes from 8.8.8.8: seq=2 ttl=49 time=94.791 ms
64 bytes from 8.8.8.8: seq=3 ttl=49 time=134.552 ms
Read the connection types and their state
nmcli c
Example response:
NAME UUID TYPE DEVICE
monogoto d17d0bc1-2f13-39ac-8b72-b81f69d2d045 gsm cdc-wdm0
balena-wifi-01 983466c0-806d-361b-9535-e4b548cf0d62 wifi wlan0
supervisor0 fc05861a-f6ab-4582-908b-4fbfed47f66a bridge supervisor
Active connections are indicated in green. Non-active connections are shown in yellow.
Finally, check the status of the cellular connectionEnter the command:
mmcli -m 0
Expected response:
Status | lock: sim-pin2
| unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
| state: connected
| power state: on
| access tech: lte
| signal quality: 71% (cached)
----------------------------------
3GPP | imei: XXXXXXXXXXXXXX
| operator id: 20404
| operator name: vodafone NL
| registration: roaming
----------------------------------
3GPP EPS | ue mode of operation: csps-2
| initial bearer path: /org/freedesktop/ModemManager1/Bearer/0
| initial bearer apn: data.mono
|initial bearer ip type: ipv4
----------------------------------
Deploy your gateway in the wildCongratulations on adding LTE-M to your gateway! 🎉
Next up, install your gateway in a remote location and behold, the gateway still runs like a charm!
Comments