0020 MPU4G(PCIe to USB 4G LTE EN:修订间差异

来自Mcuzone Wiki
 
(未显示同一用户的9个中间版本)
第1行: 第1行:
[[0020 MPU4G(PCIe to USB 4G LTE|切换语言为中文]]
== '''Keywords''' ==
== '''Keywords''' ==
Raspberry Pi 5, Raspberry Pi, 4G LTE, PCIe, mini PCIe, AT Commands
Raspberry Pi 5, Raspberry Pi, 4G LTE, PCIe, mini PCIe, AT Commands
第5行: 第7行:
The MPU4G is a 4G expansion board specifically designed for the Raspberry Pi 5. First, expand four USB 2.0 interfaces through the PCIe interface, then connect one of the USB 2.0 signals to the 4G module on the miniPCIe interface. The remaining three USB 2.0 interfaces are brought out in the form of a 1.25mm 4Pin connector. These three interfaces can be used to further expand 1-3 CM4-sized 4G modules. When expanding more than two 4G modules, please pay attention to the power supply. They can also be used to expand our temperature and humidity modules or GPS modules. The 4G modules included with the expansion board are driver-free and do not require dial-up. They are automatically recognized and plug-and-play under the Raspberry Pi official OS/Ubuntu, eliminating the need for additional driver installation. Their target applications include 4G access, multi-4G carrier aggregation, and remote unattended operation.
The MPU4G is a 4G expansion board specifically designed for the Raspberry Pi 5. First, expand four USB 2.0 interfaces through the PCIe interface, then connect one of the USB 2.0 signals to the 4G module on the miniPCIe interface. The remaining three USB 2.0 interfaces are brought out in the form of a 1.25mm 4Pin connector. These three interfaces can be used to further expand 1-3 CM4-sized 4G modules. When expanding more than two 4G modules, please pay attention to the power supply. They can also be used to expand our temperature and humidity modules or GPS modules. The 4G modules included with the expansion board are driver-free and do not require dial-up. They are automatically recognized and plug-and-play under the Raspberry Pi official OS/Ubuntu, eliminating the need for additional driver installation. Their target applications include 4G access, multi-4G carrier aggregation, and remote unattended operation.


The MiniPCIe 4G models are as follows: Domestic solution CAT4 4G and ZTE CAT4 4G, Quectel EC20 Voice GPS Lite version (with call and SMS functions), Qualcomm 4G, and Qualcomm 4G-GPS version. There are also international versions, such as the Qualcomm 4G European version (NL668-EU), Australian version (NL668-EAU), and North American version (NL668-AM), among others.
The MiniPCIe 4G models are as follows: Domestic solution CAT4 4G and ZTE CAT4 4G, Quectel EC20-GPS Voice Lite version (with call and SMS functions), Qualcomm 4G, and Qualcomm 4G-GPS version. There are also international versions, such as the Qualcomm 4G European version (NL668-EU), Australian version (NL668-EAU), and North American version (NL668-AM), among others.


http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_87.jpg
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_108.jpg


== '''II. Hardware Spec''' ==
== '''II. Hardware Spec''' ==
第48行: 第50行:
!
!
!CAT4
!CAT4
!高通4G/GPS
!Qualcomm 4G/GPS
!ZTE CAT4
!ZTE CAT4
!EC20-GPS简版
!EC20-GPS Voice lite version
|-
|-
|BAND
|BAND
第107行: 第109行:
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_28.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_28.jpg


Under normal conditions, the "4G" LED indicator on the expansion board flashes rapidly."
Under normal conditions, the "4G" LED indicator on the expansion board flashes rapidly.


=== 3.4 Quectel EC20 voice GPS L lite version ===
=== 3.4 Quectel EC20-GPS voice lite version ===
By executing <code>ifconfig -a</code> in the Raspberry Pi terminal, we can see that the 4G module (usb0) has successfully obtained an IP address.
By executing <code>ifconfig -a</code> in the Raspberry Pi terminal, we can see that the 4G module (usb0) has successfully obtained an IP address.


第129行: 第131行:
'''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.'''''
'''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.'''''


=== 3.6 '''Remote Connection to Raspberry Pi'''('''4G application''') ===
=== 3.6 Remote Connection to Raspberry Pi(4G application) ===
If you want to use 4G for remote access to a Raspberry Pi 5, the official Raspberry Pi OS (Bookworm version) comes with an example application called Raspberry Pi Connect that you can refer to and use. With the Raspberry Pi paired with 4G, and through the official remote control software Raspberry Pi Connect, you can securely access your Raspberry Pi from anywhere in the world. Here, we will demonstrate how to configure the remote connection service.
If you want to use 4G for remote access to a Raspberry Pi 5, the official Raspberry Pi OS (Bookworm version) comes with an example application called Raspberry Pi Connect that you can refer to and use. With the Raspberry Pi paired with 4G, and through the official remote control software Raspberry Pi Connect, you can securely access your Raspberry Pi from anywhere in the world. Here, we will demonstrate how to configure the remote connection service.


第154行: 第156行:
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_39.jpg
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_39.jpg


6. After successfully logging in, access <code><nowiki>https://connect.raspberrypi.com/</nowiki></code> in a browser on Windows and log in.
6. After successfully logging in, access https://connect.raspberrypi.com/ in a browser on Windows and log in.


http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_40.jpg
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_40.jpg
第172行: 第174行:
9. Measured data usage: Under remote desktop, the Raspberry Pi consumes about 2MB of data per minute; under The remote shell is as follows: line interface, the Raspberry Pi consumes about 100KB of data per minute.
9. Measured data usage: Under remote desktop, the Raspberry Pi consumes about 2MB of data per minute; under The remote shell is as follows: line interface, the Raspberry Pi consumes about 100KB of data per minute.


== '''四、Ubuntu OS的操作''' ==
== '''IV. Work with Ubuntu OS''' ==
Ubuntu OS:
Ubuntu OS:


第194行: 第196行:
When flashing the system, it is recommended to pre-configure the WiFi and SSH settings in the Raspberry Pi imager.
When flashing the system, it is recommended to pre-configure the WiFi and SSH settings in the Raspberry Pi imager.


http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_35.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_61.jpg


http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_36.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_62.jpg


Insert the TF card into the Raspberry Pi and boot up the system. The login username and password are the ones pre-configure; if not pre-configure, both are <code>ubuntu</code>, and you will be prompted to change the password after successful login.
Insert the TF card into the Raspberry Pi and boot up the system. The login username and password are the ones pre-configure; if not pre-configure, both are <code>ubuntu</code>, and you will be prompted to change the password after successful login.
第221行: 第223行:
Please edit the network card configuration file according to the image below:
Please edit the network card configuration file according to the image below:


http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_34.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_59.jpg


Save and exit, then reboot.
Save and exit, then reboot.
第231行: 第233行:
Once the net-tools package is installed, you can use the command <code>ifconfig -a</code> to check the network status.
Once the net-tools package is installed, you can use the command <code>ifconfig -a</code> to check the network status.


http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_47.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_60.jpg


It is evident that both the wired network card and the 4G module have obtained IP addresses at this point.
It is evident that both the wired network card and the 4G module have obtained IP addresses at this point.


"By <code>ping</code> an external server through a specific network card, we can verify whether the network card is functioning properly. For example, if we <code>ping</code> an external IP address and website using a 4G module, the results are as follows:"
By <code>ping</code> an external server through a specific network card, we can verify whether the network card is functioning properly. For example, if we <code>ping</code> an external IP address and website using a 4G module, the results are as follows:"


<code>ping 220.189.255.38 -I enx000c29a39b6d</code>
<code>ping 220.189.255.38 -I enx000c29a39b6d</code>
第295行: 第297行:
<code>at+csq</code>
<code>at+csq</code>


eturn values between 26 and 31 indicate a good signal, with 31 representing a full signal strength; return values between 20 and 25 indicate a barely acceptable signal; return values below 20 indicate a poor signal or that the antenna might not be connected.
Return values between 26 and 31 indicate a good signal, with 31 representing a full signal strength; return values between 20 and 25 indicate a barely acceptable signal; return values below 20 indicate a poor signal or that the antenna might not be connected.


3. Check network registration status:
3. Check network registration status:
第332行: 第334行:


=== 5.3 Modify the IP address of the 4G module ===
=== 5.3 Modify the IP address of the 4G module ===
如果出厂的4G IP地址和用户使用的IP地址有冲突,或有修改IP地址的需求,可按照下列步骤进行修改:
If the default 4G IP address assigned at the factory conflicts with the IP address being used by the user, or if there is a need to modify the IP address, you can change the 4G module's IP.
If the default 4G IP address assigned at the factory conflicts with the IP address being used by the user, or if there is a need to modify the IP address, you can change the 4G module's IP.


第387行: 第387行:
http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_70.jpg
http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_70.jpg


==== 5.4.2 EC20-GPS语音简版 ====
==== 5.4.2 Quectel EC20-GPS voice lite version ====


===== 5.4.2.1 GPS的操作 =====
===== 5.4.2.1 Operation of GPS =====
使用EC20的GPS,需要接GPS有源天线,且确保GPS天线甩出户外,GPS是通过AT命令操作。
To use the GPS function of EC20, you need to connect a GPS active antenna and ensure that the GPS antenna is extended outdoors. GPS is operated via AT commands.


开启ttyUSB串口。然后运行minicom,打开'''ttyUSB3'''串口:
Open '''ttyUSB3''' serial port by minicom:


<code>sudo minicom -D /dev/ttyUSB3</code>
<code>sudo minicom -D /dev/ttyUSB3</code>


并运行:
and execute:


<code>AT+QGPS=1</code>
<code>AT+QGPS=1</code>
第402行: 第402行:
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_63.jpg
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_63.jpg


运行minicom,打开'''ttyUSB1'''串口,即可获取GPS信息:
Open '''ttyUSB1''' serial port by minicom, and you can obtain GPS information:


<code>sudo minicom -D /dev/ttyUSB1</code>
<code>sudo minicom -D /dev/ttyUSB1</code>
第408行: 第408行:
http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_64.jpg
http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_64.jpg


如果觉得minicom下看原始的GPS信息不太直观,那么我们可以安装gpsd来提取GPS信息:
If you find the raw GPS data in minicom not very intuitive, we can install gpsd to extract the GPS information:


<code>sudo apt-get install gpsd gpsd-clients</code>
<code>sudo apt-get install gpsd gpsd-clients</code>
第414行: 第414行:
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_65.jpg
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_65.jpg


然后配置gpsd软件:
Then configure the gpsd software:


<code>sudo gpsd /dev/ttyUSB1 -N -D 9 -F /var/run/gpsd.sock -S 3333</code>
<code>sudo gpsd /dev/ttyUSB1 -N -D 9 -F /var/run/gpsd.sock -S 3333</code>
第420行: 第420行:
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_66.jpg
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_66.jpg


'''''注:3333为监听端口,可自行定义。'''''
'''''Note: 3333 is the listening port, which can be customized as needed.'''''


不要关掉配置终端窗口,另外开一个终端窗口,运行:
Do not close the configuration terminal window, instead, open a new terminal window and execute:


<code>cgps -s localhost:3333</code>
<code>cgps -s localhost:3333</code>
第428行: 第428行:
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_67.jpg
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_67.jpg


从输出的界面可以看到时间、经纬度、速度、高度等信息:
From the output interface, information such as time, latitude and longitude, speed, and altitude can be seen.


http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_68.jpg
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_68.jpg


===== 5.4.2.2 发短信操作 =====
===== 5.4.2.2 Send SMS =====
发短信是使用AT命令操作,这里介绍使用英文字符发送短信的流程。
Sending text messages involves using AT commands. Here, we will introduce the process of sending SMS using English characters.


按照章节5.1步骤,开启ttyUSB串口,然后运行<code>sudo minicom -s</code>,选择“Serial port setup”:
Follow the steps in section 5.1 to enable the ttyUSB serial port. Then execute <code>sudo minicom -s</code>, select "Serial port setup":


http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_100.jpg
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_100.jpg


按A和F ,修改串口号和流控如下图所示:
Press A and F to modify the serial port number and flow control as shown in the figure below:


http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_101.jpg
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_101.jpg


修改完毕后按回车返回上一层菜单,选择“Exit”退出:
After making the modifications, press Enter to return to the previous menu, and select "Exit" to quit:


http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_102.jpg
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_102.jpg


依次执行下列AT命令:
Execute the following AT commands in sequence:


<code>AT+CMGF=1</code> //将短信字符设置为英文
<code>AT+CMGF=1</code> //Set the SMS characters to English


<code>AT+CMGS="13xxxxxxxxx"</code> //设置接收短信的号码
<code>AT+CMGS="13xxxxxxxxx"</code> //Set the number to receive SMS messages


回车后在>后面输入短信内容,然后按Ctrl+Z发送,发送成功会显示“+CMGS 14”:
After pressing Enter, input the SMS content after the ">", then press Ctrl+Z to send. A successful send will display "+CMGS 14":


http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_103.jpg
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_103.jpg
第486行: 第486行:
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_106.jpg-->
http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_106.jpg-->


=== 5.5 关于网络策略的一些知识 ===
=== 5.5 Some knowledge about network policies ===
若您需要了解一些网络策略知识,可以参考如下链接:
If you need to learn about some network strategy knowledge, you can refer to the following link:


[[1001 RPi0 4G Cat1-ETH/RS485#3.2.2 网卡优先级的设置|如何设置网卡优先级]]
[[1001 RPi0 4G CAT1-ETH(RS485 OPT#3.2.2 Set network adapter priority|How to set network adapter priority]]


[[1001 RPi0 4G Cat1-ETH/RS485#3.2.3 利用udhcpc指定DNS服务器|利用udhcpc指定DNS服务器]]
[[1001 RPi0 4G CAT1-ETH(RS485 OPT#3.2.3 Using udhcpc to specify DNS servers|Using udhcpc to specify DNS servers]]


== '''六、OpenWrt的操作''' ==
== '''VI. Work with OpenWrt''' ==
我们测试用的OpenWrt系统版本为:openwrt-bcm27xx-bcm2712-rpi-5-squashfs-sysupgrade-linux-6.1.100-20240805.img.gz
The version of the OpenWrt we use for testing is: openwrt-bcm27xx-bcm2712-rpi-5-squashfs-sysupgrade-linux-6.1.100-20240805.img.gz


以高通4G模组为例,OpenWrt系统下可配置为一进一出的交换机模式,即4G可作为WAN口,树莓派5自身的网口配置为LAN口,用于连接PC。
Taking the Qualcomm 4G module as an example, in the OpenWrt, it can be configured in a one-in-one-out switch mode. This means the 4G can serve as the WAN port, while the Raspberry Pi 5's own Ethernet port can be configured as the LAN port for connecting to a PC.


=== 6.1 登录操作界面 ===
=== 6.1 Login operation interface ===
将树莓派5连接至PC网口,启动系统,在Windows设置中找到网络和Internet,在以太网中打开连接的网络查看默认网关的IP地址,这个地址就是OpenWrt系统的后台配置页面地址,如图所示,本文测试的地址为192.168.198.1:
Connect the Raspberry Pi 5 to the PC's Ethernet port, start the system, go to Network and Internet settings in Windows, open the connected network in Ethernet, and view the default gateway's IP address. This address is the backend configuration page address for the OpenWrt. As shown in the figure, the address tested in this article is 192.168.198.1:


http://www.mcuzone.com/wiki/0007_Zero_4G_Cat1/0007_Zero_4G_Cat1_18.jpg
http://www.mcuzone.com/wiki/0007_Zero_4G_Cat1/0007_Zero_4G_Cat1_18.jpg


然后打开网页浏览器输入192.168.198.1进入OpenWrt系统。默认用户名为<code>root</code>,默认密码为<code>password</code>
Then open your web browser, enter 192.168.198.1 to access the OpenWrt. The default username is <code>root</code>, and the default password is <code>password</code>.


http://www.mcuzone.com/wiki/0007_Zero_4G_Cat1/0007_Zero_4G_Cat1_19.jpg
http://www.mcuzone.com/wiki/0007_Zero_4G_Cat1/0007_Zero_4G_Cat1_19.jpg


登录后进入“系统 - TTYD终端”,使用用户名为<code>root</code>、密码为<code>password</code>进行登录:
After logging in, navigate to "System - TTYD Terminal", and log in using the username <code>root</code> and the password <code>password</code>.


http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_48.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_48.jpg


输入<code>ifconfig -a</code>,可以看到有标识为usb0的网卡,即为高通4G模组:
By entering <code>ifconfig -a</code>, you can see a network card labeled as usb0, which is the Qualcomm 4G module.


http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_49.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_49.jpg


若是国产CAT4或ZTE CAT4,系统识别成eth1,若是EC20也是识别成USB0,到时设置接口时,把usb0改成eth1即可。
If it is a CAT4 4G or ZTE CAT4, the system recognizes it as eth1. If it is an EC20, it is also recognized as usb0. When setting up the interface later, simply change usb0 to eth1.


=== 6.2 设置4G为WAN口 ===
=== 6.2 Set the 4G module as the WAN port ===
进入OpenWrt系统后,然后进入“网络 - 接口”,点击“添加新接口”:
After entering the OpenWrt, navigate to "Network - Interfaces" and click "Add new interface".


http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_12.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_12.jpg


新接口的设置如下图,其中”usb0“即为4G模块:
The setup of the new interface is as shown in the figure below, where "usb0" represents the 4G module.


http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_50.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_50.jpg


然后点击”提交“。
Then click "Submit".


在”防火墙设置“中,区域选择”wan“,然后点击”保存&应用“:
In the "Firewall Settings", select the "WAN", then click "Save & Apply".


http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_14.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_14.jpg


稍等片刻,我们在”网络 - 接口“中就能看到WAN口已经通过4G模块获得了IP:
Wait a moment, and we will see in the "Network - Interfaces" that the WAN port has already obtained an IP through the 4G module.


http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_15.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_15.jpg


此时我们在“系统 - TTYD终端”中,执行<code>ifconfig -a</code>,就能看到usb0已成功获取IP地址,ping公网地址也能成功,说明此时可以通过4G模块上网:
Now we click the "System - TTYD Terminal", by executing <code>ifconfig -a</code>, we can see that usb0 has successfully obtained an IP address, and pinging a public address is also successful. This indicates that we can now access the internet via the 4G module.


http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_16.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_16.jpg


同时我们可以在与树莓派相连的PC的网卡连接中,看到以太网的连接状态是Internet,表示此时PC也可以通过这个4G模组上网:
Meanwhile, we can observe in the network connection settings of the PC connected to the Raspberry Pi that the Ethernet connection status is labeled as "Internet", indicating that the PC can also access the internet through this 4G module at this time.


http://www.mcuzone.com/wiki/2003_CM4_Tiny_HDMIx2/2003_CM4_Tiny_HDMIx2_21.jpg
http://www.mcuzone.com/wiki/2003_CM4_Tiny_HDMIx2/2003_CM4_Tiny_HDMIx2_21.jpg


在PC端打开<nowiki/>https://www.speedtest.cn/<nowiki/>进行测速,此时流量走的是4G模块,测试结果如下:
Open https://www.speedtest.cn/ on your PC to conduct a speed test. At this point, the traffic is routed through the 4G module, and the test results are as follows:


http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_22.jpg
http://www.mcuzone.com/wiki/0020_MP4GM/0020_MP4GM_22.jpg


'''''注意:4G网络测速受网络信号和测试方法影响,速度请以实际为准。'''''
'''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.'''''


{{联系我们_图标}}
{{Contact_Us_icon}}

2025年3月3日 (一) 17:22的最新版本

切换语言为中文

Keywords

Raspberry Pi 5, Raspberry Pi, 4G LTE, PCIe, mini PCIe, AT Commands

I. Introduction

The MPU4G is a 4G expansion board specifically designed for the Raspberry Pi 5. First, expand four USB 2.0 interfaces through the PCIe interface, then connect one of the USB 2.0 signals to the 4G module on the miniPCIe interface. The remaining three USB 2.0 interfaces are brought out in the form of a 1.25mm 4Pin connector. These three interfaces can be used to further expand 1-3 CM4-sized 4G modules. When expanding more than two 4G modules, please pay attention to the power supply. They can also be used to expand our temperature and humidity modules or GPS modules. The 4G modules included with the expansion board are driver-free and do not require dial-up. They are automatically recognized and plug-and-play under the Raspberry Pi official OS/Ubuntu, eliminating the need for additional driver installation. Their target applications include 4G access, multi-4G carrier aggregation, and remote unattended operation.

The MiniPCIe 4G models are as follows: Domestic solution CAT4 4G and ZTE CAT4 4G, Quectel EC20-GPS Voice Lite version (with call and SMS functions), Qualcomm 4G, and Qualcomm 4G-GPS version. There are also international versions, such as the Qualcomm 4G European version (NL668-EU), Australian version (NL668-EAU), and North American version (NL668-AM), among others.

0024_MP4GUSB_108.jpg

II. Hardware Spec

1. One PCIe interface, 0.5mm 16P, used to connect to the Raspberry Pi 5's own PCIe interface, and PCIe expands to 4 USB ports.

2. One Mini PCIe 4G LTE interface.

3. One Nano SIM card slot, single SIM single standby.

4. Triple-channel USB 2.0 interface, 1.25mm-4P, can be used to expand 1-3 channels of 4G.

5. Two LED lights, one serving as the power indicator and the other as the 4G status light.

6. Reserve two 4G SMA antenna interfaces.

7. Reserve two 4G SMA antenna interfaces.

8. Size: 85*56mm. Fully compatible with the Raspberry Pi 5 in terms of size and mounting holes. The board features a grooved design that does not interfere with the GPIO of the Raspberry Pi 5.

9. Aluminum alloy casing(OPT.)

0020_MP4GM_51.jpg

0020_MP4GM_52.jpg

0020_MP4GM_53.jpg

0020_MP4GM_54.jpg

0020_MP4GM_55.jpg

0020_MP4GM_56.jpg

0020_MP4GM_57.jpg

0020_MP4GM_58.jpg

CAT4 Qualcomm 4G/GPS ZTE CAT4 EC20-GPS Voice lite version
BAND LTE FDD:B1/3/5/8

LTE TDD:B34/38/39/40/41

LTE FDD:B1/3/5/8

LTE TDD:B34/38/39/40/41

WCDMA:B1/8

TDSCDMA:B34/39

EVDO/CDMA1X:BC0

GSM/GPRS/EDGE:900/1800MHz(OPT)

LTE FDD:B1/3/5/8

LTE TDD:B34/38/39/40/41

LTE FDD:B1/3/5/8

LTE TDD:B34/38/39/40/41

WCDMA:B1/8

TDSCDMA:B34/39

CDMA:BC0

GSM:900/1800MHz

III. Work with Raspberry Pi OS

Raspberry Pi OS: 2024-07-04-raspios-bookworm-arm64.img.xz

You can download it in:

https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit

Different 4G models recognize different device models, usually as eth1 or usb0 devices.

3.1 Qualcomm 4G module

By executing ifconfig -a in the Raspberry Pi terminal, we can see that the 4G module (usb0) has successfully obtained an IP address.

0020_MP4GM_24.jpg

Under normal conditions, the "4G" LED indicator on the expansion board will blink slowly, with occasional brief fast flashes in between.

3.2 CAT4 4G module

By executing ifconfig -a in the Raspberry Pi terminal, we can see that the 4G module (eth1) has successfully obtained an IP address.

0020_MP4GM_26.jpg

Under normal conditions, the "4G" LED indicator on the expansion board will blink slowly (the duration of the light being on is longer than the duration of it being off).

3.3 ZTE CAT4 4G module

By executing ifconfig -a in the Raspberry Pi terminal, we can see that the 4G module (eth1) has successfully obtained an IP address.

0020_MP4GM_28.jpg

Under normal conditions, the "4G" LED indicator on the expansion board flashes rapidly.

3.4 Quectel EC20-GPS voice lite version

By executing ifconfig -a in the Raspberry Pi terminal, we can see that the 4G module (usb0) has successfully obtained an IP address.

0020_MP4GM_30.jpg

Under normal conditions, the "4G" LED indicator on the expansion board will blink slowly.

3.5 Internet test

After the 4G module successfully obtains an IP address, we can ping external network addresses, such as:

ping www.mcuzone.com

0020_MP4GM_18.jpg

It is also possible to connect to the external network via a 4G module and access a speed test website to measure the speed, with the results as follows:

0020_MP4GM_20.jpg

Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.

3.6 Remote Connection to Raspberry Pi(4G application)

If you want to use 4G for remote access to a Raspberry Pi 5, the official Raspberry Pi OS (Bookworm version) comes with an example application called Raspberry Pi Connect that you can refer to and use. With the Raspberry Pi paired with 4G, and through the official remote control software Raspberry Pi Connect, you can securely access your Raspberry Pi from anywhere in the world. Here, we will demonstrate how to configure the remote connection service.

The configuration and usage instructions are as follows:

1. Apply for a Raspberry Pi ID at https://id.raspberrypi.com/.

2. Install the Raspberry Pi Connect software in the Raspberry Pi OS (no need to install if it is already installed):

sudo apt install rpi-connect

3. Restart the system, and in the GUI, sequentially select the items as shown in the following image to ensure that Raspberry Pi Connect is turned on:

MPS2280iPoE_08.png

1002_Zero_4G_Cat1_13.jpg

4. In the upper right corner, there will be a Raspberry Pi Connect icon.

0024_MP4GUSB_38.jpg

5. Click on this icon, select "Sign in" and use your previously registered Raspberry Pi ID to log in on the pop-up webpage. Then set the device name.

0024_MP4GUSB_39.jpg

6. After successfully logging in, access https://connect.raspberrypi.com/ in a browser on Windows and log in.

0024_MP4GUSB_40.jpg

7. Click "Connect via" to choose between using Screen sharing or the Remote shell Interface.

0024_MP4GUSB_41.jpg

8. Screen sharing is as follows:

0024_MP4GUSB_73.jpg

The remote command line interface is as follows:

0024_MP4GUSB_43.jpg

9. Measured data usage: Under remote desktop, the Raspberry Pi consumes about 2MB of data per minute; under The remote shell is as follows: line interface, the Raspberry Pi consumes about 100KB of data per minute.

IV. Work with Ubuntu OS

Ubuntu OS:

ubuntu-24.04-preinstalled-desktop-arm64+raspi.img.xz(Desktop, GUI version)

ubuntu-24.04-preinstalled-server-arm64+raspi.img.xz(Server, command line version)

You can download it in:

https://ubuntu.com/download/raspberry-pi

4.1 Ubuntu Desktop OS

Ubuntu Desktop OS(GUI version). When executing ifconfig -a in the terminal, all 4G modules are recognized as network interfaces starting with enx, and they can be used directly without the need for drivers or additional configuration.

0020_MP4GM_44.jpg

4.2 Ubuntu Server OS

When the Ubuntu Server OS (command line version) is used on a Raspberry Pi 5, only one network interface is enabled by default, and the Wi-Fi functionality is disabled. So if you want to use 4G or WiFi, you need to enable the second and third network interfaces, and manually add a network card to use them. We will demonstrate the steps to enable Wi-Fi and use 4G on Ubuntu Server.

4.2.1 System flashing and setting up SSH

When flashing the system, it is recommended to pre-configure the WiFi and SSH settings in the Raspberry Pi imager.

0020_MP4GM_61.jpg

0020_MP4GM_62.jpg

Insert the TF card into the Raspberry Pi and boot up the system. The login username and password are the ones pre-configure; if not pre-configure, both are ubuntu, and you will be prompted to change the password after successful login.

0007_Zero_4G_Cat1_31.jpg

After the modifications are completed, it will automatically enter the system.

4.2.2 Configure system network

The operation here is demonstrated using CAT 4G as an example.

Note: The system does not come with the ifconfig tool by default, only the ip command is available.

Execute ip addr to view and record the network interface name.

0020_MP4GM_37.jpg

Among them, eth0 is the built-in Gigabit Ethernet port of the Raspberry Pi 5, enx000c29a39b6d is the 4G module, and wlan0 is the Raspberry Pi's own wireless network card (the system has been pre-configured with wireless hotspot information during the initial setup, so the wireless network card can be used immediately after booting).

Then run the following command to open the network card configuration file:

sudo nano /etc/netplan/50-cloud-init.yaml

Please edit the network card configuration file according to the image below:

0020_MP4GM_59.jpg

Save and exit, then reboot.

After rebooting, you can connect to the internet. Install the net-tools package for ease of use:

sudo apt install net-tools

Once the net-tools package is installed, you can use the command ifconfig -a to check the network status.

0020_MP4GM_60.jpg

It is evident that both the wired network card and the 4G module have obtained IP addresses at this point.

By ping an external server through a specific network card, we can verify whether the network card is functioning properly. For example, if we ping an external IP address and website using a 4G module, the results are as follows:"

ping 220.189.255.38 -I enx000c29a39b6d

ping www.mcuzone.com -I enx000c29a39b6d

0020_MP4GM_46.jpg

V. AT command operation

5.1 AT command operation

Taking Qualcomm 4G as an example, execute lsusb in terminal:

0020_MP4GM_23.jpg

Record the ID value of the 4G module: 05c6 90b6 (The ID number for each type of module varies; please refer to the actual details for accurate information.)

Use the following command to open the ttyUSB serial port, where the value after echo is the ID recorded above:

sudo modprobe option

sudo sh -c 'echo 05c6 90b6 > /sys/bus/usb-serial/drivers/option1/new_id'

0020_MP4GM_02.jpg

After executing the above two commands, proceed with:

ls /dev

At this point, you should be able to see three devices under the dev directory: ttyUSB0, ttyUSB1, and ttyUSB2:

0020_MP4GM_03.jpg

Install the serial port software minicom:

sudo apt install minicom

Then open the AT command serial port using minicom:

sudo minicom -D /dev/ttyUSB0

0020_MP4GM_04.jpg

(Note: The choice of which serial port to use should be based on the ability to input and run AT commands after entering this port, ensuring that the display is not garbled and the results do not jump erratically.)

The first time you enter an AT command, there may be no echo. If you then input the command at and press Enter, and it returns "OK," it indicates that everything is working properly. If you need to check the echo, please type the command: ate1, then press Enter. After that, you can continue to type other commands and press Enter to see the results.

0020_MP4GM_05.jpg

5.2 Common AT commands

1. Check if the SIM card is detected:

at+cpin?

Return ready to indicate the card has been recognized, if return error, you need to check the hardware.

2. Check antenna signal quality:

at+csq

Return values between 26 and 31 indicate a good signal, with 31 representing a full signal strength; return values between 20 and 25 indicate a barely acceptable signal; return values below 20 indicate a poor signal or that the antenna might not be connected.

3. Check network registration status:

at+cops?

Normally, it should return the network supporter's code: 7, where 7 represents 4G.

Note: The above command at+csq should not include a question mark, while the other two commands require a question mark.

4. View the SIM card's IMEI code:

at+cgsn

5. Reset 4G module (Sometimes, if you reinsert the SIM card, hot swapping may not work; in such cases, you can use this reset command to reset the module.):

at+reset

6. Disable radio frequency:

at+cfun=0

Enable radio frequency:

at+cfun=1

The two commands mentioned above can be used in pairs to allow the module to re-register with the network without restarting the 4G module.

7. APN settings:

The SIM card of a regular mobile phone can be used directly without any configuration. However, some IoT cards require APN settings to function properly, and the APN parameters are usually provided by the carrier.

0007_Zero_4G_Cat1_15.jpg

If you need the operation methods for other AT commands, please refer to the AT command manual provided with the 4G module (the operation commands may vary depending on the manufacturer).

5.3 Modify the IP address of the 4G module

If the default 4G IP address assigned at the factory conflicts with the IP address being used by the user, or if there is a need to modify the IP address, you can change the 4G module's IP.

1. CAT4 4G:

Execute the AT command:

AT+ROUTEIP=<newip>

Note: only addresses in the format of 192.168.x.1 are supported. If you set AT+ROUTEIP=192.168.3.1, the final IP address obtained will be 192.168.3.100. After making the changes, you need to power off and restart the OS.

Query current IP: AT+ROUTEIP?, it returns two values, the first one is the old IP, and the second one is the new IP.

Test command: AT+ROUTEIP=?

2. Qualcomm 4G, ZTE CAT4 4G:

Set the 4G module's IP to directly obtain a public IP. Please execute the AT command:

Set the IP to public: AT+GTIPPASS=1

Set the IP to private: AT+GTIPPASS=0

Check whether the current IP is a public or private IP: AT+GTIPPASS?

After modifying the IP, a power cycle reboot is required for the changes to take effect.

3. We are not know how to modify the IP address of EC20, If needed, users are required to research it themselves.

5.4 GPS test

5.4.1 Qualcomm 4G-GPS

To use the GPS function of Qualcomm 4G, you need to connect a GPS passive antenna and ensure that the GPS antenna is extended outdoors. GPS is operated via AT commands.

Follow the steps in section 5.1 to enable the ttyUSB serial port.

Run minicom and open the ttyUSB0 serial port.

sudo minicom -D /dev/ttyUSB0

And execute:

at+gtgpsepo=1 //Enable AGPS

at+gtgpspower=1 //Enable GPS

Please wait a moment for the positioning to succeed, then execute:

at+gtgps? //View NMEA messages

Then you can see the GPS information output:

0012_MPUUART_MP4232_70.jpg

5.4.2 Quectel EC20-GPS voice lite version

5.4.2.1 Operation of GPS

To use the GPS function of EC20, you need to connect a GPS active antenna and ensure that the GPS antenna is extended outdoors. GPS is operated via AT commands.

Open ttyUSB3 serial port by minicom:

sudo minicom -D /dev/ttyUSB3

and execute:

AT+QGPS=1

0024_MP4GUSB_63.jpg

Open ttyUSB1 serial port by minicom, and you can obtain GPS information:

sudo minicom -D /dev/ttyUSB1

5002_CM5_Basic_64.jpg

If you find the raw GPS data in minicom not very intuitive, we can install gpsd to extract the GPS information:

sudo apt-get install gpsd gpsd-clients

0024_MP4GUSB_65.jpg

Then configure the gpsd software:

sudo gpsd /dev/ttyUSB1 -N -D 9 -F /var/run/gpsd.sock -S 3333

0024_MP4GUSB_66.jpg

Note: 3333 is the listening port, which can be customized as needed.

Do not close the configuration terminal window, instead, open a new terminal window and execute:

cgps -s localhost:3333

0024_MP4GUSB_67.jpg

From the output interface, information such as time, latitude and longitude, speed, and altitude can be seen.

0024_MP4GUSB_68.jpg

5.4.2.2 Send SMS

Sending text messages involves using AT commands. Here, we will introduce the process of sending SMS using English characters.

Follow the steps in section 5.1 to enable the ttyUSB serial port. Then execute sudo minicom -s, select "Serial port setup":

0024_MP4GUSB_100.jpg

Press A and F to modify the serial port number and flow control as shown in the figure below:

0024_MP4GUSB_101.jpg

After making the modifications, press Enter to return to the previous menu, and select "Exit" to quit:

0024_MP4GUSB_102.jpg

Execute the following AT commands in sequence:

AT+CMGF=1 //Set the SMS characters to English

AT+CMGS="13xxxxxxxxx" //Set the number to receive SMS messages

After pressing Enter, input the SMS content after the ">", then press Ctrl+Z to send. A successful send will display "+CMGS 14":

0024_MP4GUSB_103.jpg

0024_MP4GUSB_104.jpg

5.5 Some knowledge about network policies

If you need to learn about some network strategy knowledge, you can refer to the following link:

How to set network adapter priority

Using udhcpc to specify DNS servers

VI. Work with OpenWrt

The version of the OpenWrt we use for testing is: openwrt-bcm27xx-bcm2712-rpi-5-squashfs-sysupgrade-linux-6.1.100-20240805.img.gz

Taking the Qualcomm 4G module as an example, in the OpenWrt, it can be configured in a one-in-one-out switch mode. This means the 4G can serve as the WAN port, while the Raspberry Pi 5's own Ethernet port can be configured as the LAN port for connecting to a PC.

6.1 Login operation interface

Connect the Raspberry Pi 5 to the PC's Ethernet port, start the system, go to Network and Internet settings in Windows, open the connected network in Ethernet, and view the default gateway's IP address. This address is the backend configuration page address for the OpenWrt. As shown in the figure, the address tested in this article is 192.168.198.1:

0007_Zero_4G_Cat1_18.jpg

Then open your web browser, enter 192.168.198.1 to access the OpenWrt. The default username is root, and the default password is password.

0007_Zero_4G_Cat1_19.jpg

After logging in, navigate to "System - TTYD Terminal", and log in using the username root and the password password.

0020_MP4GM_48.jpg

By entering ifconfig -a, you can see a network card labeled as usb0, which is the Qualcomm 4G module.

0020_MP4GM_49.jpg

If it is a CAT4 4G or ZTE CAT4, the system recognizes it as eth1. If it is an EC20, it is also recognized as usb0. When setting up the interface later, simply change usb0 to eth1.

6.2 Set the 4G module as the WAN port

After entering the OpenWrt, navigate to "Network - Interfaces" and click "Add new interface".

0020_MP4GM_12.jpg

The setup of the new interface is as shown in the figure below, where "usb0" represents the 4G module.

0020_MP4GM_50.jpg

Then click "Submit".

In the "Firewall Settings", select the "WAN", then click "Save & Apply".

0020_MP4GM_14.jpg

Wait a moment, and we will see in the "Network - Interfaces" that the WAN port has already obtained an IP through the 4G module.

0020_MP4GM_15.jpg

Now we click the "System - TTYD Terminal", by executing ifconfig -a, we can see that usb0 has successfully obtained an IP address, and pinging a public address is also successful. This indicates that we can now access the internet via the 4G module.

0020_MP4GM_16.jpg

Meanwhile, we can observe in the network connection settings of the PC connected to the Raspberry Pi that the Ethernet connection status is labeled as "Internet", indicating that the PC can also access the internet through this 4G module at this time.

2003_CM4_Tiny_HDMIx2_21.jpg

Open https://www.speedtest.cn/ on your PC to conduct a speed test. At this point, the traffic is routed through the 4G module, and the test results are as follows:

0020_MP4GM_22.jpg

Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.

Contact Us

0001_x.jpg 0002_fb.jpg 0004_ytb.jpg 0003_bb.jpg 0005_qq.jpg QQ:8204136

Email: mcuzone@vip.qq.com

Tel: +86(0)13957118045

If there are any omissions, errors, or infringements on this page, please contact us through the above methods. Thank you!

Copyright 2004-2025 Wildchip