1002 RPi0 4G Cat1 (EN):修订间差异

来自Mcuzone Wiki
(创建页面,内容为“== '''关键词''' == 树莓派Raspberry Pi Zero、Zero 2W、Cat1 4G LTE、USB2.0、USB Type-C、扩展板、Nano SIM、eSIM、RPi-Connect、远程连接、免驱即插即用 == '''一、简介''' == 树莓派Zero CAT1是一款尺寸只有65*30mm的4G LTE扩展板,基于树莓派Zero系列(包括Zero、Zero W(H)以及Zero 2W)尺寸设计,利用树莓派Zero板子反面引出的USB和电源的镀金测试点,进行外设扩展。扩展板分USB版和…”)
 
 
(未显示2个用户的25个中间版本)
第1行: 第1行:
== '''关键词''' ==
[[1002 RPi0 4G Cat1|切换语言为中文]]
树莓派Raspberry Pi Zero、Zero 2W、Cat1 4G LTE、USB2.0、USB Type-C、扩展板、Nano SIM、eSIM、RPi-Connect、远程连接、免驱即插即用


== '''一、简介''' ==
== '''Keywords''' ==
树莓派Zero CAT1是一款尺寸只有65*30mm的4G LTE扩展板,基于树莓派Zero系列(包括Zero、Zero W(H)以及Zero 2W)尺寸设计,利用树莓派Zero板子反面引出的USB和电源的镀金测试点,进行外设扩展。扩展板分USB版和顶针版两个版本,其中顶针版是通过顶针将扩展板和Zero的USB口连接起来,此时无法再通过树莓派Zero的microUSB外接键盘鼠标等USB设备,而我们可以通过远程界面来控制本设备。USB版(不焊接顶针)可以用于树莓派3B、4B和5上,扩展板采用内凹设计,方便安装在树莓派3B/4B/5等板子上方的时候,不影响或尽量少影响40Pin引脚的外接。
Raspberry Pi Zero, Zero 2W, Cat1 4G LTE Expansion board, Nano SIM, RPi-Connect, Remote connection, Driver-free, Plug and play


4G Cat1是针对10Mbps左右的中速物联网应用的高性价比模组,10Mbps下行5Mbps上行的速率可以满足绝大多数联网和传输需求;4G全网通,支持联通、电信和移动。CAT1扩展板在树莓派官方OS下免驱,即插即用。
== '''I. Introduction''' ==
The Raspberry Pi Zero CAT1 is a 4G LTE expansion board measuring only 65*30mm in size. It is designed based on the Raspberry Pi Zero series (including the Zero, Zero W(H), and Zero 2W). It utilizes the gold-plated test points on the backside of the Raspberry Pi Zero board for USB and power to enable peripheral expansion.


== '''二、硬件资源''' ==
The expansion board comes in two versions: the USB version and the Probe version. The Probe version connects the expansion board to the Zero's USB port via pogo pins. In this case, it is no longer possible to connect USB devices such as keyboard or mouse to the Raspberry Pi Zero's micro USB port. but we can control the device through a remote connection. The USB version (without pogo pins) can be used with the Raspberry Pi 3B, 4B, and 5. The expansion board uses a recessed design, which facilitates installation on top of boards like the Raspberry Pi 3B/4B/5, ensuring it does not affect or minimally affects the external connections of the 40-pin header.
1. 本扩展板'''顶针版'''通过4个顶针和树莓派Zero系列通过镀金顶针连接,扩展板位于Zero下方,通过Zero的MicroUSB电源口供电,'''''此时树莓派Zero自身的micro USB口以及板载USB-C口和1.25mm 4P接口都不能外接任何设备或电源'''''。


2. '''USB版本(不焊接顶针)'''通过USB口和开发板通讯及供电,USB口采用Type-C口和1.25mm 4P接口两种形式引出,二选一使用;
4G Cat1 is a cost-effective module designed for medium-speed IoT applications around 10Mbps. The 10Mbps downlink and 5Mbps uplink speeds can meet the vast majority of networking and transmission needs. The CAT1 expansion board is driver-free and plug-and-play under the official Raspberry Pi operating system.


3. 采用Nano SIM卡座,并预留eSIM芯片位置(SIM卡和eSIM芯片二选一),SIM插入朝向请参考板上丝印或SIM卡座印痕。
'''''(To use the 4G module, the band supported by your local service provider must match the parameters of the 4G module. Therefore, please verify whether this 4G module is suitable for your area before making a purchase.)'''''


4. 4G天线接口采用IPEX一代接口,可接4G FPC天线或棒状天线。
== '''II. Hardware Spec''' ==
1. The '''Probe''' version connects to the Raspberry Pi Zero series' pogo pins to achieve power supply and communication.   


5. 引出调试串口和AT主串口,3.3V电平。
Powered through the Zero's MicroUSB power port. '''''At this point, the Raspberry Pi Zero's own micro USB, the onboard USB-C port, and the 1.25mm 4-pin interface cannot be used to connect any external devices or power sources.'''''


6. 两个LED指示灯,其中STAT灯亮表示CAT1正常运行;NET用于指示网络状态,1.8秒亮0.2秒灭表示注网成功,1.8秒灭0.2秒亮表示未注网,需要检查SIM卡和天线。
2. The '''USB''' version (without soldering pogo pins)


7. 反面预留BOOT和复位的按键位置,如有升级固件需要或者按键复位需要可自行焊接。
Power supply:5V input,USB-C or 1.25mm 4-pin USB, choose one of the two options to use..


8. 尺寸:65*30*5.5mm;
3. One 4G CAT1 LTE and a Nano SIM card slot;


9. M2.5mm固定孔和树莓派Zero开发板完全吻合。PCB板通过UL和ROHS认证,防火等级94V-0。
4. One IPEX 1 connector.
 
5. Debug Serial Port and AT main serial port: 2.54mm-3Pin,both at 3.3V voltage level.
 
6. Two LEDs:
 
::One STAT LED:CAT1 is functioning normally.
 
::One NET LED: 1.8 seconds on and 0.2 seconds off indicating successful network registration.
::1.8 seconds off and 0.2 seconds on indicating that the device has not registered onto the network, suggesting that the SIM card and antenna should be checked.
 
7. The reserved BooT and reset button is on the back side reverse side.
 
(If there is a need to perform a button reset, you can solder the buttons yourself.)
 
8. Size: 65*30*6.6mm;M2.5mm mounting holes.
 
9. PCB: UL and ROHS certification, fire protection rating of 94V-0.


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_21.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_21.jpg
第30行: 第47行:
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_22.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_22.jpg


== '''三、树莓派OS的操作''' ==
== '''III. Work with Raspberry Pi OS''' ==


=== 3.1 USB版 ===
=== 3.1 USB version ===
USB版若接树莓派Zero系列开发板,一般需要再搭配带USB接口的扩展板使用,所以只要在config.txt里面启用USB Host模式即可;
If connecting to a Raspberry Pi Zero series board, it generally requires the use of an expansion board with a USB interface. So you just need to enable USB Host mode in the config.txt file.


此处我们是基于我司树莓派Zero双网口扩展板组装好树莓派Zero 2W后,再接CAT1-USB版;
Here, we are assembling the Raspberry Pi Zero 2W using our company's [[1005 RPi0-2U2E(双百兆网络双USB)|RPi0_2U2E Board]], and then connecting the USB version.


CAT1-USB版占用Zero双网口扩展板(下图)右侧USB-A口,此USB口不能外接任何设备,不然4G将无法使用:
The USB version occupies the right-side [[1005 RPi0-2U2E(双百兆网络双USB)|RPi0_2U2E Board]] (as shown in the image below). This USB port cannot be used to connect any external devices; otherwise, the 4G functionality will not work.


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_12.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_12.jpg


启动系统后,执行<code>ifconfig -a</code>,可以看到eth2,即为4G CAT1;而eth0和eth1是双网口扩展板上的2个百兆网口:
After booting the system, execute <code>ifconfig -a</code>, and you will see eth2, which corresponds to the 4G CAT1 interface; while eth0 and eth1 are the two 100Mbps Ethernet ports on the [[1005 RPi0-2U2E(双百兆网络双USB)|RPi0_2U2E Board]].


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_14.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_14.jpg
=== 3.2 顶针版 ===


==== 3.2.1 准备工作 ====
=== 3.2 Probe version ===
Zero 2W的自身只有一个USB口,现被4G占用,因此无键盘鼠标可用,后续操作只能通过WiFi或者4G联网进行,所以在烧写时需要对系统进行预设置,配置WiFi并使能SSH才能进一步使用(如果您是用树莓派ZeroW或Zero WH,使用方法一样)。


如果您是使用树莓派Zero,因为没有WiFi功能,那只能先在其它扩展板上调试完成所有业务逻辑并设置成开机自运行,4G Cat1仅用于提供网络接入,后续无其它USB设备外接需求,否则建议使用USB版本。
==== 3.2.1 Preparation ====
The Raspberry Pi Zero 2W has only one USB port, which is now occupied by the 4G module, so there are no USB ports available for a keyboard or mouse. Subsequent operations can only be performed through a WiFi or 4G connection. Therefore, when flashing the system, you need to pre-configure it to set up WiFi and enable SSH to proceed further (if you are using a Raspberry Pi Zero W or Zero WH, the usage method is the same).


硬件:供电请插到Zero 2W标注PWR的USB电源口,如果插到另外一个USB口或者扩展板上的USB口,都会造成4G模块被屏蔽。
If you are using the Raspberry Pi Zero, which lacks WiFi functionality, you would need to debug all business logic and set it up to run on startup on another expansion board. If you do not have any subsequent need to connect other USB devices and the 4G Cat1 is only used to provide network access, you can use the Probe version. Otherwise, it is recommended to use the USB version.


接线示意图:
Hardware: Please plug the power supply into the USB power port marked "PWR" on the Zero 2W. If you plug it into another USB port or the USB port on the expansion board, it will cause the 4G module to be shielded.
 
Wiring diagram:


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_20.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_20.jpg


系统: 镜像为2024-07-04-raspios-bookworm-arm64.img.xz(树莓派OS,Raspberry Pi OS with desktop)。
The version of the Raspberry Pi OS is: 2024-07-04-raspios-bookworm-arm64.img.xz


(若使用树莓派Zero一代系列的板子,只支持32位系统,请注意下载版本。)
You can download the Raspberry Pi OS in:


树莓派OS下载地址:
https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit


https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit
(If using the first-generation Raspberry Pi Zero board, which only supports 32-bit systems, please pay attention to the version you download.)


==== 3.2.2 烧录系统(需对WiFi连接及SSH服务的设置) ====
==== 3.2.2 Flashing system (Setup required for WiFi connection and SSH service) ====
打开树莓派镜像烧录器,选择完设备平台、镜像和烧录位置后,点击”NEXT“:
Open the Imager, select the “Raspberry Pi Device”, “Choose Use Custom”, and “Storge”, then click "NEXT."


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_01.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_01.jpg


然后点击”编辑设置“
Then click "Edit Settings" :


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_02.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_02.jpg


在弹出的窗口中,GENERAL页面中,可以主机名、用户名和密码、默认连接的WiFi、区域:
In the pop-up window, under the GENERAL tab, you can set the hostname, username, and password, the default WiFi connection, and the region:


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_03.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_03.jpg


在SERVICES页面中,请设置开启SSH服务:
Under the SERVICES tab, please set up to enable the SSH service:


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_04.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_04.jpg


设置完成后点击”保存“,返回上一层页面,然后点击”是“:
After completing the settings, click "Save," return to the previous page, and then click "Yes":


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_05.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_05.jpg


在警告窗口中点击”是“
Click "Yes" in the warning window:


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_06.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_06.jpg


这样就开始了烧写,烧写完毕后使用该TF卡启动系统,系统使用预设的用户名和密码自动登录,并自动连接至预设的WiFi(需在该WiFi热点覆盖范围内)。
This will start the burning process. After the burning is complete, use this TF card to boot the system. The system will automatically log in with the preset username and password and connect to the preconfigured WiFi (provided the device is within range of the WiFi hotspot).


如果系统卡在树莓派logo处无法启动:
If the system stop at the Raspberry Pi logo and fails to boot:


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


请仔细观察顶针是否对准了镀金触点,并请在PC端打开TF卡系统分区根目录下的config.txt检查USB的初始化脚本:
Please carefully check whether the pogo pins are aligned with the gold-plated contacts. Additionally, on the PC, open the <code>config.txt</code> file located in the root directory of the TF card to check the USB initialization script:


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


需要确认下图中的三处红框的位置是否都配置成完全,如果没有,请手动添加完整并保存文件:
You need to confirm that the three red-boxed areas in the following image are all configured completely. If not, please manually add the missing parts and save the file:


<code># otg_mode=1</code>(建议按此注释掉)
<code># otg_mode=1</code> (It is recommended to comment out as follow)


<code>dtoverlay=dwc2,dr_mode=host</code>(两处必须确保加上)
<code>dtoverlay=dwc2,dr_mode=host</code> (These two areas must be ensured to be included.)


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


==== 3.2.3 通过WiFi进行SSH控制 ====
==== 3.2.3 Control via SSH through WiFi ====
系统启动后,如果WiFi连接成功,会在桌面右上角WiFi图标下面显示内网连接IP:
After the system starts, if the WiFi connection is successful, the internal network IP will be displayed below the WiFi icon in the top right corner of the desktop:


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_07.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_07.jpg


也可以通过查看路由器后台来获得系统内网IP:
You can also obtain the system's internal IP address by checking the router's backend:


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


此处使用MobaXterm软件进行SSH,MobaXterm软件下载地址:
Here, we use the MobaXterm for SSH. The download link for MobaXterm is:


https://mobaxterm.mobatek.net/download-home-edition.html
https://mobaxterm.mobatek.net/download-home-edition.html


打开MobaXterm软件,新建一个连接,选择SSH,Remote Host填入树莓派OS的IP,Specify username填入登录账号,如下图所示:
Open the MobaXterm, create a new connection, select SSH, enter the IP address of the Raspberry Pi OS in the "Remote Host", and enter the login username in the "Specify username", as shown in the following figure:http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_08.jpg


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_08.jpg
Click "OK," then log in. After logging in, we can perform command-line operations on the Raspberry Pi Zero 2W using MobaXterm:


点击”OK“,然后登录,登录完成后,我们即可通过MobaXterm对树莓派Zero2W进行命令行操作:
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_23.jpg


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_23.jpg




此时,我们查看4G模块的连接情况:
Now we check the connection status of the 4G module:


<code>lsusb</code>
<code>lsusb</code>
第136行: 第153行:
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_24.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_24.jpg


可见4G模块已连接。
It can be seen that the 4G module has connected.


使用ifconfig -a查看网络,可见4G模块为eth0,已经获得了IP:
Using <code>ifconfig -a</code> to check the network interfaces, it can be seen that the 4G module is identified as eth0 and has obtained an IP address:


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_25.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_25.jpg


==== 3.2.4 使用AT命令 ====
==== 3.2.4 How to use AT commands ====
在SSH终端中执行命令:
Execute the command in the SSH terminal:


<code>ls /dev</code>
<code>ls /dev</code>


此时应该能看到dev设备下有ttyACM0-2三个设备:
You should be able to see three devices named ttyACM0, ttyACM1, and ttyACM2 under the dev directory:


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_27.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_27.jpg


下载安装minicom工具:
Install minicom:


<code>sudo apt-get install minicom</code>
<code>sudo apt-get install minicom</code>
第157行: 第174行:
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_28.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_28.jpg


通过minicom打开AT命令串口:
Open AT Command serial port by minicom:


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


注意,使用哪个串口,应以在进入此串口后,可输入运行AT命令,显示不乱码,不乱跳结果为准。
Note: When using a serial port, ensure that after entering this port, you can input and run AT commands without any garbled output or unexpected jumps in the results.


下面以minicom为例,
The following uses minicom as an example:


如果需要查看回显,请键入命令:<code>ate1</code>,然后回车,继续键入其它命令,回车可以看到结果。
Then directly type the AT command and press Enter to see the result. If you need to view the echo, please type the command: <code>ate1</code>


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_29.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_29.jpg


常用AT命令:
Common AT commands:


1. 检查SIM卡是否识别到:
1) Check if the SIM card is detected:


<code>at+cpin?</code>
<code>at+cpin?</code>


返回ready表示卡已识别,返回error要检查硬件
Return ready to indicate the card has been recognized, if return error, you need to check the hardware.


2. 检查天线信号质量:
2) Check antenna signal quality:


<code>at+csq</code>
<code>at+csq</code>


返回值在26-31表示信号OK,信号满格31;返回值在20-25表示信号勉勉强强;返回值在20以下表示信号比较糟糕或者天线没接
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. 检查注网情况:
3) Check network registration status:


<code>at+cops?</code>
<code>at+cops?</code>


正常应该返回运营商代码和7,7代表4G。
Normally, it should return the network supporter's code: 7, where 7 represents 4G.


注意,以上命令只有<code>at+csq</code>不要加问号,另外两条命令需要加问号。
Note: The above command <code>at+csq</code> should not include a question mark, while the other two commands require a question mark.


4. 查看4G模块的IMEI码:
4) View the SIM card's IMEI code:


<code>at+cgsn</code>
<code>at+cgsn</code>


5. 重启4G模块(有时候如果重插SIM卡,热插拔不一定管用,可以用这个reset命令来复位模块):
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.):


<code>at+reset</code>
<code>at+reset</code>


6. 关闭射频:
6) Disable radio frequency:


<code>at+cfun=0</code>
<code>at+cfun=0</code>


开启射频:
Enable radio frequency:


<code>at+cfun=1</code>
<code>at+cfun=1</code>


上述两条命令成对使用,可以在不重启4G模组的情况下让模组重新注网。
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.
 
==== 3.2.5 Enable SIM card hot-swapping ====
This expansion board supports SIM card hot-swapping, but this feature is disabled by default. To enable it, first remove the SIM card, and then open the AT command serial port:
 
<code>sudo minicom -D /dev/ttyACM0</code>
 
Execute:


== '''四、4G的应用(远程控制)''' ==
<code>at+csdt=1</code>
RPi-Connect提供了从任何地方安全接入到树莓派的服务。基于此服务,搭配Zero_Cat1_4G顶针版即可实现在户外没有无线网络的情况下,依旧可以远程访问树莓派操作。注意:要使用此服务必须运行Bookworm及以上系统。同时,只有树莓派5,4或400可以使用屏幕分享。Zero2W只能使用Remote shell。接下来演示如何配置远程连接服务。


=== 4.1 安装DNS服务(仅限2024.07.04及之后的系统版本) ===
If the output is "OK," it indicates that the setting was successful.
4G CAT1模块是免驱的,在每次开机就可以实现4G自动连接,但是为了不引起DNS服务器冲突,还需要对开机自启动进行如下设置:


安装切换DNS服务器的软件udhcpc:
You can use <code>AT+CSDT?</code> to check the current status. A return value of <code>1</code> indicates that the SIM card hot-swapping feature has been enabled.
 
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_33.jpg
 
After hot-swapping the SIM card, execute the following commands separately. If all commands are successful (with <code>eth0</code> being the 4G module), it confirms that hot-swapping is supported:
 
<code>sudo udhcpc -i eth0</code>
 
<code>ping www.mcuzone.com -I eth0</code>
 
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_34.jpg
 
== '''IV. 4G Application (Remote Control)''' ==
RPi-Connect provides a service for secure access to your Raspberry Pi from anywhere. With this service, combined with the Zero Cat1 4G Probe version, you can still remotely access your Raspberry Pi even when outdoors without a Wi-Fi network. Note: To use this service, Bookworm or a newer system must be running. Additionally, only the Raspberry Pi 5, 4, or 400 can use screen sharing. The Zero 2W can only use Remote Shell. The following demonstrates how to configure the remote connection service.
 
=== 4.1 Install DNS service (only for system version 2024.07.04 and later) ===
The 4G CAT1 module is driver-free and can achieve automatic 4G connectivity at each boot. However, to avoid DNS server conflicts, the following settings need to be applied for automatic startup:
 
Install the DNS server switching software udhcpc:


<code>sudo apt install udhcpc</code>
<code>sudo apt install udhcpc</code>
第221行: 第261行:
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_18.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_18.jpg


开启rc-local服务:
Open rc-local service:


<code>sudo sudo systemctl enable --now rc-local</code>
<code>sudo sudo systemctl enable --now rc-local</code>


通过下面的命令打开rc.local:
Use the following command to open rc.local:


<code>sudo nano /etc/rc.local</code>
<code>sudo nano /etc/rc.local</code>


在exit 0上面添加你要开机执行的命令,然后保存文件(本示例中eth0代表4G模块,名称以实际为准):
Add the command you want to execute at startup above the line <code>exit 0</code>, and then save the file (in this example, eth0 represents the 4G module, but the name should match the actual interface identified on your system):


<code>sleep 5 && sudo udhcpc -i eth0 && sleep 5 && sudo udhcpc -i eth0 && sleep 5 && sudo udhcpc -i eth0</code>
<code>sleep 5 && sudo udhcpc -i eth0 && sleep 5 && sudo udhcpc -i eth0 && sleep 5 && sudo udhcpc -i eth0</code>
第235行: 第275行:
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_23.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_23.jpg


sleep命令的作用是延迟多少秒执行之后的命令,因为4G模块获取IP地址需要一定的时间,所以为了防止udhcpc执行失败,需要多执行几次,并且在每一次执行命令之间加上一定的延迟。这样执行的结果,是等系统启动后,大约20秒左右可以使用4G网络。
The <code>sleep</code> command is used to delay the execution of subsequent commands by a certain number of seconds. Since the 4G module needs some time to acquire an IP address, to prevent `udhcpc` from failing, it needs to be executed several times with a delay added between each execution. As a result, the 4G network becomes usable approximately 20 seconds after the system boots up.


=== 4.2 申请Raspberry Pi ID ===
=== 4.2 Apply for a Raspberry Pi ID ===
如果已有Raspberry Pi ID请直接登录,如果没有请按下列步骤申请。
If you already have a Raspberry Pi ID, please log in directly. If not, please follow the steps below to apply.


打开在<nowiki/>https://id.raspberrypi.com/<nowiki/>,输入您要使用的邮箱以及密码:
Open the website at https://id.raspberrypi.com/, and enter the email address and password you wish to use:


http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_12.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_12.jpg


创建账号完成后需要进入邮箱验证:
After creating the account, you need to verify it by entering your email:


http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_13.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_13.jpg
第250行: 第290行:
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_14.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_14.jpg


验证完成后即可使用该id。
After verification is complete, the ID can be used.


=== 4.3 安装远程服务 ===
=== 4.3 Install Remote Service ===
打开SSH终端,安装Raspberry Pi Connect软件,如果安装时显示已安装则不需另外安装:
Open the SSH terminal and install the Raspberry Pi Connect software. If the installation command indicates that it is already installed, then no additional installation is necessary:


<code>sudo apt install rpi-connect</code>
<code>sudo apt install rpi-connect</code>


安装完成后,我们在终端输入<code>loginctl enable-linger</code>确保每次重启后系统自动打开远程服务。
After installation, we enter <code>loginctl enable-linger</code> in the terminal to ensure that the remote service is automatically enabled each time the system restarts:


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_32.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_32.jpg


重启系统,在图形界面中,依次选择如下图项目后,确保Raspberry Pi Connect已打开:
Restart the system. In the graphical interface, select the items in the order shown in the following image to ensure that Raspberry Pi Connect is turned on:


http://www.mcuzone.com/wiki/0002_MPS2280iPoE/MPS2280iPoE_08.png
http://www.mcuzone.com/wiki/0002_MPS2280iPoE/MPS2280iPoE_08.png
第267行: 第307行:
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_13.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_13.jpg


然后在树莓派终端输入:
Then enter the following in the Raspberry Pi terminal:


<code>rpi-connect signin</code>
<code>rpi-connect signin</code>
第273行: 第313行:
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_30.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_30.jpg


此时显示一个网址,如上图所示,我们在浏览器(建议使用别的电脑,Zero系列因为硬件资源关系,打开浏览器时非常缓慢)中打开这个网址:
Now, a URL is displayed, as shown in the image above. Open this URL in a browser (it is recommended to use another computer, as the Zero series can be very slow when opening a browser due to hardware limitations).


http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_17.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_17.jpg


点击Sign in,按照提示进行绑定即可,首先需要设置设备名称:
Click on "Sign in" and follow the prompts to bind the device. First, you need to set the device name:


http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_18.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_18.jpg


点击Create device and sign in:
Click "Create device and sign in":


http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_19.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_19.jpg


这样就完成了绑定,终端中也会有成功的显示:
This completes the binding process, and there will also be a successful message displayed in the terminal:


http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_31.jpg
http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_31.jpg


=== 4.4 使用远程控制 ===
=== 4.4 Use remote control ===
在PC上打开:<code><nowiki>https://connect.raspberrypi.com/devices</nowiki></code>
On your PC, open: <code><nowiki>https://connect.raspberrypi.com/devices</nowiki></code>http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_21.jpg
 
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_21.jpg


刚才添加的Zero 2W设备下面只有”Remote shell“字样,表示此设备只能通过远程命令行界面控制。
The Zero 2W device just added only shows "Remote shell", indicating that this device can only be controlled through a remote command-line interface.


点击Connect,弹出远程命令行界面,即可输入命令:
Click on "Connect" to open the remote command-line interface, where you can then enter commands:


http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_22.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_22.jpg


配置完毕后,可以使系统每次启动时都能通过4G上网,并开启Raspberry Pi Connect远程服务,我们就可以在PC上通过远程命令行界面控制设备。
After configuration is complete, the system will be able to connect to the internet via 4G each time it boots up and will also enable the Raspberry Pi Connect remote service. This way, we can control the device through a remote command-line interface from a PC.


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

2024年11月15日 (五) 13:09的最新版本

切换语言为中文

Keywords

Raspberry Pi Zero, Zero 2W, Cat1 4G LTE Expansion board, Nano SIM, RPi-Connect, Remote connection, Driver-free, Plug and play

I. Introduction

The Raspberry Pi Zero CAT1 is a 4G LTE expansion board measuring only 65*30mm in size. It is designed based on the Raspberry Pi Zero series (including the Zero, Zero W(H), and Zero 2W). It utilizes the gold-plated test points on the backside of the Raspberry Pi Zero board for USB and power to enable peripheral expansion.

The expansion board comes in two versions: the USB version and the Probe version. The Probe version connects the expansion board to the Zero's USB port via pogo pins. In this case, it is no longer possible to connect USB devices such as keyboard or mouse to the Raspberry Pi Zero's micro USB port. but we can control the device through a remote connection. The USB version (without pogo pins) can be used with the Raspberry Pi 3B, 4B, and 5. The expansion board uses a recessed design, which facilitates installation on top of boards like the Raspberry Pi 3B/4B/5, ensuring it does not affect or minimally affects the external connections of the 40-pin header.

4G Cat1 is a cost-effective module designed for medium-speed IoT applications around 10Mbps. The 10Mbps downlink and 5Mbps uplink speeds can meet the vast majority of networking and transmission needs. The CAT1 expansion board is driver-free and plug-and-play under the official Raspberry Pi operating system.

(To use the 4G module, the band supported by your local service provider must match the parameters of the 4G module. Therefore, please verify whether this 4G module is suitable for your area before making a purchase.)

II. Hardware Spec

1. The Probe version connects to the Raspberry Pi Zero series' pogo pins to achieve power supply and communication.

Powered through the Zero's MicroUSB power port. At this point, the Raspberry Pi Zero's own micro USB, the onboard USB-C port, and the 1.25mm 4-pin interface cannot be used to connect any external devices or power sources.

2. The USB version (without soldering pogo pins)

Power supply:5V input,USB-C or 1.25mm 4-pin USB, choose one of the two options to use..

3. One 4G CAT1 LTE and a Nano SIM card slot;

4. One IPEX 1 connector.

5. Debug Serial Port and AT main serial port: 2.54mm-3Pin,both at 3.3V voltage level.

6. Two LEDs:

One STAT LED:CAT1 is functioning normally.
One NET LED: 1.8 seconds on and 0.2 seconds off indicating successful network registration.
1.8 seconds off and 0.2 seconds on indicating that the device has not registered onto the network, suggesting that the SIM card and antenna should be checked.

7. The reserved BooT and reset button is on the back side reverse side.

(If there is a need to perform a button reset, you can solder the buttons yourself.)

8. Size: 65*30*6.6mm;M2.5mm mounting holes.

9. PCB: UL and ROHS certification, fire protection rating of 94V-0.

1002_Zero_4G_Cat1_21.jpg

1002_Zero_4G_Cat1_22.jpg

III. Work with Raspberry Pi OS

3.1 USB version

If connecting to a Raspberry Pi Zero series board, it generally requires the use of an expansion board with a USB interface. So you just need to enable USB Host mode in the config.txt file.

Here, we are assembling the Raspberry Pi Zero 2W using our company's RPi0_2U2E Board, and then connecting the USB version.

The USB version occupies the right-side RPi0_2U2E Board (as shown in the image below). This USB port cannot be used to connect any external devices; otherwise, the 4G functionality will not work.

1002_Zero_4G_Cat1_12.jpg

After booting the system, execute ifconfig -a, and you will see eth2, which corresponds to the 4G CAT1 interface; while eth0 and eth1 are the two 100Mbps Ethernet ports on the RPi0_2U2E Board.

1002_Zero_4G_Cat1_14.jpg

3.2 Probe version

3.2.1 Preparation

The Raspberry Pi Zero 2W has only one USB port, which is now occupied by the 4G module, so there are no USB ports available for a keyboard or mouse. Subsequent operations can only be performed through a WiFi or 4G connection. Therefore, when flashing the system, you need to pre-configure it to set up WiFi and enable SSH to proceed further (if you are using a Raspberry Pi Zero W or Zero WH, the usage method is the same).

If you are using the Raspberry Pi Zero, which lacks WiFi functionality, you would need to debug all business logic and set it up to run on startup on another expansion board. If you do not have any subsequent need to connect other USB devices and the 4G Cat1 is only used to provide network access, you can use the Probe version. Otherwise, it is recommended to use the USB version.

Hardware: Please plug the power supply into the USB power port marked "PWR" on the Zero 2W. If you plug it into another USB port or the USB port on the expansion board, it will cause the 4G module to be shielded.

Wiring diagram:

1002_Zero_4G_Cat1_20.jpg

The version of the Raspberry Pi OS is: 2024-07-04-raspios-bookworm-arm64.img.xz

You can download the Raspberry Pi OS in:

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

(If using the first-generation Raspberry Pi Zero board, which only supports 32-bit systems, please pay attention to the version you download.)

3.2.2 Flashing system (Setup required for WiFi connection and SSH service)

Open the Imager, select the “Raspberry Pi Device”, “Choose Use Custom”, and “Storge”, then click "NEXT."

1002_Zero_4G_Cat1_01.jpg

Then click "Edit Settings" :

1002_Zero_4G_Cat1_02.jpg

In the pop-up window, under the GENERAL tab, you can set the hostname, username, and password, the default WiFi connection, and the region:

1002_Zero_4G_Cat1_03.jpg

Under the SERVICES tab, please set up to enable the SSH service:

1002_Zero_4G_Cat1_04.jpg

After completing the settings, click "Save," return to the previous page, and then click "Yes":

1002_Zero_4G_Cat1_05.jpg

Click "Yes" in the warning window:

1002_Zero_4G_Cat1_06.jpg

This will start the burning process. After the burning is complete, use this TF card to boot the system. The system will automatically log in with the preset username and password and connect to the preconfigured WiFi (provided the device is within range of the WiFi hotspot).

If the system stop at the Raspberry Pi logo and fails to boot:

0007_Zero_4G_Cat1_58.jpg

Please carefully check whether the pogo pins are aligned with the gold-plated contacts. Additionally, on the PC, open the config.txt file located in the root directory of the TF card to check the USB initialization script:

0007_Zero_4G_Cat1_41.jpg

You need to confirm that the three red-boxed areas in the following image are all configured completely. If not, please manually add the missing parts and save the file:

# otg_mode=1 (It is recommended to comment out as follow)

dtoverlay=dwc2,dr_mode=host (These two areas must be ensured to be included.)

0007_Zero_4G_Cat1_57.jpg

3.2.3 Control via SSH through WiFi

After the system starts, if the WiFi connection is successful, the internal network IP will be displayed below the WiFi icon in the top right corner of the desktop:

1002_Zero_4G_Cat1_07.jpg

You can also obtain the system's internal IP address by checking the router's backend:

1002_Zero_4G_Cat1_19.jpg

Here, we use the MobaXterm for SSH. The download link for MobaXterm is:

https://mobaxterm.mobatek.net/download-home-edition.html

Open the MobaXterm, create a new connection, select SSH, enter the IP address of the Raspberry Pi OS in the "Remote Host", and enter the login username in the "Specify username", as shown in the following figure:1002_Zero_4G_Cat1_08.jpg

Click "OK," then log in. After logging in, we can perform command-line operations on the Raspberry Pi Zero 2W using MobaXterm:

1002_Zero_4G_Cat1_23.jpg


Now we check the connection status of the 4G module:

lsusb

1002_Zero_4G_Cat1_24.jpg

It can be seen that the 4G module has connected.

Using ifconfig -a to check the network interfaces, it can be seen that the 4G module is identified as eth0 and has obtained an IP address:

1002_Zero_4G_Cat1_25.jpg

3.2.4 How to use AT commands

Execute the command in the SSH terminal:

ls /dev

You should be able to see three devices named ttyACM0, ttyACM1, and ttyACM2 under the dev directory:

1002_Zero_4G_Cat1_27.jpg

Install minicom:

sudo apt-get install minicom

1002_Zero_4G_Cat1_28.jpg

Open AT Command serial port by minicom:

sudo minicom -D /dev/ttyACM0

Note: When using a serial port, ensure that after entering this port, you can input and run AT commands without any garbled output or unexpected jumps in the results.

The following uses minicom as an example:

Then directly type the AT command and press Enter to see the result. If you need to view the echo, please type the command: ate1

1002_Zero_4G_Cat1_29.jpg

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.

3.2.5 Enable SIM card hot-swapping

This expansion board supports SIM card hot-swapping, but this feature is disabled by default. To enable it, first remove the SIM card, and then open the AT command serial port:

sudo minicom -D /dev/ttyACM0

Execute:

at+csdt=1

If the output is "OK," it indicates that the setting was successful.

You can use AT+CSDT? to check the current status. A return value of 1 indicates that the SIM card hot-swapping feature has been enabled.

1002_Zero_4G_Cat1_33.jpg

After hot-swapping the SIM card, execute the following commands separately. If all commands are successful (with eth0 being the 4G module), it confirms that hot-swapping is supported:

sudo udhcpc -i eth0

ping www.mcuzone.com -I eth0

1002_Zero_4G_Cat1_34.jpg

IV. 4G Application (Remote Control)

RPi-Connect provides a service for secure access to your Raspberry Pi from anywhere. With this service, combined with the Zero Cat1 4G Probe version, you can still remotely access your Raspberry Pi even when outdoors without a Wi-Fi network. Note: To use this service, Bookworm or a newer system must be running. Additionally, only the Raspberry Pi 5, 4, or 400 can use screen sharing. The Zero 2W can only use Remote Shell. The following demonstrates how to configure the remote connection service.

4.1 Install DNS service (only for system version 2024.07.04 and later)

The 4G CAT1 module is driver-free and can achieve automatic 4G connectivity at each boot. However, to avoid DNS server conflicts, the following settings need to be applied for automatic startup:

Install the DNS server switching software udhcpc:

sudo apt install udhcpc

1002_Zero_4G_Cat1_18.jpg

Open rc-local service:

sudo sudo systemctl enable --now rc-local

Use the following command to open rc.local:

sudo nano /etc/rc.local

Add the command you want to execute at startup above the line exit 0, and then save the file (in this example, eth0 represents the 4G module, but the name should match the actual interface identified on your system):

sleep 5 && sudo udhcpc -i eth0 && sleep 5 && sudo udhcpc -i eth0 && sleep 5 && sudo udhcpc -i eth0

1003_Zero_4G_Cat1-Hub_23.jpg

The sleep command is used to delay the execution of subsequent commands by a certain number of seconds. Since the 4G module needs some time to acquire an IP address, to prevent `udhcpc` from failing, it needs to be executed several times with a delay added between each execution. As a result, the 4G network becomes usable approximately 20 seconds after the system boots up.

4.2 Apply for a Raspberry Pi ID

If you already have a Raspberry Pi ID, please log in directly. If not, please follow the steps below to apply.

Open the website at https://id.raspberrypi.com/, and enter the email address and password you wish to use:

1003_Zero_4G_Cat1-Hub_12.jpg

After creating the account, you need to verify it by entering your email:

1003_Zero_4G_Cat1-Hub_13.jpg

1003_Zero_4G_Cat1-Hub_14.jpg

After verification is complete, the ID can be used.

4.3 Install Remote Service

Open the SSH terminal and install the Raspberry Pi Connect software. If the installation command indicates that it is already installed, then no additional installation is necessary:

sudo apt install rpi-connect

After installation, we enter loginctl enable-linger in the terminal to ensure that the remote service is automatically enabled each time the system restarts:

1002_Zero_4G_Cat1_32.jpg

Restart the system. In the graphical interface, select the items in the order shown in the following image to ensure that Raspberry Pi Connect is turned on:

MPS2280iPoE_08.png

1002_Zero_4G_Cat1_13.jpg

Then enter the following in the Raspberry Pi terminal:

rpi-connect signin

1002_Zero_4G_Cat1_30.jpg

Now, a URL is displayed, as shown in the image above. Open this URL in a browser (it is recommended to use another computer, as the Zero series can be very slow when opening a browser due to hardware limitations).

1003_Zero_4G_Cat1-Hub_17.jpg

Click on "Sign in" and follow the prompts to bind the device. First, you need to set the device name:

1003_Zero_4G_Cat1-Hub_18.jpg

Click "Create device and sign in":

1003_Zero_4G_Cat1-Hub_19.jpg

This completes the binding process, and there will also be a successful message displayed in the terminal:

1002_Zero_4G_Cat1_31.jpg

4.4 Use remote control

On your PC, open: https://connect.raspberrypi.com/devices1003_Zero_4G_Cat1-Hub_21.jpg

The Zero 2W device just added only shows "Remote shell", indicating that this device can only be controlled through a remote command-line interface.

Click on "Connect" to open the remote command-line interface, where you can then enter commands:

1003_Zero_4G_Cat1-Hub_22.jpg

After configuration is complete, the system will be able to connect to the internet via 4G each time it boots up and will also enable the Raspberry Pi Connect remote service. This way, we can control the device through a remote command-line interface from a PC.

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-2024 Wildchip