5G LTE Cellular Connectivity

This tutorial explains how to establish cellular data connection on Raspberry Pi OS using Raspberry Pi 5G Development Kit(with Quectel RM50xQ M.2 5G Modem) .

It is important to properly setup your hardware before you get started. After watching the installation video, follow the steps below.

Note: Make sure the USB bridge is connected.

Please upgrade your Linux system to updated kernel versions to avoid many problems already solved. Make sure your Kernel version is up-to-date, else you may face issues with the driver.

Uninstall Modem Manager and Network Manager

Many Linux distributions have NetworkManager and ModemManager preinstalled. They must uninstall it before starting the tutorial. They can be easily uninstalled through the package manager.

sudo apt purge modemmanager -y
sudo apt purge network-manager -y

Test Driver

Make sure the option usb-serial driver is properly loaded to the module interfaces. Check it with the usb-devices command.

[email protected]:~ $ usb-devices T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1 P: Vendor=2c7c ProdID=0800 Rev=04.14 S: Manufacturer=Quectel S: Product=RM502Q-AE S: SerialNumber=377628d2 C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan

First, install the required serial communication program such as minicom or atcom. We are using minicom for this tutorial.

sudo apt install minicom -y

Then, open the serial communication for /dev/ttyUSB2 device port with 115200 baudrate using minicom

minicom -D /dev/ttyUSB2 -b 115200
Welcome to minicom 2.7.1 OPTIONS: I18n Compiled on Aug 13 2017, 15:25:34. Port /dev/ttyUSB2 Press CTRL-A Z for help on special keys AT OK CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7.1 | VT102 | Offline | ttyUSB2

Approve the communication by sending AT command. You should get a response of OK.

Now, we can start to configure the modem for ECM mode. The response should be OK.

AT+QCFG="usbnet",1

The modem may reboot after the execution of the command. Wait for the minicom screen to be activated again.

Make sure the module is in ECM mode. Check it with the usb-devices command.

[email protected]:~ $ usb-devices T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1 P: Vendor=2c7c ProdID=0800 Rev=04.14 S: Manufacturer=Quectel S: Product=RM502Q-AE S: SerialNumber=377628d2 C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether I: If#=0x5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether

Configure APN.

AT+CGDCONT=1,"IPV4V6","YOUR_APN"

The response should be OK.

Then reboot the modem using the following command. The response should be OK.

AT+CFUN=1,1

Wait for the modem to boot again. It may take 30 seconds. Once the modem reboots, minicom will be activated again.

After the reboot, open a new Linux terminal and check for usbX in the network interface using ifconfig or ipaddr commands.

Note: It may take a few minutes to establish the connection depending on the network.

That's all.

Test Internet Connection

Once the internet is active you should see usbX in your internet interface. You can use ifconfig or ipaddr and look for usbX interface.

Now check the assigned IP address and test the connection.

[email protected]:~ $ ifconfig usb0 usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.225.60 netmask 255.255.255.0 broadcast 192.168.225.255 inet6 fe80::8543:f6a0:e678:2e20 prefixlen 64 scopeid 0x20 ether 4a:aa:f8:62:36:bb txqueuelen 1000 (Ethernet) RX packets 73 bytes 5047 (4.9 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 100 bytes 15116 (14.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[email protected]:~ $ ping -I usb0 sixfab.com -c 5 PING sixfab.com (104.26.9.221) from 192.168.225.60 usb0: 56(84) bytes of data. 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=1 ttl=52 time=209 ms 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=2 ttl=52 time=202 ms 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=3 ttl=52 time=192 ms 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=4 ttl=52 time=193 ms 64 bytes from 104.26.9.221 (104.26.9.221): icmp_seq=5 ttl=52 time=195 ms --- sixfab.com ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 9ms rtt min/avg/max/mdev = 191.895/198.244/209.463/6.636 ms

Troubleshooting

If usbX interface is not visible reboot your whole system, check your SIM, antenna, module and USB.

Then check the configuration of the module.

AT+QCFG="usbnet" # Should return 1

Check the SIM is detected by the module.

AT+CPIN? # Should return READY

Check if the module is registered to the network.

AT+CEREG? # Should return 0,1 or 0,5

Check the APN is right and have an IP.

AT+CGCONTRDP # Should return the APN details and IP address.