跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
Mcuzone Wiki
搜索
搜索
外观
登录
个人工具
登录
查看“︁5002 CM5 Basic/AI/Lora/4G EN”︁的源代码
页面
讨论
大陆简体
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
外观
移至侧栏
隐藏
←
5002 CM5 Basic/AI/Lora/4G EN
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
[[5002 CM5 Basic/AI/Lora/4G|切换语言为中文]] == '''Keywords''' == Raspberry Pi, CM5 Core board, NVME SSD, AI, LoRa, 4G LTE, miniPCIe, Dual Ethernet Ports, RPiOS, Ubuntu, USB3.0, RTC, PWM, DSI, CSI == '''I. Introduction''' == CM5_Basic is a foundational expansion board designed for the Raspberry Pi CM5, equipped with standard peripherals. It additionally features a miniPCIe interface for 4G connectivity, a USB Gigabit Ethernet port, and a TF/SD card reader. Suitable for cost-effective data/image capturing, storage, processing, and transmission applications. The expansion board features an onboard PCIe M.2 M slot, supporting NVMe SSDs as well as the Halio8 AI module. Onboard miniPCIe interface, supports multiple 4G modules, all driver-free and dial-up-free, auto-identification by the OS. The onboard circuit includes a USB TF card reader, enabling TF card storage functionality. The expansion board supports a wide voltage input range of 9-24V DC power supply, is compatible with all Raspberry Pi CM5 series core modules, and supports eMMC flashing. == '''II. Hardware Spec''' == {| class="wikitable" |+ |CM5 port |Applicable to all versions of the Raspberry Pi CM5 core board, with DF40HC3.0 connectors. |- |Ethernet ports |2*Ethernet ports: One native Gigabit Ethernet port and one 100 Mbps Ethernet port. |- |4G LTE |1*USB miniPCIE interface, with a Nano SIM card slot, supports 4G LTE, the 4G module optionally supports GPS functionality and an SMA antenna connector. Version R1.4: This interface can also be used to connect LoRa modules. |- |Storage ports |1*M.2 M-KEY slot NVMe SSD, supports PCIe x1 Gen2 and Gen3 modes, compatible with 2280/2242/2230 sizes (default mounting for 2280), does not support SATA or GNFF. 1*USB 2.0 expanded SD card slot, which can be used for external storage expansion but does not support system booting. |- |USB ports |2*USB 3.2-A HOST ports, suitable for connecting high-speed peripherals such as 5G devices and external hard drives. 3*USB 2.0 HOST high-speed ports, including 2*USB-A ports and 1*1.25mm-4P USB port (expandable for a secondary 4G LTE connection). |- |RTC |1*RTC, 1.25mm-2Pin port (Batteries not included). |- |Display |1*standard HDMI output port. 2*CSI/DSI combo interfaces. |- |Button |1*power button. |- |LED |1*power indicator. 2*CM5 indicator lights (power light and status light). 2*4G indicator lights (power and network registration lights). |- |Others |1*PWM speed-adjustable fan connector, 1.0mm pitch 4-pin. 40-pin GPIO interface, 2.54mm-2*20, fully compatible with Raspberry Pi 5's IO. |- |OS flashing |1*TF card slot, only for system booting on core boards without eMMC. 1*BOOT jumper for system flashing on the eMMC core board via USB-C port. |- |Power supply |Wide voltage power supply from 9-24V, DC5.5-2.1 interface. It also supports USB-C 5V3A power supply, with the option to choose either. |- |Size |110*135mm. Version R1.2 is a 4-layer PCB design, the board material is UL and RoHS certified with a flammability rating of 94V-0. |- |Case |Full aluminum alloy casing, with mounting holes for easy installation, dimensions: 155 (inner 138) * 114 * 32 mm. |} http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_76.jpg {| class="wikitable" |+Version Description ! !PCB !TF !LoRa |- |R1.1 |2-layer PCB |Not support, only for eMMC core boards. |Not support |- |R1.2 |4-layer PCB |Support, support all versions of core boards. |Not support |- |R1.4 |4-layer PCB |Support, support all versions of core boards. |Support |} http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_77.jpg http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_78.jpg http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_79.jpg == '''III. Flash OS''' == We use the Raspberry Pi OS, the system version is 2024-11-19-raspios-bookworm-arm64.img.xz. You can download it in: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit For core boards with eMMC, the OS is flashed onto the eMMC. If the core board does not have eMMC, the OS is flashed onto the TF card or NVMe SSD. Use a core board with eMMC. Before flashing the OS, please connect the power USB-C interface to the computer and short the BOOT jumper on the board: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_100.jpg Once the flashing process is complete, remove the shorting cap, then power on again to start the OS. For the flashing method, please refer to: [[S001 Flash OS EN|How to flash OS]] == '''IV. Work with Raspberry Pi OS''' == === 4.1 Test USB ports === ==== 4.1.1 USB port detection test ==== Plug the USB device into the USB port of the expansion board, then execute the command <code>lsusb</code> in the terminal: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_82.jpg http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_99.jpg '''Recognition is normal. If there are no external devices connected to the USB ports, the corresponding device numbers will not appear—only the USB hub will be shown.''' Then, execute <code>lsusb -t</code> to check whether the USB ports are operating in the correct mode. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_52.jpg Bus 02/04: 2*USB 3.0 ports with 5000Mbps speed. Bus 05: The expanded USB 2.0 Hub interface, 480Mbps. ==== 4.1.2 USB 3.0 Speed test ==== Insert two SSD drives (both NVMe M.2 SSDs) into two SSD-to-USB 3.0 enclosures respectively, then connect these two USB 3.0 enclosures to the two USB 3.0-A ports on the expansion board. Start the OS and copy large files between these two USB hard drives and the eMMC of the core board. The file is a single ZIP file with a size of 4.22GB, i.e., 33.75Gb. The test results are as follows: {| class="wikitable" |Data transfer direction |Time(s) |Transmission speed(MB/s) |Transmission speed(Gbps) |- |SSD1->SSD2 |15.6 |270.00 |2.16 |- |SSD2->SSD1 |13.27 |317.50 |2.54 |- |SSD1->eMMC |35.92 |117.50 |0.94 |- |eMMC->SSD1 |14.01 |301.25 |2.41 |- |SSD2->eMMC |36.06 |117.50 |0.94 |- |eMMC->SSD2 |14.13 |298.75 |2.39 |} '''''Note: The read/write speed of the USB 3.0 interface is affected by various factors such as hard drive quality, interface condition, and file storage status on the drive. The above test results are for reference only and do not represent the final specifications of the actual product.''''' ==== 4.1.3 USB 2.0 Speed test ==== Insert two SSD drives (One is a SATA M.2 SSD, and the other is an NVMe M.2 SSD.)) into two SSD-to-USB 2.0 enclosures respectively, then connect these two USB 2.0 enclosures to the two USB 2.0-A ports on the expansion board. Start the OS and copy large files between these two USB hard drives and the eMMC of the core board. The test results are as follows: {| class="wikitable" |Data transfer direction |Time(s) |Transmission speed(MB/s) |Transmission speed(Gbps) |Packet size(Mb) |- |NVME->SATA |46.19 |200.41 |1.60 |9256.96 |- |SATA->NVME |45.99 |201.28 |1.61 |9256.96 |- |NVME->eMMC |32.47 |285.09 |2.28 |9256.96 |- |eMMC->NVME |15.1 |613.04 |4.90 |9256.96 |- |SATA->eMMC |173.45 |288.1 |2.30 |49971.2 |- |eMMC->SATA |22.14 |418.11 |3.34 |9256.96 |} '''''Note: The read/write speed of the USB 2.0 interface is affected by various factors such as hard drive quality, interface condition, and file storage status on the drive. The above test results are for reference only and do not represent the final specifications of the actual product.''''' === 4.2 NVMe SSD test === 若使用无eMMC的树莓派CM5核心板,NVMe SSD可以启动系统,烧写和使用方法见烧写章节。此处将硬盘作为数据存储功能的测试。 ==== 4.2.1 SSD for data storage ==== The CM5 core board we use for testing comes with eMMC. Insert the SSD into the expansion board, power on to boot the OS, and execute <code>lspci</code> in the Raspberry Pi terminal to check the SSD information. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_23.jpg Then you need to authorize the SSD. In File Manager, click on the SSD partition, and an authorization dialog will pop up. Enter the current account password to authorize. <html><img src="http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_83.jpg" width=640></html> '''''Note: The first partition requires password authorization upon clicking; others only need a click.''''' After authorization, the partitions will appear on the desktop. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_20.jpg Execute <code>df</code> in the terminal to view the SSD partition information. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_21.jpg We can see two SSD partitions named nvme0n1p1 and nvme0n1p2. ==== 4.2.2 Test the speed of a PCIe Gen2 SSD ==== The default state is that the SSD runs on PCIe Gen2. Install the hard disk speed testing software hdparm: <code>sudo apt install hdparm</code> Execute the speed test command repeatedly to measure disk performance multiple times: <code>sudo hdparm -t /dev/nvme0n1</code> http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_73.jpg {| class="wikitable" |No. |Transmission speed(MB/s) |- |1 |451.06 |- |2 |450.92 |- |3 |450.62 |- |4 |450.85 |- |5 |450.91 |- |Avg. |450.87 (about 3.6Gbps) |} ==== 4.2.3 Test the speed of a PCIe Gen3 SSD ==== Please execute the following command in the terminal: <code>sudo nano /boot/firmware/config.txt</code> Then, add the following code at the end of the file: <code>dtparam=pciex1_gen=3</code> http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_24.jpg Save the changes, exit, and reboot the OS to switch to PCIe Gen3. Execute the speed test command repeatedly to measure disk performance multiple times: <code>sudo hdparm -t /dev/nvme0n1</code> http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_74.jpg {| class="wikitable" |No. |Transmission speed(MB/s) |- |1 |847.35 |- |2 |846.17 |- |3 |839.99 |- |4 |847.28 |- |5 |840.90 |- |Avg. |844.34 (about 6.8Gbps) |} It can be seen that the interface speed of an SSD under PCIe Gen3 is twice the tested value under PCIe Gen2. === 4.3 USB SD card test === The CM5_Basic expansion board features a USB 2.0-expanded SD interface for external storage. Insert an SD card, and its partitions will be detected in the Raspberry Pi OS. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_17.jpg http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_18.jpg Execute <code>df</code> in the terminal to view the partition information. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_14.jpg We can see two SD partitions named sda1 and sda2. Execute the speed test command repeatedly to measure disk performance multiple times: <code>sudo hdparm -t /dev/sda</code> http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_15.jpg The SD card's interface speed is around 32MB/s. Copy large files between an SD card and eMMC of the core board. The file is a single ZIP file with a size of 9256.96Mb. The test results are as follows: {| class="wikitable" |Data transfer direction |Time(s) |Transmission speed(MB/s) |- |SD->eMMC |35.79 |258.65 |- |eMMC->SD |49.37 |187.50 |} '''''Note: The interface speed of the SD card is affected by various factors such as SD card quality, interface condition, and file storage status on the drive. The above test results are for reference only and do not represent the final specifications of the actual product.''''' === 4.4 Ethernet ports test === The expansion board comes with a native Gigabit Ethernet port and a 10M/100M Ethernet port. After inserting the network cable into the 10M/100M Ethernet port, executing <code>ifconfig -a</code> displays the following: <html><img src="http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_84.jpg" width=640></html> We use the network speed testing tool iperf3 for speed tests. Download iperf3 for Windows: http://www.mcuzone.com/down/Software.asp?ID=10000634 Install iperf3 on Linux: <code>sudo apt-get install iperf3</code> Test the speed of the expanded 10M/100Mbps Ethernet interface: Client mode is around 93.8Mbps: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_05.jpg Server mode is around 95.0Mbps: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_06.jpg Test the speed of the expanded 10M/100Mbps Ethernet interface: client模式为938Mbps左右: Client mode is around 938Mbps: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_07.jpg Server mode is around 949Mbps: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_08.jpg '''''注意:网络测速受网络环境和测试方法影响,速度请以实际为准,本测试仅供参考。''''' === 4.5 RTC test === The CM5 core board comes with an RTC, while the expansion board requires an external battery and can be used directly under the Raspberry Pi OS . '''As shown in the following figure:''' http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_97.jpg After the OS starts, run the following in the Raspberry Pi terminal: <code>ls /dev/r*</code> You can see the RTC device: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_10.jpg The command to display the current system time is <code>date</code>; The command to write the system time to the RTC is <code>sudo hwclock -w</code>; The command to read the system time from the RTC is <code>sudo hwclock -r</code>. As shown below: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_11.jpg If the RTC battery is correctly connected at this time, the RTC will continue to keep accurate time after power loss, and upon the next power-on, it will maintain the correct time even without internet synchronization. If the RTC battery is not properly connected, the time will reset to the default (January 1, 1970) after power loss. === 4.6 PWM fan test === Installing the monitoring tool s-tui: <code>sudo apt install s-tui</code> Then, run s-tui in the Raspberry Pi terminal, and you can observe the changes in fan speed in the monitoring window. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_16.jpg If you need to customize the fan speed and operating temperature range, please open the terminal and execute the following commands: <code>sudo nano /boot/firmware/config.txt</code> Insert the following lines at the end of the file: <code>dtparam=cooling_fan=on</code> <code>dtparam=fan_temp0=50000,fan_temp0_hyst=5000,fan_temp0_speed=255</code> Among them: <code>fan_temp0=50000</code>, where 50000 represents the temperature, here it is 50°C. <code>fan_temp0_hyst=5000</code>, where 5000 denotes the hysteresis temperature, here it is 5°C. <code>fan_temp0_speed=255</code>, where 255 indicates the fan speed, with the maximum being 255. You can input multiple temperature ranges and their corresponding fan speeds, with each segment on a separate line, differentiated by unique numbering (e.g., 1., 2., 3., etc.): <code>dtparam=fan_temp1=36000,fan_temp1_hyst=5000,fan_temp1_speed=128</code> http://www.mcuzone.com/wiki/5003_CM5_Router/5003_CM5_Router_59.jpg === 4.7 DSI test === We tested with Raspberry Pi LCD screen, which requires separate power. ==== 4.7.1 Testing the Raspberry Pi 1st-Gen LCD Display ==== Connect the screen cable to the CSI/DISP 0 port on the expansion board, then power up the system. After the OS starts, open the terminal and execute the following commands. <code>sudo nano /boot/firmware/config.txt</code> Insert the following lines at the end of the file: <code>dtoverlay=vc4-kms-dsi-7inch,dsi0</code> http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_34.jpg After saving and restarting the OS, you can use the Raspberry Pi 7-inch touchscreen. The display effect is as shown below: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_72.jpg ==== 4.7.2 Testing the Raspberry Pi 2nd-Gen LCD Display ==== After the OS starts, open the terminal and execute the following commands: <code>sudo nano /boot/firmware/config.txt</code> Insert the following lines at the end of the file: <code>dtoverlay=vc4-kms-dsi-ili9881-7inch,dsi0</code> http://www.mcuzone.com/wiki/2009_CM4_SSD_WiFi6/2009_CM4_SSD_WiFi6_21.jpg After saving and restarting the OS, you can use the Raspberry Pi 7-inch touchscreen. ==== 4.7.3 Notes ====<!--'''''注意2:默认状态下,如果7寸触摸屏插在CSI/DSI 0接口上,该7寸屏将作为副屏,HDMI显示器将作为主屏;如果7寸触摸屏插在CSI/DSI 1接口上,该7寸屏将作为主屏,HDMI显示器将作为副屏。''''' '''''注意2:如果使用树莓派官方第二代液晶屏,添加的代码为:''''' <code>'''''dtoverlay=vc4-kms-dsi-ili9881-7inch,dsi1'''''</code>--> '''''Note 1: I'''f both the HDMI display and the 7-inch touchscreen are connected simultaneously, the 7-inch touchscreen may become the secondary screen. Simply power off the system, disconnect the HDMI display, and restart; the 7-inch touchscreen will then function as the primary display.'' '''''Note 2: If you need to use CSI/DISP 1, you must change "dsi0" to "dsi1" in the statement.''''' === 4.8 CSI test === The camera used for testing here is the OV5647, and the port is CSI0. Once the OS is running, open the terminal and execute the following commands: <code>sudo nano /boot/firmware/config.txt</code> Insert the following lines at the end of the file: <code>dtoverlay=ov5647,cam0</code> (If using the CSI/DSI 1 interface, please change cam0 to cam1) http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_36.jpg In actual use, add according to your specific model, save the settings, and restart the OS to enable the OV5647 camera. After the OS starts, execute the following command in terminal: <code>ls /dev/video*</code> You will then see the video0 device listed. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_37.jpg Execute <code>libcamera-hello --camera 0</code> in the terminal to open the corresponding camera for preview. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_38.jpg If a photo is required, please eexcute: <code>libcamera-jpeg -o test.jpg</code> The photos are saved in the <code>/home/mcuzone</code> directory (i.e., the user's home directory). The photo effects are as follows: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_39.jpg === 4.9 MiniPCIe 4G LTE test === Multiple 4G modules supported by our company are plug-and-play, requiring no drivers and dial-up. Our 4G models include CAT4 4G, Qualcomm 4G, Qualcomm 4G-GPS, ZTE CAT4 4G, and Quectel EC20 GPS Voice Lite Edition. Both the CAT4 4G and ZTE CAT4 4G are automatically recognized by the OS as eth devices, while the Qualcomm 4G/Qualcomm 4G-GPS and EC20 are automatically recognized as usb0. {| class="wikitable" |+ !Module !NL668-EU (soc from Qualcomm) !NL668-EAU (soc from Qualcomm) !NL668-AM (soc from Qualcomm) !Qualcomm 4G |- |BAND |• LTE FDD: B 1/3/5/7/8/20 • LTE TDD: B 38/40/41 • WCDMA: B 1/5/8 • GSM/GPRS/EDGE: 850/900/1800MHz |• LTE FDD: B 1/3/5/7/8/20/28 • LTE TDD: B 38/40/41 • WCDMA: B 1/5/8 • GSM/GPRS/EDGE: 850/900/1800MHz |• LTE FDD: B2/4/5/12/13/17/66/71 • WCDMA: B2/4/5 |• LTE FDD: B1/3/5/8 • LTE TDD: B34/38/39/40/41 • WCDMA: B 1/8 • EVDO/CDMA1X: BC0 • GSM/GPRS/EDGE: 900/1800MHz |} {| class="wikitable" |+ !Module !Qualcomm 4G-GPS !CAT4 4G !ZTE CAT4 4G !EG25-G |- |BAND |• LTE FDD: B1/3/5/8 • LTE TDD: B34/38/39/40/41 • WCDMA: B 1/8 • TD-SCDMA: B 34/39 • EVDO/CDMA1X: BC0 • GSM/GPRS/EDGE: 900/1800MHz |• LTE FDD: B1/3/5/8 • LTE TDD: B34/38/39/40/41 |• LTE FDD: B1/3/5/8 • LTE TDD: B34/38/39/40/41 |TE-FDD: B1/B2/B3/B4/B5/B7/B8/B12/B13/B18/ B19/B20/B25/B26/B28 LTE-TDD: B38/B39/B40/B41 UMTS: B1/B2/B4/B5/B6/B8/B19 GSM: B2/B3/B5/B8 |} Different versions of Raspberry Pi OS have varying strategies for network management. Based on the 64-bit OS version, the results are as follows: ▶ '''Qualcomm 4G/GPS and NL668-EU/EAU/AM, CAT4 4G:''' {| class="wikitable" |'''OS version''' |'''Test results''' |- |2023-02-21-bullseye | rowspan="7" |Auto-identification, plug and play, automatic internet connection. |- |2023-05-03-bullseye |- |2023-12-05-bookworm |- |2024-07-04-bookworm |- |2024-11-19-bookworm |- |2025-05-13-bookworm |- |2025-10-01-trixie |} ▶ '''EG25-G:''' {| class="wikitable" |'''OS version''' |'''Test results''' |- |2023-02-21-bullseye | rowspan="2" |Auto-identification, plug and play, automatic internet connection. |- |2023-05-03-bullseye |- |2023-12-05-bookworm | rowspan="5" |Auto-identification, but there may be instances of network connection failure, and the OS requires the installation of DNS software. |- |2024-07-04-bookworm |- |2024-11-19-bookworm |- |2025-05-13-bookworm |- |2025-10-01-trixie |} ==== 4.9.1 Identify 4G ==== For testing, using Qualcomm 4G as an example, execute <code>ifconfig -a</code> in the terminal: <html><img src="http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_85.jpg" width=640></html> The usb0 shown in the figure above is the 4G module, specifically the Qualcomm 4G LTE. If it is CAT4 4G or ZTE CAT4, the OS will recognize it as eth2 (the number in the "2" position may vary depending on the number of other wired networks present). Next, we will test the 4G network connection. If both Ethernet ports are also connected to the router at this time, before testing the 4G connection, first check the routing table by executing the <code>route</code> command. You will see that <code>eth1</code> is ranked first, so the system will prioritize internet access through the 100Mbps Ethernet port. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_54.jpg We unplugged the Ethernet cable of the 100Mbps port, restarted the OS, executed the <code>route</code> command to check the routing table, and found <code>usb0</code> ranked first, indicating that the OS was now connected to the internet via the 4G module. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_55.jpg Pinging both the IP and domain succeeds now, confirming the 4G module is working correctly. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_28.jpg ▶ Some versions of Raspberry Pi OSs can only ping IP addresses, but may encounter network failures when pinging domain names, reporting DNS errors: http://www.mcuzone.com/wiki/3012_CM4_5G_Mini/3012_CM4_5G_Mini_16.jpg At this point, the OS needs to install the DNS switching software udhcpc. Connect the Ethernet port of the expansion board to the upstream router, and then execute the following command in the terminal: <code>sudo apt install udhcpc</code> http://www.mcuzone.com/wiki/1005_Zero-DETH_DUSB/1005_Zero-DETH_DUSB_55.jpg After installation, unplug the network cable and execute: <code>sudo udhcpc -i eth1</code> Note: eth1 is the network identifier for the 4G module, please refer to the actual configuration. <html><img src="http://www.mcuzone.com/wiki/3104_CM4_CAT1/3104_CM4_CAT1_47.jpg" width=640></html> After the execution is completed, we ping the IP and domain name, and both are successful. Run a speed test at https://www.speedtest.cn/, and the results are as follows: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_29.jpg '''''Note: Network speed test results are affected by network conditions and testing methods. Actual speeds may vary. This test is for reference only.''''' <!--==== 4.9.2 网络优先级的修改 ==== 上一节我们查看了路由表,在扩展百兆网口不接网络的情况下,优先通过4G网络上网。 如果你不想用4G上网,要优先使用有线网络上网的话,可以运行命令: <code>sudo ip route del default && sudo route add -net default netmask 0.0.0.0 gw 192.168.8.1</code> 这两条命令(以“&&”分隔)的解释: <code>sudo ip route del default</code>:删除路由表中的默认路由; <code>sudo route add -net default netmask 0.0.0.0 gw 192.168.8.1</code>:添加有线网络的网关为新的默认路由(网关地址以实际为准)。 执行完毕后,再执行<code>route</code>,查看路由表,目前的默认路由为有线网络的网关(eth0排第一位): http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_56.jpg 这样网络就默认走有线网络了,如果需要改回默认走4G网络,请重启系统即可。 '''''注意,重启后路由表还是会恢复原状,所以如果重启后要网络继续默认走有线网络,需要再执行一次<code>sudo ip route del default && sudo route add -net default netmask 0.0.0.0 gw 192.168.8.1</code>。''''' ==== 4.9.3 AT命令操作 ==== 使用<code>lsusb</code>查看USB设备,红框处即为4G模组: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_31.jpg 记下4G模块的ID值:05c6 90b6 使用下列命令打开ttyUSB串口,其中echo后面的值就是上面记录的ID值: <code>sudo modprobe option</code> <code>sudo sh -c 'echo 05c6 90b6 > /sys/bus/usb-serial/drivers/option1/new_id'</code> 执行上述两条命令之后执行: <code>ls /dev/ttyUSB*</code> 此时应该能看到dev设备下有ttyUSB0-3四个设备: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_32.jpg 然后用串口工具打开特定串口(AT命令串口): 安装minicom工具: <code>sudo apt-get install minicom</code> 通过minicom打开AT命令串口: <code>sudo minicom -D /dev/ttyUSB0</code> (注意:使用哪个串口,应以在进入此串口后,可输入运行AT命令,显示不乱码,不乱跳结果为准) 如果需要查看回显,请键入命令:<code>ate1</code>,然后回车,继续键入其它命令,回车可以看到结果。 http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_33.jpg {{ATCOMM}} ==== 4.9.4 修改4G模组的IP地址 ==== 如果出厂默认的4G IP地址和用户使用的IP地址有冲突,或有修改IP地址的需求,可按照下列步骤进行修改: '''CAT4 4G模块:''' 执行AT命令: <code>AT+ROUTEIP=<newip></code> 注意,只支持192.168.x.1这样格式的地址,如果设置了<code>AT+ROUTEIP=192.168.3.1</code>,最终获得的IP为192.168.3.100,修改完后需断电重启系统。 查询当前IP:<code>AT+ROUTEIP?</code>,返回两个值,前一个为旧IP,后一个为新IP。 测试命令:<code>AT+ROUTEIP=?</code> '''高通 4G模块、ZTE CAT4 4G模块:''' 将4G模块的IP改为直接获取公网IP即可,请执行AT命令: 设置IP为公网:<code>AT+GTIPPASS=1</code> 设置IP为内网:<code>AT+GTIPPASS=0</code> 查询当前IP为公网还是内网:<code>AT+GTIPPASS?</code> 修改IP完毕后需要断电重启才能生效。--> ==== 4.9.2 GPS operation ==== Both the Qualcomm 4G-GPS and the EC20 GPS Voice Lite Edition support GPS functionality. 高Qualcomm 4G requires a passive GPS antenna, while the EC20 4G needs an active GPS antenna. In both cases, the GPS antenna must be extended outside the window to acquire satellite positioning. ===== 4.9.2.1 Qualcomm 4G-GPS operation ===== Install minicom: <code>sudo apt install minicom</code> <html><img src="http://www.mcuzone.com/wiki/3010_RPi_4B-4G_Probe/3010_RPi_4B-4G_Probe_58.jpg" width=640></html> Execute the command <code>lsusb</code>, as shown below: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_04.jpg Record the ID value of the 4G module: 05c6 90b6 Please use the following command to open the ttyUSB serial port (the value after echo is the ID value mentioned above): <code>sudo modprobe option</code> <code>sudo sh -c 'echo 05c6 90b6 > /sys/bus/usb-serial/drivers/option1/new_id'</code> After executing the above two commands, the OS should have three additional devices: ttyUSB0-2. You can check them by entering <code>ls /dev</code>: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_06.jpg Execute minicom and open the ttyUSB0 serial port. <code>sudo minicom -D /dev/ttyUSB0</code> (Note: Typically, three ports (ttyUSB0 to ttyUSB2)will appear. In general, the AT port is ttyUSB0 under most OSs. If that doesn't work, you may try other ports such as ttyUSB1. If multiple USB-to-serial devices are present, further attempts will be needed until the correct AT port is identified.) And execute: <code>at+gtgpsepo=1</code> //Enable AGPS <code>at+gtgpspower=1</code> //Enable GPS Please wait a moment for the positioning to succeed, then execute: <code>at+gtgps?</code> //View NMEA messages Then you can see the GPS information output: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_70.jpg ===== 4.9.2.2 Quectel EC20-GPS voice lite edition operation ===== Execute the command <code>lsusb</code>, as shown below: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_62.jpg Record the ID value of the 4G module: 2c7c 0125 Please use the following command to open the ttyUSB serial port (the value after echo is the ID value mentioned above): <code>sudo modprobe option</code> <code>sudo sh -c 'echo 2c7c 0125 > /sys/bus/usb-serial/drivers/option1/new_id'</code> After executing the above two commands, the system should have four additional devices: ttyUSB0-3. You can check them by entering <code>ls /dev/ttyUSB*</code>. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_63.jpg By default, the AT command serial port is ttyUSB3, and GPS information output serial port is ttyUSB1. Execute minicom and open the ttyUSB3 serial port. <code>sudo minicom -D /dev/ttyUSB3</code> and execute: <code>AT+QGPS=1</code> //Enable GPS Open '''ttyUSB1''' serial port by minicom, and you can obtain GPS information: <code>sudo minicom -D /dev/ttyUSB1</code> http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_64.jpg ==== 4.9.3 Other tests for 4G ==== For details, please click the link below: [[3007 CM4 4G Mini EN|3007_CM4_4G_Mini]] === 4.10 Button test === CM5_Basic expansion board comes with a button that functions as a power switch. When the device is on, pressing the button once will bring up the shutdown menu: http://www.mcuzone.com/wiki/5001_CM5_WiFi7-PoE/5001_CM5_WiFi7-PoE_47.jpg Press the button again to power off immediately. Power on by pressing the button once while in the shutdown state (requires power connection). === 4.11 HDMI test === The HDMI interface of the CM5_Basic expansion board supports 4K output, and the display effect is as shown below: 4K resolution (3840 × 2160) <html><img src="http://www.mcuzone.com/wiki/5007_CM5_NAS/5007_CM5_NAS_25.jpg" width=700></html> Compared to standard 1080p resolution (1920×1080) <html><img src="http://www.mcuzone.com/wiki/5007_CM5_NAS/5007_CM5_NAS_26.jpg" width=700></html> === 4.12 LoRa test === The expansion board R1.4 version has added support for LoRa functionality. The model of the LoRa module we used for testing is: E22 400T30E. This LoRa module supports interaction via RS232 interface, RS485 interface, and USB interface. On the CM5_Basic, you need to select the USB interface mode. Short-circuit the M0 and M1 jumpers to enter the USB interface mode. The LoRa device will appear as a USB-to-serial device (ttyUSB0) in the OS. Note that here we only demonstrate the sending and receiving operations of the ttyUSB serial port. For specific LoRa module pairing and parameter configuration, please refer to the corresponding LoRa module user manual. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_96.jpg This paper demonstrates the transparent transmission mode by configuring two CM5_Basic expansion boards + LoRa modules. Assemble the LoRa modules on each of the two CM5_Basic expansion boards, then power on and start the OS. Under any Raspberry Pi OS with a CM5_Basic expansion board, enter <code>ls /dev/tty*</code> to check the serial port device of the LoRa module, which is <code>ttyUSB0</code>. <html><img src="http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_88.jpg" width=640></html> Install the GUI serial port software CuteCom: <code>sudo apt install cutecom</code> Under a Raspberry Pi OS with two CM5_Basic expansion boards, open a CuteCom window on each board and connect to their respective OS's ttyUSB0. When information is entered in the CuteCom window of one Raspberry Pi OS with a CM5_Basic expansion board, the previously entered information will be output in the CuteCom window of the other Raspberry Pi OS with a CM5_Basic expansion board. <html><img src="http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_89.jpg" width=900 style="border: 1px solid black;"></html> == '''V. Work with Ubuntu OS''' == == '''VI. Optional accessories''' == === 6.1 NVMe-WiFi7 adapter === The expansion board features an onboard M.2 M-key interface, which can be used with an NVMe to WiFi7 adapter to provide a WiFi7 interface. It supports WiFi7 (BE200), WiFi6E (AX210), and WiFi6 (AX200), and also enables Bluetooth functionality. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_98.jpg The Raspberry Pi OS only supports a single WiFi connection. For the Raspberry Pi CM5 module with built-in WiFi functionality, after installing the WiFi7 driver, the CM5's WiFi will be automatically disabled. Therefore, we recommend using a CM5 module without WiFi. In our tests, we used the BE200. In the terminal, execute <code>lspci</code>, and the part marked with a red box is the BE200 WiFi7 module. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_23.jpg ==== 6.1.1 Test WiFi7 ==== ===== 6.1.1.1 Install driver ===== '''''(This step is applicable to both the AX200 and AX210)''''' Update header files in the terminal: <code>sudo apt install -y raspberrypi-kernel-headers firmware-iwlwifi flex yacc</code> http://www.mcuzone.com/wiki/5001_CM5_WiFi7-PoE/5001_CM5_WiFi7-PoE_19.jpg Then download the source code: <code>mkdir wifi && cd wifi</code> <code>wget <nowiki>http://www.mcuzone.com/wiki/2004_CM4_WiFi7/backport-iwlwifi-20231029.tar.bz2</nowiki></code> <code>sudo tar -xvf backport-iwlwifi-20231029.tar.bz2</code> http://www.mcuzone.com/wiki/5001_CM5_WiFi7-PoE/5001_CM5_WiFi7-PoE_20.jpg Prepare the compilation environment: <code>sudo make defconfig-iwlwifi-public</code> <code>sudo sed -i 's/CPTCFG_IWLMVM_VENDOR_CMDS=y/# CPTCFG_IWLMVM_VENDOR_CMDS is not set/' .config</code> http://www.mcuzone.com/wiki/5001_CM5_WiFi7-PoE/5001_CM5_WiFi7-PoE_21.jpg Compile source code: <code>sudo make -j 4</code> <code>sudo make install</code> '''''Note: If the system freezes or reports errors during compilation when using <code>-j 4</code>, please try compiling with <code>-j 2</code> or <code>-j 1</code> instead.''''' http://www.mcuzone.com/wiki/5001_CM5_WiFi7-PoE/5001_CM5_WiFi7-PoE_22.jpg http://www.mcuzone.com/wiki/5001_CM5_WiFi7-PoE/5001_CM5_WiFi7-PoE_23.jpg The OS is now prompting a restart. Please hold off on restarting for now. '''Install the firmware (only for BE200, AX200 or AX210, no need to install the firmware):''' <code>cd ..</code> <code>cd Downloads</code> <code>wget <nowiki>http://www.mcuzone.com/wiki/0011_MPW7/firmware_wifi7.zip</nowiki></code> <code>unzip firmware_wifi7.zip</code> <code>sudo cp iwlwifi-gl-c0-fm-c0-86.ucode /lib/firmware</code> <code>sudo cp iwlwifi-gl-c0-fm-c0.pnvm /lib/firmware</code> http://www.mcuzone.com/wiki/5001_CM5_WiFi7-PoE/5001_CM5_WiFi7-PoE_24.jpg Restart the OS: <code>sudo reboot</code> ===== 6.1.1.2 Test WiFi7 ===== After restarting the OS, we can use the WiFi7 module to connect to the wireless AP. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_46.jpg '''''Note: The core board's built-in WiFi module has been automatically turned off and replaced with the WiFi 7 module.''''' In the network connection information, we can also see that this connection uses the iwlwifi driver (if it's the wireless network card integrated on the core board, the driver will be displayed as brcmfmac): http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_47.jpg Execute the command <code>ifconfig -a</code> in the terminal: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_48.jpg "wlan0" refers to the WiFi7 module. ==== 6.1.2 WiFi7 (BE200) Bluetooth test ==== The BE200 WiFi7 module comes with a built-in USB Bluetooth interface, Now, plug the Bluetooth USB connector into the USB 2.0 slot on the extension board (refer to the image below), and additional Bluetooth driver installation is required for use. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_90.jpg ===== 6.1.2.1 Install Bluetooth driver ===== Execute the command in the terminal: <code>cd Downloads</code> <code>wget <nowiki>http://www.mcuzone.com/wiki/5001_CM5_WiFi7-PoE/intel.zip</nowiki></code> <code>sudo cp intel.zip /lib/firmware/intel && cd /lib/firmware/intel</code> <code>sudo unzip intel.zip</code> If there are file name conflicts while extracting, choose "A" (replace all). http://www.mcuzone.com/wiki/5001_CM5_WiFi7-PoE/5001_CM5_WiFi7-PoE_50.jpg Then restart the OS: <code>sudo reboot</code> ===== 6.1.2.2 Bluetooth test ===== Execute the command in the terminal: <code>hciconfig -a</code> http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_40.jpg There are two visible devices: hci0 is the core board's onboard Bluetooth (manufactured by Cypress Semiconductor, a UART device), while hci1 belongs to the BE200 (manufactured by Intel, a USB device). Both Bluetooth interfaces are currently active. In order to test hci1, we need to disable hci0. Please execute the following command in the terminal: <code>sudo hciconfig hci0 down</code> (If you need to enable this device, please run <code>sudo hciconfig hci0 up</code>.) Now, executing <code>hciconfig -a</code> shows that <code>hci0</code> is down. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_41.jpg Click the Bluetooth icon at the top-right of the desktop, then choose "Add Device..." from the menu. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_42.jpg Put the target device in discoverable mode, and the Bluetooth module will scan and find it shortly. This example uses a Bluetooth mouse: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_43.jpg Select the mouse, click "Pair", and it will connect successfully after a short wait. http://www.mcuzone.com/wiki/5001_CM5_WiFi7-PoE/5001_CM5_WiFi7-PoE_55.jpg We can operate this mouse in the Raspberry Pi OS. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_44.jpg Execute the command in the terminal: <code>hcitool -i hci1 con</code> You can view the status of the devices connected to this Bluetooth. http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_45.jpg === 6.2 NVMe-AI TPU adapter === http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_81.jpg The CM5_Basic expansion board comes with an onboard M.2 M-key interface, which can be used with an NVMe to WiFi 6 adapter board to implement the TPU function. For detailed operation steps, please refer to [[0006 MPTPU(M.2 E) EN#III. Work with Raspberry Pi OS|here]]. '''''Note: The version of the Raspberry Pi OS must be 2024-11-19-raspios-bookworm-arm64.img.xz or 2024-07-04-raspios-bookworm-arm64.img.xz. If you install it under the 2025-05-13-raspios-bookworm-arm64.img.xz, the following error will occur when installing gasket-dkms_1.0-18_all.deb:''''' <html><img src="http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_95.jpg" width=640></html> '''''Now, just revert to the old OS version.''''' === 6.3 NVMe-AI Hailo8 adapter === http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_80.jpg The CM5_Basic expansion board comes with an onboard M.2 M-key interface, allowing direct connection to the HAILO 8L AI module. When paired with a camera module (this article uses the OV5647 camera connected to the CSI/DISP 0 interface), it enables image recognition and detection functions. For detailed operation steps, please refer to [[0028 MPWAI#3.2 配置AI模块(HAILO 8L)|here]]. '''''Note: The Raspberry Pi OS version must be 2024-05-13-raspios-bookworm-arm64.img.xz or 2024-07-04-raspios-bookworm-arm64.img.xz. If you install it on the 2025-11-19-raspios-bookworm-arm64.img.xz, an error will occur when executing the command <code>hailortcli fw-control identify</code>, and the AI module will not be recognized. Additionally, when installing on the 2025-11-19-raspios-bookworm-arm64.img.xz, firmware configuration is not required.''''' {{Contact_Us_icon}}
该页面使用的模板:
模板:Contact Us icon
(
查看源代码
)
返回
5002 CM5 Basic/AI/Lora/4G EN
。