Skip to main content

4G/5G

This document provides usage instructions for 4G/5G modules, using Quectel's EM05 and RM520N-GL 5G as examples. Both modules already have drivers in the system, so no additional driver installation is required.

Serial Tool

You can use minicom to execute AT commands

$ sudo apt-get install minicom

EM05

With the driver already installed, input lsusb to see the device

Bus 001 Device 004: ID 2c7c:030e Quectel Wireless Solutions Co., Ltd. Quectel EM05-G

Input dmesg to see four ttyUSB devices, where ttyUSB2 is used for AT commands

[   11.224317] usbserial: USB Serial support registered for GSM modem (1-port)
[ 11.224419] option 1-2.3:1.0: GSM modem (1-port) converter detected
[ 11.224595] usb 1-2.3: GSM modem (1-port) converter now attached to ttyUSB0
[ 11.224653] option 1-2.3:1.1: GSM modem (1-port) converter detected
[ 11.224763] usb 1-2.3: GSM modem (1-port) converter now attached to ttyUSB1
[ 11.224811] option 1-2.3:1.2: GSM modem (1-port) converter detected
[ 11.225863] usb 1-2.3: GSM modem (1-port) converter now attached to ttyUSB2
[ 11.225951] option 1-2.3:1.3: GSM modem (1-port) converter detected
[ 11.227422] usb 1-2.3: GSM modem (1-port) converter now attached to ttyUSB3

Open with minicom

$ sudo minicom -D /dev/ttyUSB2

Use AT commands to check various information. Common commands include

ati                     Check module model and firmware version
at+cpin? Check if SIM card is in place
at+csq Check signal strength
at+cops Check carrier operator
at+creg? Get registration status (0,1 indicates normal registration)

Since Ubuntu's network manager automatically configures the network, use the graphical network configuration

EM05_network_configuration.png

Check network with ifconfig

enx12849acd283b: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
inet 192.168.225.26 netmask 255.255.255.0 broadcast 192.168.225.255
inet6 2409:8934:20d1:2d63:849f:fe7:583d:664c prefixlen 64 scopeid 0x0<global>
inet6 2409:8934:20d1:2d63:cee5:ca58:9917:456b prefixlen 64 scopeid 0x0<global>
inet6 fe80::ebb7:1cbd:5f8d:93a1 prefixlen 64 scopeid 0x20<link>
ether 12:84:9a:cd:28:3b txqueuelen 1000 (Ethernet)
RX packets 11732 bytes 14718060 (14.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9674 bytes 811730 (811.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Test network connection with ping

$ ping -I enx12849acd283b www.baidu.com
PING www.baidu.com(2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c)) from 2409:8934:20d1:2d63:849f:fe7:583d:664c enx12849acd283b: 56 data bytes
64 bytes from 2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c): icmp_seq=1 ttl=48 time=49.1 ms
64 bytes from 2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c): icmp_seq=2 ttl=48 time=50.4 ms
64 bytes from 2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c): icmp_seq=3 ttl=48 time=43.9 ms

RM520N-GL

With the driver already installed, input lsusb to see the device

Bus 002 Device 003: ID 2c7c:0801 Quectel Wireless Solutions Co., Ltd. RM520N-GL

Input dmesg to see four ttyUSB devices, where ttyUSB2 is used for AT commands

[    9.209315] option 2-1.3:1.0: GSM modem (1-port) converter detected
[ 9.214898] usb 2-1.3: GSM modem (1-port) converter now attached to ttyUSB0
[ 9.214989] option 2-1.3:1.1: GSM modem (1-port) converter detected
[ 9.215167] usb 2-1.3: GSM modem (1-port) converter now attached to ttyUSB1
[ 9.215211] option 2-1.3:1.2: GSM modem (1-port) converter detected
[ 9.215319] usb 2-1.3: GSM modem (1-port) converter now attached to ttyUSB2
[ 9.215368] option 2-1.3:1.3: GSM modem (1-port) converter detected
[ 9.215450] usb 2-1.3: GSM modem (1-port) converter now attached to ttyUSB3

Open with minicom

$ sudo minicom -D /dev/ttyUSB2

Use AT commands to check various information. Common commands include

ATI                      Check module information
AT+CPIN? Check SIM card status
AT+C5GREG? Check carrier registration status (should return 0,1 or 0,5)
AT+QENG="servingcell" Check carrier information
AT+CGPADDR=1 Check if the first PDP has an IP address
AT+CGACT=1,1 Activate the first PDP if no IP address
AT+QCFG="usbnet" Check network card configuration mode

Example execution results

Welcome to minicom 2.8

OPTIONS: I18n
Port /dev/ttyUSB2, 09:50:32

Press CTRL-A Z for help on special keys


Quectel
RM520N-GL
Revision: RM520NGLAAR01A08M4G

OK

+CPIN: READY

OK

+C5GREG: 0,1

OK

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",460,00,203959107,575,3259E7,504990,41,3,-116,-12,12,1,4

OK

+CGPADDR: 1,"10.131.145.127","36.9.137.52.32.194.251.231.24.28.238.148.193.140.209.180"

OK

+QCFG: "usbnet",1

OK

For Linux systems, if the network card configuration mode is not ECM mode, change it to ECM mode. Mode definition

AT+QCFG="usbnet",0 驱动类型为 NDIS(QMI));
AT+QCFG="usbnet",1 驱动类型为 ECM;(Linux系统推荐用)
AT+QCFG="usbnet",2 驱动类型为 MBIM;(Windows系统推荐用,Linux暂不支持)
AT+QCFG="usbnet",5 驱动类型为 NCM;(暂不支持)

Use commands for network configuration

AT+QCFG="usbnet",1 
AT+CFUN=1,1

After restarting, dmesg shows the ECM device being registered

[    9.206605] cdc_ether 2-1.3:1.10 usb0: register 'cdc_ether' at usb-3610000.usb-1.3, CDC Ethernet Device, 7a:a8:fd:a4:36:d1

Check network with ifconfig (IP is automatically assigned)

enx7aa8fda436d1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
inet 192.168.225.94 netmask 255.255.255.0 broadcast 192.168.225.255
inet6 2409:8934:20c2:fbe7:bc33:5fcd:fd07:f46b prefixlen 64 scopeid 0x0<global>
inet6 fe80::df81:1f32:7692:e058 prefixlen 64 scopeid 0x20<link>
inet6 2409:8934:20c2:fbe7:4430:9c7e:4027:7637 prefixlen 64 scopeid 0x0<global>
ether 7a:a8:fd:a4:36:d1 txqueuelen 1000 (Ethernet)
RX packets 12581 bytes 15549574 (15.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9243 bytes 773976 (773.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Test network connection with ping

$ ping -I enx7aa8fda436d1 www.baidu.com
PING www.baidu.com(2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c)) from 2409:8934:20c2:fbe7:4430:9c7e:4027:7637 enx7aa8fda436d1: 56 data bytes
64 bytes from 2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c): icmp_seq=1 ttl=47 time=44.6 ms
64 bytes from 2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c): icmp_seq=2 ttl=47 time=64.1 ms
64 bytes from 2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c): icmp_seq=3 ttl=47 time=107 ms

With normal connection, the 5G module can be used properly.