1003 RPi0 4G Cat1-Hub EN:修订间差异

来自Mcuzone Wiki
(创建页面,内容为“== '''关键词''' == 树莓派 Zero、Zero 2W、Cat1 4G LTE、USB2.0、USB Type-C、USB HUB 集线器、Nano SIM、eSIM、RPi-Connect、远程连接 == '''一、简介''' == 树莓派Zero系列(包括Zero、Zero W(H)以及Zero 2W)是一款具备极高性价比的嵌入式系统平台,尺寸小巧功耗较低性能尚可,适合很多轻量型应用场景。Zero系列虽然小巧,但预留了非常多的扩展接口,特别是板子反面引出了USB…”)
 
 
(未显示2个用户的11个中间版本)
第1行: 第1行:
== '''关键词''' ==
[[1003 RPi0 4G Cat1-Hub|切换语言为中文]]
树莓派 Zero、Zero 2W、Cat1 4G LTE、USB2.0、USB Type-C、USB HUB 集线器、Nano SIM、eSIM、RPi-Connect、远程连接


== '''一、简介''' ==
== '''Keywords''' ==
树莓派Zero系列(包括Zero、Zero W(H)以及Zero 2W)是一款具备极高性价比的嵌入式系统平台,尺寸小巧功耗较低性能尚可,适合很多轻量型应用场景。Zero系列虽然小巧,但预留了非常多的扩展接口,特别是板子反面引出了USB和电源的镀金测试点,我们可以借助这两组USB和电源测试点进行多种类型的外设扩展。
Raspberry Pi Zero, Zero 2W, Cat1 4G LTE, USB2.0, USB Type-C, USB HUB, Nano SIM, RPi-Connect, Remote connection


本扩展板实际就是一个USB HUB集线器,通过顶针将扩展板和Zero的USB口连接起来,利用USB的HOST功能通过USB HUB芯片扩展四路USB口,其中一路USB接4G Cat1模组以及三路USB2.0 Type-C主机接口。
== '''I. Introduction''' ==
The Raspberry Pi Zero series (including the Zero, Zero W/H, and Zero 2W) is a highly cost-effective embedded system platform, known for its small size, low power consumption, and acceptable performance, making it suitable for many lightweight application scenarios. Although the Zero series is compact, it reserves a large number of expansion interfaces. Especially on the backside of the board, gold-plated test points for USB and power are brought out. We can use these sets of USB and power test points to expand various types of peripherals.


4G Cat1是针对10Mbps左右的中速物联网应用的高性价比模组,10Mbps下行5Mbps上行的速率可以满足绝大多数联网和传输需求;4G全网通,支持联通,电信和移动。CAT1在树莓派官方os,ubuntu系统和OpenWrt系统下均免驱,自动识别,使用便捷。
This expansion board is essentially a USB hub that connects to the Zero's USB port via pogo pins. It expands four USB ports via USB, with one USB port converted to a 4G Cat1 module, and three USB 2.0-A host ports.


== '''二、硬件资源''' ==
4G Cat1 is a high-cost-performance module aimed at medium-speed IoT applications around 10 Mbps. The 10 Mbps downlink and 5 Mbps uplink speeds can satisfy the majority of connectivity and transmission requirements. The CAT1 module is driver-free and automatically recognized in the Raspberry Pi OS, Ubuntu system, and OpenWrt system, making it easy to use.
1. 本扩展板是通过4个顶针连接到树莓派zero的USB口和电源口触点进行供电和通讯。


2. 引出一路USB-C电源口,和树莓派zero自身的电源口功能一样,两者二选一使用,不可同时使用。
== '''II. Hardware Spec''' ==
1. This board connects to the Raspberry Pi Zero's USB port and power contacts via four pogo pins for both power supply and communication.


3. 板载一路4G CAT1模块,可选带GPS功能的4G模组,其他国家用户也可选匹配频段的其他CAT1模组。
2. A USB-C power port, which functions are the same as the power port on the Raspberry Pi Zero itself. '''''You can choose to use either one, but not both simultaneously.'''''


4. 采用Nano SIM卡座(在反面),并预留eSIM芯片位置(SIM卡和eSIM芯片二选一使用),SIM插入朝向请参考板上丝印。
3. A 4G CAT1 module, can option the GPS functionality. '''''Users in other countries can also select other CAT1 modules that match their frequency bands.'''''


5. 采用IPEX一代接口,可外接4G FPC或棒状天线,如果选择GPS版本,需配GPS无源天线,且天线需甩到窗外才能定位。
4. A Nano SIM card slot (located on the reverse side). '''''Note: SIM card hot-swapping is not supportted.'''''


6. 板载三路USB2.0 Type-C主机接口,每个USB口的供电能力为1A(注意,树莓派zero自身的OTG功能将无法再使用,而且zero自身的micro USB口也不能再接任何USB设备,否则此扩展板将无法使用)。
5. A first-generation IPEX connector, which can be used with external 4G FPC or rod antennas.


7. 预留调试串口和AT主串口,3.3V电平。
6. Three USB 2.0 Type-C host, with each USB port capable of supplying 1A of power '''''<u>(Note: the Raspberry Pi Zero's own OTG functionality will no longer be usable, and the Zero's own micro USB port cannot be used to connect any USB devices, otherwise, this expansion board will not function properly).</u>'''''


8. 三个LED指示灯,其中一个是扩展板电源灯,一个是4G模块的电源灯;NET用于指示网络状态,1.8秒亮0.2秒灭表示注网成功,1.8秒灭0.2秒亮表示未注网,需要检查SIM卡和天线。
7. Have debugging UART and the AT main UART, both with 3.3V voltage levels.


9. 板载BOOT和复位的按键位置。
8. Three LEDs:


10. 尺寸:66*30mm,4个M2.5的固定孔,高度为5mm,板子尺寸和树莓派zero系列板子尺寸完全兼容。
*one is the power indicator for the expansion board.


11. 可选3D打印底座,用于保护线路板。
*one is the power indicator for the 4G module.  


12. 线路板采用沉金工艺,无铅生产,PCB通过UL和ROHS认证,防火等级94V-0。
*one is the NET led: a 1.8-second on and 0.2-second off cycle indicates successful network registration, while a 1.8-second off and 0.2-second on cycle indicates that the device has not registered with the network, and you should check the SIM card and antenna.


http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_24.jpg
9. A BOOT button and a reset button.


http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_25.jpg
10. Sizes: 65*30*6.6mm, with four M2.5 mounting holes.  


http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_26.jpg
11. An optional 3D printed base is available to protect the circuit board.


== '''三、系统烧写及设置''' ==
12. The circuit board uses an ENIG (Electroless Nickel Immersion Gold) process, is produced without lead, and the PCB has received UL and RoHS certifications, with a fire protection rating of 94V-0.


=== 3.1 概述 ===
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_37.jpg
本文档使用基于树莓派Zero 2W的硬件,


1)树莓派OS,Raspberry Pi OS with desktop,镜像为2024-07-04-raspios-bookworm-arm64.img.xz。
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_38.jpg


(若使用树莓派Zero一代系列的板子,只支持32位系统,请注意下载版本。)
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_39.jpg


树莓派OS下载地址:
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_40.jpg


https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_41.jpg


2)Ubuntu系统,Ubuntu Server 24.04 LTS,服务器版(树莓派Zero 2W因为性能关系不能用Desktop版),镜像为ubuntu-24.04-preinstalled-server-arm64+raspi.img.xz
== '''III. Work with Raspberry Pi OS''' ==
The Raspberry Pi OS used in this document is: 2024-07-04-raspios-bookworm-arm64.img.xz(Raspberry Pi OS with desktop).


Ubuntu系统下载地址:
(If you are using the Raspberry Pi Zero (1st generation) series boards, they only support 32-bit systems. Please be sure to download the correct version.)


https://ubuntu.com/download/raspberry-pi
You can download the Raspberry Pi OS in:


(若使用树莓派Zero一代系列的板子,只支持32位系统,则没有合适的Ubuntu Server系统。)
https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit


=== 3.2 系统烧写在SD(TF)卡上 ===
=== 3.1 View hardware devices ===
[[0005 MPS2242 2280 2280P(单SSD扩展板)#3.2 从TF卡启动|点击直达烧写方法说明]]。


== '''四、树莓派系统的使用''' ==
==== 3.1.1 Hardware connection ====
This expansion board features four USB Type-C ports. One of these USB Type-C ports is labeled as PWR on the silkscreen on the back, indicating it is the power input USB Type-C port. The remaining three USB Type-C ports are HOST ports, which can be used to connect USB devices such as keyboards, mice, and USB drives, among other peripherals. Above the 4G module, there are two antenna connectors; one is for the 4G signal antenna, and the other is for the GPS signal antenna. All peripherals are driver-free, meaning they are plug-and-play.


=== ☆ 4.1 查看硬件设备 ===
The Raspberry Pi Zero board is fixed above the expansion board using four screws. Please pay attention to the installation direction and ensure that the pogo pins on the expansion board align with the corresponding contacts on the Zero board. Connect the HDMI cable and power supply, and '''''note that the Zero's micro USB port should not be connected to any devices'''''.


==== 4.1.1 硬件连接 ====
==== 3.1.2 View USB devices ====
本扩展板具有4个USB Type-C口,其中有一个USB Type-C口在背面丝印标注为PWR,即该口为电源输入USB Type-C口,剩余3个USB Type-C口为HOST,可连接USB设备(键盘鼠标及U盘等各种外设)。4G模块上方有两个天线接口,一个是4G信号天线,一个是GPS信号天线。所有外设都免驱,即插即用。
Open the terminal in Raspberry Pi OS and enter the command<code>lsusb</code>, as shown in the image below:
 
树莓派Zero板通过4个螺丝固定在扩展板上方,请注意安装方向及扩展板的顶针是否对准Zero板相应的触点,接好HDMI线和电源,'''''请注意,Zero自身的miro USB口不能接任何设备。'''''
 
==== 4.1.2 查看USB设备 ====
打开树莓派OS的终端,输入命令<code>lsusb</code>,如下图所示:


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


可以看到系统识别到了USB HUB和4G模组。其中:
The system has detected the USB hub and the 4G module:


Device 002:外挂USB Hub;
Device 002: External USB Hub;


Device 003:4G模组;
Device 003: 4G module;


Device 004:USB2.0 Type-C接口;
Device 004: USB2.0 Type-C interface;


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


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


或者启动后键盘鼠标及4G模组都无法使用;
or if after booting, the keyboard, mouse, and 4G module cannot be used,


请仔细观察顶针是否对准了镀金触点,并请在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


==== 4.1.3 查看4G设备 ====
==== 3.1.3 View 4G module ====
打开树莓派OS的终端,输入命令<code>ifconfig -a</code>,如下图所示:
Open the terminal in Raspberry Pi OS and enter the command<code>ifconfig -a</code>, as shown in the image below:


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


可以eth0为4G Cat1(已自动连接,上图中IP地址默认为192.168.10.2),wlan0为Zero 2W自带的无线网卡。
You can see that eth0 as the 4G Cat1 (which has automatically connected, with the default IP address in the above example being 192.168.10.2), and wlan0 as the wireless network card that comes with the Zero 2W.


=== ☆ 4.2 测试4G ===
=== ☆ 3.2 Test 4G module ===


==== 4.2.1 系统未设置wifi时对4G的操作 ====
==== 3.2.1 Operations on 4G when the system has not set up WiFi ====
树莓派官方OS启动,WiFi默认开启,但是未连接热点(即在系统里没有设置WiFi账号和密码);此时连接4G模块上网,我们可以进行ping操作:
When the Raspberry Pi OS boots, WiFi is enabled by default, but it is not connected to any access point (meaning no WiFi account and password are set in the system). So when connecting to the internet via the 4G module, we can perform a ping operation:


ping通IP,正确显示如下:
Ping the IP should correctly display as follows:


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


ping通域名,正确显示如下:
Ping the domain name should correctly display as follows:


http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_16.jpg
http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_16.jpg


此说明4G联网正常。
This indicates that the 4G connection is normal.


'''遇ping域名报错的解决方法:'''
'''Solution for ping domain error:'''


如果发生ping域名报错,如图所示:
If you encounter a ping domain error, as shown in the image:


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


这说明4G模块的DNS服务器设置不正确;那我们来修改DNS服务器设置:
This indicates that the DNS server settings for the 4G module are incorrect. Let's modify the DNS server settings:


首先我们需要连接WiFi:
First, we need to connect to WiFi:


点击右上角的网络标志,选取想要连接的AP:
Click on the network icon in the upper right corner and select the AP you want to connect to:


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


输入密码(如果有),然后点击“Connect”:
Enter the password (if there is one), and then click "Connect":


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


连接成功后即可获取路由器ip,正常上网:
After a successful connection, you can obtain the IP address of the router and access the internet normally:


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


然后我们安装切换DNS服务器的软件udhcpc:
Install the DNS server switching software udhcpc:


<code>sudo apt install udhcpc</code>
<code>sudo apt install udhcpc</code>
第155行: 第149行:
http://www.mcuzone.com/wiki/0007_Zero_4G_Cat1/0007_Zero_4G_Cat1_48.jpg
http://www.mcuzone.com/wiki/0007_Zero_4G_Cat1/0007_Zero_4G_Cat1_48.jpg


安装完毕后,使用下面的命令切换DNS服务器到4G模块(eth0在这里代表4G模块,依照软硬件平台不同,名称会有差异):
After installation, use the following command to switch the DNS server to the 4G module (in this case, eth0 represents the 4G module; the name may differ depending on the software and hardware platform):


<code>sudo udhcpc -i eth0</code>
<code>sudo udhcpc -i eth0</code>
第161行: 第155行:
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_04.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_04.jpg


这样就实现了4G正常上网。
This way, you achieve normal internet browsing via 4G.


使用上述通过切换DNS服务器让4G上网的方法,在重启系统后会失效;如果你希望每次系统启动,即实现DNS服务器自动切换到4G模块,可进行如下操作:
The method of switching DNS servers for 4G internet access will stop working after the system is restarted. If you want the DNS server to automatically switch to the 4G module each time the system starts, you can follow these steps:


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


<code>sudo systemctl enable --now rc-local</code>
<code>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上面添加你要开机执行的命令,如需要开机就使用4G网络,则可以添加下列命令,然后保存文件(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>
第179行: 第173行:
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.2 系统已设置好WiFi联网,对4G的操作 ====
==== 3.2.2 The system has already been set up for WiFi connectivity, and the operations for the 4G connection ====
如果你的系统卡之前是设置好WiFi的,在单独使用树莓派zero2W时,是通过WiFi提供网络;此时若装了我们的扩展板,待系统重新启动后,系统将优先通过4G网络上网,您如果想切换到WiFi上网,可以按下列步骤操作:
If your system was previously set up with WiFi, the Raspberry Pi Zero 2W will provide internet access via WiFi when used alone. When you install our expansion board, upon rebooting the system, it will prioritize using the 4G network for internet access. If you want to switch to WiFi, you can follow these steps:


关闭4G网络连接:
Disable the 4G network connection:


<code>sudo ifconfig eth0 down</code>
<code>sudo ifconfig eth0 down</code>
第190行: 第184行:
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_31.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_31.jpg


使用udhcpc,将DNS服务器切换为Wifi的DNS服务器:
Use udhcpc to switch the DNS server to the WiFi's DNS server.


<code>sudo udhcpc -i wlan0</code>
<code>sudo udhcpc -i wlan0</code>
第196行: 第190行:
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_32.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_32.jpg


之后如果想切换回4G网络上网,可以运行:
If you later want to switch back to browsing the internet using the 4G network, you can run:


<code>sudo ifconfig eth0 up</code>
<code>sudo ifconfig eth0 up</code>
第204行: 第198行:
<code>sudo udhcpc -i eth0</code>
<code>sudo udhcpc -i eth0</code>


==== 4.2.3 通过WiFi的SSH对4G操作 ====
==== 3.2.3 Access the 4G module via SSH over WiFi ====
 
If you want to enable SSH using the Raspberry Pi ZERO's WiFi to subsequently perform 4G operations on the Raspberry Pi, you need to set up the SSH service before flashing the system. For the steps, refer to [[1006 RPi0 4G MiniPCIe(MiniPCIe扩展4G模组)#3.2.1 使用树莓派镜像烧录器烧写|this guide]].


如果你想利用树莓派ZERO的WiFi使能SSH,进而对树莓派进行4G操作,需要在烧写系统前设置SSH服务,操作步骤参考[[1006 RPi0 4G MiniPCIe(MiniPCIe扩展4G模组)#3.2.1 使用树莓派镜像烧录器烧写|这里]]。
=== ☆ 3.3 How to use AT commands and GPS ===


=== ☆ 4.3 使用AT命令及GPS ===
==== 3.3.1 Open AT serial ====
Execute the command in the SSH terminal:


==== 4.3.1 打开串口 ====
<code>ls /dev</code>
系统上电启动后,在树莓派终端中执行命令:
<!--
<!--


第234行: 第230行:
-->
-->


此时应该能看到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/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_08.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_08.jpg


打开串口工具方法有二:
Install minicom:
 
1)下载minicom工具:


<code>sudo apt-get install minicom</code>
<code>sudo apt-get install minicom</code>
第246行: 第240行:
http://www.mcuzone.com/wiki/0007_Zero_4G_Cat1/0007_Zero_4G_Cat1_13.jpg
http://www.mcuzone.com/wiki/0007_Zero_4G_Cat1/0007_Zero_4G_Cat1_13.jpg


2)通过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.


==== 4.3.2 操作AT命令 ====
==== 3.3.2 Execute AT commands ====
下面以minicom为例,如果需要查看回显,请键入命令:<code>ate1</code>,然后回车,继续键入其它命令,回车可以看到结果。
The following uses minicom as an example:


用AT+CPIN?来检查SIM是否正常插入并识别;
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>:


用AT+CSQ来检查信号强度,第一个值是0-31,需要25以上才算信号质量良好;
Use AT+CPIN? to check if the SIM card is properly inserted and recognized;


用AT+COPS?来检查注网情况,双引号内是运营商代码,最后一个数字是网络模式,7代表4G。
Use AT+CSQ to check the signal strength; the first value ranges from 0-31, and a value of 25 or above is considered good signal quality;
 
Use AT+COPS? to check the network registration status; the quotation marks contain the operator code, and the last digit represents the network mode, with 7 indicating 4G.


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


==== 4.3.3 GPS测试(仅限GPS版本) ====
==== 3.3.3 GPS Test (only for GPS version) ====
使用GPS时,需要接GPS无源天线,且确保GPS天线甩出户外。
When using GPS, you need to connect a passive GPS antenna and ensure that the GPS antenna is extended outdoors.


运行minicom,打开ttyACM0串口:
Run minicom and open the ttyACM0 serial port:


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


并运行:
And execute:
 
<code>AT+CGNSPWR=1</code>                      //Open GPS
 
<code>AT+CGNSAID=31,1,1,1</code>          //Enable location assistance positioning (the command will immediately return OK, and positioning will succeed in about 2-10 seconds based on signal strength).
 
<code>AT+CGNSURC=1</code>                      //Setup automatic reporting of location information


<code>AT+CGNSPWR=1</code>                      //打开GPS
After running successfully, you will be able to see GPS information output from the serial port:http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_10.jpg


<code>AT+CGNSAID=31,1,1,1</code>          //使能位置辅助定位(指令立马返回OK,根据信号强度,大概2-10秒左右会定位成功)
Wait for a moment, and the device will then be able to acquire its location.


<code>AT+CGNSURC=1</code>                      //设置定位信息自动上报,每隔5个fix,00000就上报一次
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_27.jpg


运行成功后就可以看到该串口有GPS信息输出:
== '''IV. Work with Ubuntu system''' ==
Ubuntu system: Ubuntu Server 24.04 LTS. (The Raspberry Pi Zero 2W cannot use the Desktop version due to performance limitations.)


http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_10.jpg
The image is: ubuntu-24.04-preinstalled-server-arm64+raspi.img.xz


稍等片刻即可定位:
You can download the Ubuntu system in:


http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_27.jpg
https://ubuntu.com/download/raspberry-pi


== '''五、Ubuntu系统的使用''' ==
(If using the first-generation Raspberry Pi Zero board, which only supports 32-bit systems, there may not be a suitable Ubuntu Server system available.)


=== 5.1 编辑初始化脚本 ===
=== 4.1 Edit the initialization script ===
Ubuntu Server烧写完毕后,请在PC端打开TF卡系统分区根目录下的config.txt检查USB的初始化脚本,Ubuntu Server对USB初始化了两遍,前面一遍没有配置成host模式,需要确认下图中的红框的位置是否配置成完全,如果没有,请手动添加完整:
After flashing Ubuntu Server to the TF card, please open the <code>config.txt</code> file in the root directory of the system partition on your PC to check the USB initialization script. Ubuntu Server initializes the USB twice, and the first initialization does not configure it into host mode. You need to verify if the position indicated by the red box in the following diagram is fully configured. If it is not, please manually add the complete configuration:


<code>dtoverlay=dwc2,dr_mode=host</code>
<code>dtoverlay=dwc2,dr_mode=host</code>
第297行: 第300行:
http://www.mcuzone.com/wiki/0007_Zero_4G_Cat1/0007_Zero_4G_Cat1_75.jpg
http://www.mcuzone.com/wiki/0007_Zero_4G_Cat1/0007_Zero_4G_Cat1_75.jpg


=== 5.2 配置用户名和密码 ===
=== 4.2 Configure the username and password ===
将TF卡插入Zero 2W,启动系统。第一次启动后会要求登录,用户名和密码均为ubuntu,登录成功后会要求修改密码。
Insert the TF card into the Zero 2W and boot the system. Upon the first boot, you will be prompted to log in. The username and password are both <code>ubuntu</code>. After logging in successfully, you will be prompted to change the password:


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


修改完毕后就自动进入系统。
After modifying the password, you will automatically enter the system.


=== 5.3 配置网络 ===
=== 4.3 Configure the network ===
系统启动后并无网络可用,需要进行后续设置后才能使用。
After the system boots, there is no network available, and setup is required before it can be used.


'''''注意,系统默认并没有集成ifconfig工具,只有ip命令可用。'''''
'''''Note: the system does not integrate the <code>ifconfig</code> tool by default; only the <code>ip</code> command is available.'''''


执行<code>ip addr</code>查看并记录下网卡名称:
Execute <code>ip addr</code> to view and record the network interface name:


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


其中2号网卡(enx2089846a96ab)为4G模组。
The second network interface (enx2089846a96ab) is the 4G module.


然后运行下面的命令,打开网卡配置文件:
Then run the following command to open the network interface configuration file:


<code>sudo nano /etc/netplan/50-cloud-init.yaml</code>
<code>sudo nano /etc/netplan/50-cloud-init.yaml</code>


按照下图编辑网卡配置文件:
Edit the network interface configuration file according to the image below:


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


保存退出,然后重启。
Save and exit, then restart.


重启后即可联网,安装net-tools工具以便于使用:
After restarting, you can connect to the network. Install the net-tools package for convenience:


<code>sudo apt install net-tools</code>
<code>sudo apt install net-tools</code>
第331行: 第334行:
http://www.mcuzone.com/wiki/0007_Zero_4G_Cat1/0007_Zero_4G_Cat1_35.jpg
http://www.mcuzone.com/wiki/0007_Zero_4G_Cat1/0007_Zero_4G_Cat1_35.jpg


执行ifconfig -a,可以看见4G模块已经正确获得了IP地址:
Run <code>ifconfig -a</code> to see that the 4G module has correctly obtained an IP address:


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


=== 5.4 测试AT命令 ===
=== 4.4 Test AT commands ===
执行命令:
Execute command:


<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/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_36.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_36.jpg


下载安装minicom工具:
Install minicom:


<code>sudo apt-get install minicom</code>
<code>sudo apt-get install minicom</code>
第350行: 第353行:
http://www.mcuzone.com/wiki/1005_Zero-DETH_DUSB/1005_Zero-DETH_DUSB_24.jpg
http://www.mcuzone.com/wiki/1005_Zero-DETH_DUSB/1005_Zero-DETH_DUSB_24.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.
 
The following uses minicom as an example:


下面以minicom为例,如果需要查看回显,请键入命令:<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>


用AT+CPIN?来检查SIM是否正常插入并识别;
Use AT+CPIN? to check if the SIM card is properly inserted and recognized;


用AT+CSQ来检查信号强度,第一个值是0-31,需要25以上才算信号质量良好;
Use AT+CSQ to check the signal strength; the first value ranges from 0-31, and a value of 25 or above is considered good signal quality;


用AT+COPS?来检查注网情况,双引号内是运营商代码,最后一个数字是网络模式,7代表4G。
Use AT+COPS? to check the network registration status; the quotation marks contain the operator code, and the last digit represents the network mode, with 7 indicating 4G.


http://www.mcuzone.com/wiki/1005_Zero-DETH_DUSB/1005_Zero-DETH_DUSB_25.jpg
http://www.mcuzone.com/wiki/1005_Zero-DETH_DUSB/1005_Zero-DETH_DUSB_25.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.


== '''六、(应用)Raspberry Pi Connect远程连接树莓派''' ==
== '''V. (Remote Connection) Raspberry Pi Connect to access your Raspberry Pi remotely''' ==
RPi-Connect提供了从任何地方安全接入到树莓派的服务。基于此服务,搭配Zero_Cat1_4G Cat1-Hu版即可实现在户外没有无线网络的情况下,依旧可以远程访问树莓派操作。注意:要使用此服务必须运行Bookworm及以上系统。同时,只有树莓派5,4或400可以使用屏幕分享。Zero2W只能使用Remote shell。接下来演示如何配置远程连接服务。
RPi-Connect provides a service for secure access to your Raspberry Pi from anywhere. With this service, combined with the Zero_Cat1_4G Cat1-Hub 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.


=== 6.1 申请Raspberry Pi ID ===
=== 5.1 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
第422行: 第427行:
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.


=== 6.2 安装远程服务 ===
=== 5.2 Install Remote Service ===
打开树莓派终端,安装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/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_15.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_15.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
第439行: 第444行:
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>
第445行: 第450行:
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_16.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_16.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/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_20.jpg
http://www.mcuzone.com/wiki/1003_Zero_4G_Cat1-Hub/1003_Zero_4G_Cat1-Hub_20.jpg


=== 6.3 使用远程控制 ===
=== 5.3 Use remote control ===
在PC上打开:https://connect.raspberrypi.com/devices<nowiki/>
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


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

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

切换语言为中文

Keywords

Raspberry Pi Zero, Zero 2W, Cat1 4G LTE, USB2.0, USB Type-C, USB HUB, Nano SIM, RPi-Connect, Remote connection

I. Introduction

The Raspberry Pi Zero series (including the Zero, Zero W/H, and Zero 2W) is a highly cost-effective embedded system platform, known for its small size, low power consumption, and acceptable performance, making it suitable for many lightweight application scenarios. Although the Zero series is compact, it reserves a large number of expansion interfaces. Especially on the backside of the board, gold-plated test points for USB and power are brought out. We can use these sets of USB and power test points to expand various types of peripherals.

This expansion board is essentially a USB hub that connects to the Zero's USB port via pogo pins. It expands four USB ports via USB, with one USB port converted to a 4G Cat1 module, and three USB 2.0-A host ports.

4G Cat1 is a high-cost-performance module aimed at medium-speed IoT applications around 10 Mbps. The 10 Mbps downlink and 5 Mbps uplink speeds can satisfy the majority of connectivity and transmission requirements. The CAT1 module is driver-free and automatically recognized in the Raspberry Pi OS, Ubuntu system, and OpenWrt system, making it easy to use.

II. Hardware Spec

1. This board connects to the Raspberry Pi Zero's USB port and power contacts via four pogo pins for both power supply and communication.

2. A USB-C power port, which functions are the same as the power port on the Raspberry Pi Zero itself. You can choose to use either one, but not both simultaneously.

3. A 4G CAT1 module, can option the GPS functionality. Users in other countries can also select other CAT1 modules that match their frequency bands.

4. A Nano SIM card slot (located on the reverse side). Note: SIM card hot-swapping is not supportted.

5. A first-generation IPEX connector, which can be used with external 4G FPC or rod antennas.

6. Three USB 2.0 Type-C host, with each USB port capable of supplying 1A of power (Note: the Raspberry Pi Zero's own OTG functionality will no longer be usable, and the Zero's own micro USB port cannot be used to connect any USB devices, otherwise, this expansion board will not function properly).

7. Have debugging UART and the AT main UART, both with 3.3V voltage levels.

8. Three LEDs:

  • one is the power indicator for the expansion board.
  • one is the power indicator for the 4G module.
  • one is the NET led: a 1.8-second on and 0.2-second off cycle indicates successful network registration, while a 1.8-second off and 0.2-second on cycle indicates that the device has not registered with the network, and you should check the SIM card and antenna.

9. A BOOT button and a reset button.

10. Sizes: 65*30*6.6mm, with four M2.5 mounting holes.

11. An optional 3D printed base is available to protect the circuit board.

12. The circuit board uses an ENIG (Electroless Nickel Immersion Gold) process, is produced without lead, and the PCB has received UL and RoHS certifications, with a fire protection rating of 94V-0.

1003_Zero_4G_Cat1-Hub_37.jpg

1003_Zero_4G_Cat1-Hub_38.jpg

1003_Zero_4G_Cat1-Hub_39.jpg

1003_Zero_4G_Cat1-Hub_40.jpg

1003_Zero_4G_Cat1-Hub_41.jpg

III. Work with Raspberry Pi OS

The Raspberry Pi OS used in this document is: 2024-07-04-raspios-bookworm-arm64.img.xz(Raspberry Pi OS with desktop).

(If you are using the Raspberry Pi Zero (1st generation) series boards, they only support 32-bit systems. Please be sure to download the correct version.)

You can download the Raspberry Pi OS in:

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

☆ 3.1 View hardware devices

3.1.1 Hardware connection

This expansion board features four USB Type-C ports. One of these USB Type-C ports is labeled as PWR on the silkscreen on the back, indicating it is the power input USB Type-C port. The remaining three USB Type-C ports are HOST ports, which can be used to connect USB devices such as keyboards, mice, and USB drives, among other peripherals. Above the 4G module, there are two antenna connectors; one is for the 4G signal antenna, and the other is for the GPS signal antenna. All peripherals are driver-free, meaning they are plug-and-play.

The Raspberry Pi Zero board is fixed above the expansion board using four screws. Please pay attention to the installation direction and ensure that the pogo pins on the expansion board align with the corresponding contacts on the Zero board. Connect the HDMI cable and power supply, and note that the Zero's micro USB port should not be connected to any devices.

3.1.2 View USB devices

Open the terminal in Raspberry Pi OS and enter the commandlsusb, as shown in the image below:

1003_Zero_4G_Cat1-Hub_01.jpg

The system has detected the USB hub and the 4G module:

Device 002: External USB Hub;

Device 003: 4G module;

Device 004: USB2.0 Type-C interface;

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

0007_Zero_4G_Cat1_58.jpg

or if after booting, the keyboard, mouse, and 4G module cannot be used,

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.1.3 View 4G module

Open the terminal in Raspberry Pi OS and enter the commandifconfig -a, as shown in the image below:

1003_Zero_4G_Cat1-Hub_02.jpg

You can see that eth0 as the 4G Cat1 (which has automatically connected, with the default IP address in the above example being 192.168.10.2), and wlan0 as the wireless network card that comes with the Zero 2W.

☆ 3.2 Test 4G module

3.2.1 Operations on 4G when the system has not set up WiFi

When the Raspberry Pi OS boots, WiFi is enabled by default, but it is not connected to any access point (meaning no WiFi account and password are set in the system). So when connecting to the internet via the 4G module, we can perform a ping operation:

Ping the IP should correctly display as follows:

1003_Zero_4G_Cat1-Hub_03.jpg

Ping the domain name should correctly display as follows:

3101_Domestic_4G_16.jpg

This indicates that the 4G connection is normal.

Solution for ping domain error:

If you encounter a ping domain error, as shown in the image:

0007_Zero_4G_Cat1_52.jpg

This indicates that the DNS server settings for the 4G module are incorrect. Let's modify the DNS server settings:

First, we need to connect to WiFi:

Click on the network icon in the upper right corner and select the AP you want to connect to:

1003_Zero_4G_Cat1-Hub_28.jpg

Enter the password (if there is one), and then click "Connect":

1003_Zero_4G_Cat1-Hub_29.jpg

After a successful connection, you can obtain the IP address of the router and access the internet normally:

1003_Zero_4G_Cat1-Hub_30.jpg

Install the DNS server switching software udhcpc:

sudo apt install udhcpc

0007_Zero_4G_Cat1_48.jpg

After installation, use the following command to switch the DNS server to the 4G module (in this case, eth0 represents the 4G module; the name may differ depending on the software and hardware platform):

sudo udhcpc -i eth0

1003_Zero_4G_Cat1-Hub_04.jpg

This way, you achieve normal internet browsing via 4G.

The method of switching DNS servers for 4G internet access will stop working after the system is restarted. If you want the DNS server to automatically switch to the 4G module each time the system starts, you can follow these steps:

Open rc-local service:

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.

3.2.2 The system has already been set up for WiFi connectivity, and the operations for the 4G connection

If your system was previously set up with WiFi, the Raspberry Pi Zero 2W will provide internet access via WiFi when used alone. When you install our expansion board, upon rebooting the system, it will prioritize using the 4G network for internet access. If you want to switch to WiFi, you can follow these steps:

Disable the 4G network connection:

sudo ifconfig eth0 down

1003_Zero_4G_Cat1-Hub_31.jpg

Use udhcpc to switch the DNS server to the WiFi's DNS server.

sudo udhcpc -i wlan0

1003_Zero_4G_Cat1-Hub_32.jpg

If you later want to switch back to browsing the internet using the 4G network, you can run:

sudo ifconfig eth0 up

sudo ifconfig wlan0 down

sudo udhcpc -i eth0

3.2.3 Access the 4G module via SSH over WiFi

If you want to enable SSH using the Raspberry Pi ZERO's WiFi to subsequently perform 4G operations on the Raspberry Pi, you need to set up the SSH service before flashing the system. For the steps, refer to this guide.

☆ 3.3 How to use AT commands and GPS

3.3.1 Open AT serial

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:

1003_Zero_4G_Cat1-Hub_08.jpg

Install minicom:

sudo apt-get install minicom

0007_Zero_4G_Cat1_13.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.

3.3.2 Execute AT commands

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

Use AT+CPIN? to check if the SIM card is properly inserted and recognized;

Use AT+CSQ to check the signal strength; the first value ranges from 0-31, and a value of 25 or above is considered good signal quality;

Use AT+COPS? to check the network registration status; the quotation marks contain the operator code, and the last digit represents the network mode, with 7 indicating 4G.

1003_Zero_4G_Cat1-Hub_09.jpg

3.3.3 GPS Test (only for GPS version)

When using GPS, you need to connect a passive GPS antenna and ensure that the GPS antenna is extended outdoors.

Run minicom and open the ttyACM0 serial port:

sudo minicom -D /dev/ttyACM0

And execute:

AT+CGNSPWR=1 //Open GPS

AT+CGNSAID=31,1,1,1 //Enable location assistance positioning (the command will immediately return OK, and positioning will succeed in about 2-10 seconds based on signal strength).

AT+CGNSURC=1 //Setup automatic reporting of location information

After running successfully, you will be able to see GPS information output from the serial port:1003_Zero_4G_Cat1-Hub_10.jpg

Wait for a moment, and the device will then be able to acquire its location.

1003_Zero_4G_Cat1-Hub_27.jpg

IV. Work with Ubuntu system

Ubuntu system: Ubuntu Server 24.04 LTS. (The Raspberry Pi Zero 2W cannot use the Desktop version due to performance limitations.)

The image is: ubuntu-24.04-preinstalled-server-arm64+raspi.img.xz

You can download the Ubuntu system in:

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

(If using the first-generation Raspberry Pi Zero board, which only supports 32-bit systems, there may not be a suitable Ubuntu Server system available.)

4.1 Edit the initialization script

After flashing Ubuntu Server to the TF card, please open the config.txt file in the root directory of the system partition on your PC to check the USB initialization script. Ubuntu Server initializes the USB twice, and the first initialization does not configure it into host mode. You need to verify if the position indicated by the red box in the following diagram is fully configured. If it is not, please manually add the complete configuration:

dtoverlay=dwc2,dr_mode=host

0007_Zero_4G_Cat1_32.jpg

0007_Zero_4G_Cat1_75.jpg

4.2 Configure the username and password

Insert the TF card into the Zero 2W and boot the system. Upon the first boot, you will be prompted to log in. The username and password are both ubuntu. After logging in successfully, you will be prompted to change the password:

0007_Zero_4G_Cat1_31.jpg

After modifying the password, you will automatically enter the system.

4.3 Configure the network

After the system boots, there is no network available, and setup is required before it can be used.

Note: the system does not integrate the ifconfig tool by default; only the ip command is available.

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

1003_Zero_4G_Cat1-Hub_33.jpg

The second network interface (enx2089846a96ab) is the 4G module.

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

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

Edit the network interface configuration file according to the image below:

1003_Zero_4G_Cat1-Hub_34.jpg

Save and exit, then restart.

After restarting, you can connect to the network. Install the net-tools package for convenience:

sudo apt install net-tools

0007_Zero_4G_Cat1_35.jpg

Run ifconfig -a to see that the 4G module has correctly obtained an IP address:

1003_Zero_4G_Cat1-Hub_35.jpg

4.4 Test AT commands

Execute command:

ls /dev

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

1003_Zero_4G_Cat1-Hub_36.jpg

Install minicom:

sudo apt-get install minicom

1005_Zero-DETH_DUSB_24.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

Use AT+CPIN? to check if the SIM card is properly inserted and recognized;

Use AT+CSQ to check the signal strength; the first value ranges from 0-31, and a value of 25 or above is considered good signal quality;

Use AT+COPS? to check the network registration status; the quotation marks contain the operator code, and the last digit represents the network mode, with 7 indicating 4G.

1005_Zero-DETH_DUSB_25.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.

V. (Remote Connection) Raspberry Pi Connect to access your Raspberry Pi remotely

RPi-Connect provides a service for secure access to your Raspberry Pi from anywhere. With this service, combined with the Zero_Cat1_4G Cat1-Hub 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.

5.1 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.

5.2 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:

1003_Zero_4G_Cat1-Hub_15.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

1003_Zero_4G_Cat1-Hub_16.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:

1003_Zero_4G_Cat1-Hub_20.jpg

5.3 Use remote control

On your PC, open: https://connect.raspberrypi.com/devices

1003_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

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