跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
Mcuzone Wiki
搜索
搜索
登录
个人工具
登录
查看“0024 M4GUSB EN”的源代码
页面
讨论
大陆简体
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
←
0024 M4GUSB EN
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
[[0024 M4GUSB|切换语言为中文]] == '''Keywords''' == 4G LTE,CAT4,EG25-G,Qualcomm 4G, GPS, NL668-EU/EAU/AM,AT Commands, Raspberry Pi OS, Ubuntu, OpenWrt, Driver-free, Plug-and-Play == '''I. Introduction''' == The M4GUSB is a 4G module expansion board specifically designed for the Raspberry Pi 5. It is driver-free, requires no dial-up, and is automatically recognized and Plug-and-Play on the official Raspberry Pi OS, Ubuntu, and OpenWRT. The 4G LTE is a USB device designed based on the Raspberry Pi's USB port, with optional GPS functionality. Some 4G models support VoLTE for sending text messages and making phone calls (but without audio). The 4G module we use has a CAT4 speed, with theoretical speed values of 150Mbps (DL)/50Mbps (UL). The 4G module is also compatible with Raspberry Pi 4B/3B. == '''II. Hardware Spec''' == 1). 1* USB port, is provided to achieve both communication and power supply. It comes in two specifications: USB-C and 1.25mm-4P interface, you can choose to use one of them. 2). 1* MiniPCIe 4G LTE module. 3). 1* Nano SIM card slot. And a nano SIM card slot is reserved, supporting single card and single standby. 4). 1* 4G reset button, and a reset pin is reserved. 5). 3* auxiliary power supply interfaces: USB-C, MicroUSB, and a 2-pin header, (If the USB power supply from the Raspberry Pi is insufficient for the 4G module, the 4G module can be powered through this interface; controlled by a power switch). 6). 1* power switch. 7). 1* IPEX-1 antenna interface. 8). Size: 85*56mm; 9). The circuit board employs immersion gold technology and is produced using lead-free processes. The PCB board is UL and ROHS certified, with a flammability rating of 94V-0. 10). Aluminum alloy casing(OPT.) http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_90.jpg http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_88.jpg http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_92.jpg {| 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 |} {| class="wikitable" |+ !4G Module !Status LED |- |CAT4 4G |The blinking pattern, where the light is on for 1.8 seconds and off for 0.2 seconds (alternatively, you can judge by the light being on longer than it is off), indicates that the 4G module has connected to the network. The blinking pattern, where the light is off for 1.8 seconds and on for 0.2 seconds, indicates that there is an issue with the SIM card or the network. Please check the SIM card and the antenna. |- |Qualcomm 4G |If the LED is blinking slowly with occasional rapid flashes in between, it indicates that the 4G module has connected to the network. Otherwise, it suggests there might be an issue with the SIM card or the network; please check the SIM card and the antenna. |- |ZTE CAT4 4G |If the LED is rapid flashes, it indicates that the 4G module has connected to the network. Otherwise, it suggests there might be an issue with the SIM card or the network; please check the SIM card and the antenna. |- |EG25-G |The light remains on for a longer duration and off for a shorter duration, it indicates that the 4G module has connected to the network. Otherwise, it suggests there might be an issue with the SIM card or the network; please check the SIM card and the antenna. |} Antenna connection instructions for 4G modules, applicable to all 4G modules tested in this document (GPS/GNSS is optional): http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_74.jpg == '''III. Work with Raspberry Pi OS''' == Raspberry Pi OS: 2024-07-04-raspios-bookworm-arm64.img.xz You can download it in: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit 4G module is automatically recognized in the Raspberry Pi OS, requiring no drivers or dial-up. CAT4 4G is recognized as an eth device in the OS, while Qualcomm 4G and EG25-G are recognized as usb0 devices. === 3.1 Qualcomm 4G/GPS and NL668-EU/EAU/AM === 高通方案的4G型号有5款:高通4G,高通4G-GPS,NL668-EU/EAU/AM。其中高通4G是纯数据4G网络,其他4款(高通4G-GPS,NL668-EU/EAU/AM)均带有GPS功能,均需接无源GPS天线。所有4G在树莓派系统里均自动识别成USB0设备,免驱免拨号,操作方法一致。 ==== 3.1.1 4G connection ==== After starting Raspberry Pi OS, execute <code>lsusb</code>, as shown in the following image: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_01.jpg From the image above, we can see that the 4G module (usb0) has successfully obtained an IP address. We can now ping external network addresses, such as: <code>ping www.mcuzone.com</code> http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_02.jpg It is also possible to connect to the external network via a 4G module and access a [https://www.speedtest.cn/ speed test website] to measure the speed, with the results as follows: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_03.jpg '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' ==== 3.1.2 GPS test ==== If you use GPS functionality, requiring the connection of a GPS passive antenna, and ensuring that the GPS antenna is extended outdoors. GPS is operated via AT commands. Execute <code>lsusb</code> in terminal: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_04.jpg Record the ID value of the 4G module: 05c6 90b6 Use the following command to open the ttyUSB serial port, where the value after echo is the ID recorded above: <code>sudo modprobe option</code> <code>sudo sh -c 'echo 05c6 90b6 > /sys/bus/usb-serial/drivers/option1/new_id'</code> After execution is complete, the system should have four additional devices: ttyUSB0 - ttyUSB2, execute <code>ls /dev</code> to view. Install minicom: <code>sudo apt-get install minicom</code> Open AT Command serial port by minicom: <code>sudo minicom -D /dev/ttyUSB0</code> 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 === 3.2 CAT4 4G === By executing <code>ifconfig -a</code> in the Raspberry Pi terminal, we can see that the 4G module (eth1) has successfully obtained an IP address. http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_15.jpg We can ping external network addresses, such as: <code>ping www.mcuzone.com</code> http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_16.jpg It is also possible to connect to the external network via a 4G module and access a [https://www.speedtest.cn/ speed test website] to measure the speed, with the results as follows: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_45.jpg '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' === 3.3 ZTE CAT4 4G === By executing <code>ifconfig -a</code> in the Raspberry Pi terminal, we can see that the 4G module (eth1) has successfully obtained an IP address. http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_15.jpg We can ping external network addresses, such as: <code>ping www.mcuzone.com</code> If the server name cannot be found, please install udhcpc: <code>sudo apt install udhcpc</code> Please execute the following after successful installation: <code>sudo udhcpc -i eth1</code> then ping: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_16.jpg It is also possible to connect to the external network via a 4G module and access a [https://www.speedtest.cn/ speed test website] to measure the speed, with the results as follows: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_17.jpg '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' <!--=== 3.4 EC20-GPS voice lite version === ==== 3.4.1 Module connection ==== Currently (after 2024), the EC20 modules we ship are pre-configured to be driver-free in the Raspberry Pi OS, offering plug-and-play functionality with automatic recognition. Connecting the EC20 to a Raspberry Pi for dial-up internet access is also possible, but it is quite complex and cumbersome. Additionally, settings need to be configured every time the system starts, making it not recommended for use. Below are the tests conducted when set to driver-free mode: Executing <code>ifconfig -a</code> in the Raspberry Pi terminal: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_44.jpg You can see that the OS recognizes the EC20 as the usb0 device and has obtained an IP address. We can ping external network addresses, such as: <code>ping www.mcuzone.com</code> http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_32.jpg If the server name cannot be found, please install udhcpc after connecting the Ethernet cable. <code>sudo apt install udhcpc</code> Please execute the following after successful installation: <code>sudo udhcpc -i eth1</code> Then proceed to perform the ping operation. The speed test of the 4G module, connecting to the external network, and accessing the [https://www.speedtest.cn/ speed test website] to measure the speed, with the results as follows: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_47.jpg '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' ==== 3.4.2 Send SMS ==== Sending text messages involves using AT commands. Here, we will introduce the process of sending SMS using English characters. Before using AT commands, you need to open the serial port. Execute the command <code>lsusb</code> in the Raspberry Pi terminal, as shown in the following image: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_34.jpg Record the ID value of the 4G module: 2c7c 0125 Use the following command to open the ttyUSB serial port, where the value after echo is the ID recorded above: <code>sudo modprobe option</code> <code>sudo sh -c 'echo 2c7c 0125 > /sys/bus/usb-serial/drivers/option1/new_id'</code> Then execute <code>sudo minicom -s</code>, select "Serial port setup": http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_100.jpg Press A and F to modify the serial port number and flow control as shown in the figure below: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_101.jpg After making the modifications, press Enter to return to the previous menu, and select "Exit" to quit: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_102.jpg Execute the following AT commands in sequence: <code>AT+CMGF=1</code> //Set the SMS characters to English <code>AT+CMGS="13xxxxxxxxx"</code> //Set the number to receive SMS messages After pressing Enter, input the SMS content after the ">", then press Ctrl+Z to send. A successful send will display "+CMGS 14": http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_103.jpg http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_104.jpg ==== 3.4.3 Receive or make phone calls ==== Making or receiving phone calls is also done through AT commands, requiring the connection of an Android headset. For instructions on how to enable AT commands, please refer to the "Send SMS" section. '''Make a phone call:''' Execute AT command: <code>ATD13xxxxxxxxx;</code> //The phone number to be dialed, note that it must end with a ";" Wait a moment for the call to connect successfully. When minicom display "OK", the other party will start ringing. There will be no prompt when they answer. After the call ends, hanging up will be indicated by "NO CARRIER": The following demonstrates a process of dialing, ringing, answering, and hanging up: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_105.jpg '''Answer the phone call:''' If there is an incoming call, "RING" will be displayed in minicom as the ring alert, and then the following AT commands can be used for control: <code>ATA</code> //Answer the phone call <code>ATH</code> //Hanging up the phone call The following demonstrates a process of ringing, answering, and hanging up: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_106.jpg ==== 3.4.4 GPS test ==== To use the GPS on the EC20, you need to connect an active GPS antenna and ensure that the GPS antenna is extended outdoors. The GPS is operated via AT commands. Open ttyUSB3 serial port by minicom: <code>sudo minicom -D /dev/ttyUSB3</code> and execute: <code>AT+QGPS=1</code> http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_63.jpg 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 If you find the raw GPS data in minicom not very intuitive, we can install gpsd to extract the GPS information: <code>sudo apt-get install gpsd gpsd-clients</code> http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_65.jpg Then configure the gpsd software: <code>sudo gpsd /dev/ttyUSB1 -N -D 9 -F /var/run/gpsd.sock -S 3333</code> http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_66.jpg '''''Note: 3333 is the listening port, which can be customized as needed.''''' Do not close the configuration terminal window, instead, open a new terminal window and execute: <code>cgps -s localhost:3333</code> http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_67.jpg From the output interface, information such as time, latitude and longitude, speed, and altitude can be seen. http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_68.jpg--> === 3.4 EG25-G === ==== 3.4.1 4G connection ==== Currently (after 2025), the EG25-G modules we ship are pre-configured to be driver-free on the Raspberry Pi OS, offering plug-and-play functionality with automatic recognition. Our driver-free testing is as follows: Execute <code>ifconfig -a</code> in terminal: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_109.jpg The OS recognizes the EG25-G as the usb0 device and has obtained an IP address. We can ping external network addresses, such as: <code>ping www.mcuzone.com</code> http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_110.jpg If the server name cannot be found, please plug in the network cable and install udhcpc. <code>sudo apt install udhcpc</code> Please execute the following after successful installation: <code>sudo udhcpc -i usb0</code> Then proceed to perform the ping operation. It is also possible to connect to the external network via a 4G module and access a [https://www.speedtest.cn/ speed test website] to measure the speed, with the results as follows: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_111.jpg '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' ==== 3.4.2 GPS test ==== To use the GPS on the EG25-G, you need to connect an active GPS antenna and ensure that the GPS antenna is extended outdoors. The GPS is operated via AT commands. Open AT Command serial port(ttyUSB3) by minicom: <code>sudo minicom -D /dev/ttyUSB3</code> And execute: <code>AT+QGPS=1</code> http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_112.jpg Execute minicom, open the ttyUSB1 serial port, and you can obtain GPS information. <code>sudo minicom -D /dev/ttyUSB1</code> <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_113.jpg" width=640></html> == '''IV. Work with Ubuntu OS''' == Ubuntu OS: ubuntu-24.04-preinstalled-desktop-arm64+raspi.img.xz You can download it in: https://ubuntu.com/download/raspberry-pi The 4G module is automatically recognized in the Ubuntu OS, driver-free and dial-up-free, and is automatically identified as a device starting with "enx...". === 4.1 Qualcomm 4G and CAT4 4G === After the system starts, by executing <code>ifconfig -a</code> in the terminal, we can see that the 4G module (network interface starting with enx...) has successfully obtained an IP address: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_08.jpg We can ping external network addresses, such as: <code>ping www.mcuzone.com</code> http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_09.jpg Connect to the external network via a 4G module and access a [https://www.speedtest.cn/ speed test website] to measure the speed, with the results as follows: '''CAT4 4G:''' http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_10.jpg '''Qualcomm 4G:''' http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_31.jpg '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' === 4.2 ZTE CAT4 4G === After the system starts, by executing <code>ifconfig -a</code> in the terminal: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_22.jpg We can see that the system has identified the 4G module (the network card that starts with enx..., in this case enx344b50000000, please verify against actual conditions), and it has correctly acquired an IP address. We can ping external network addresses, such as: <code>ping www.mcuzone.com</code> http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_80.jpg Connect to the external network via a 4G module and access a [https://www.speedtest.cn/ speed test website] to measure the speed, with the results as follows: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_24.jpg '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' <!--==== 4.1.3 EC20-GPS voice lite version ==== The EC20 module comes pre-configured from the factory. Under the Ubuntu OS, the module is driver-free, does not require dial-up, is automatically recognized, and is identified as a device starting with "enx...". After the system starts, running <code>ifconfig -a</code> in the terminal shows that the 4G module has obtained an IP address. http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_76.jpg After that, you can ping the URL: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_77.jpg The operation steps for sending SMS, making phone calls, and using GPS functions with the EC20 module are consistent with those on the Raspberry Pi OS. Please refer to the relevant content in the previous chapter.--> === 4.3 EG25-G === The EG25-G module comes pre-configured from the factory. Under the Ubuntu OS, the module is driver-free and does not require dial-up. It is automatically recognized and identified as a device starting with "enx". After the OS starts, run <code>ifconfig -a</code> in the terminal, and you will see that the 4G module has obtained an IP address. <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_114.jpg" width=700></html> After that, you can ping the URL: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_115.jpg Connect to the external network via a 4G module and access a [https://www.speedtest.cn/ speed test website] to measure the speed, with the results as follows: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_116.jpg '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' The operating steps for the GPS function of the EG25-G module are consistent with those under the Raspberry Pi OS. Please refer to the relevant content in the previous chapter. == '''V. 4G related operations''' == === 5.1 AT command operation === The usage of AT commands is the same in both Raspberry Pi OS and Ubuntu OS. Here, the operations are demonstrated using the Raspberry Pi OS as an example. Taking Qualcomm 4G as an example, execute <code>lsusb</code> in terminal: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_04.jpg Record the ID value of the 4G module: 05c6 90b6 Use the following command to open the ttyUSB serial port, where the value after echo is the ID recorded above: <code>sudo modprobe option</code> <code>sudo sh -c 'echo 05c6 90b6 > /sys/bus/usb-serial/drivers/option1/new_id'</code> http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_05.jpg After execution is complete, the system should have three additional devices: ttyUSB0 - ttyUSB2, execute <code>ls /dev</code> to view: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_06.jpg Then, use a serial port tool to operate AT commands. There are two types of serial port tools, and you can choose one to use: 1. Open the AT command serial port through minicom: <code>sudo minicom -D /dev/ttyUSB1</code> 2. Or execute the following command to open CuteCom: <code>sudo cutecom</code> Select the correct serial port in CuteCom and open it, or open minicom. Note: Which serial port to use should be determined by the ability to enter and execute AT commands without garbled or erratic output after accessing that serial port. '''Below is an example using minicom:''' If you need to view the echo, please type the command <code>ate1</code>, then execute other commands. Use <code>AT+CPIN?</code> to check if the SIM card is properly inserted and recognized. Use <code>AT+CSQ</code> to check the signal strength. The first value ranges from 0 to 31, and a value above 25 indicates good signal quality. Use <code>AT+COPS?</code> to check the status of the registered network. The content within the double quotes is the operator code, and the last digit represents the network mode, where 7 stands for 4G. http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_96.jpg === 5.2 Common AT commands === 1. Check if the SIM card is detected: <code>at+cpin?</code> Return ready to indicate the card has been recognized, if return error, you need to check the hardware. 2. Check antenna signal quality: <code>at+csq</code> 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: <code>at+cops?</code> Normally, it should return the network supporter's code: 7, where 7 represents 4G. Note: The above command <code>at+csq</code> should not include a question mark, while the other two commands require a question mark. 4. View the SIM card's IMEI code: <code>at+cgsn</code> 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> 6. Disable radio frequency: <code>at+cfun=0</code> Enable radio frequency: <code>at+cfun=1</code> 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. === 5.3 AT command documentation download URL === CAT4 4G: http://www.mcuzone.com/wiki/0024_MP4GUSB/Luat4G_AT_V4.3.5.pdf Qualcomm 4G(GPS): http://www.mcuzone.com/wiki/0024_MP4GUSB/NL_AT_User_Manual_V1.0.0_Draft.pdf ZTE CAT4: http://www.mcuzone.com/wiki/0024_MP4GUSB/L716-CN-10_AT_User_Manual.pdf === 5.4 Modify the IP address of the 4G module === If the default 4G IP address assigned at the factory conflicts with the IP address being used by the user, or if there is a need to modify the IP address, you can change the 4G module's IP. '''1. Qualcomm 4G, ZTE CAT4 4G:''' Set the 4G module's IP to directly obtain a public IP. Please execute the AT command: Set the IP to public: <code>AT+GTIPPASS=1</code> Set the IP to private: <code>AT+GTIPPASS=0</code> Check whether the current IP is a public or private IP: <code>AT+GTIPPASS?</code> After modifying the IP, a power cycle reboot is required for the changes to take effect. '''2. CAT4 4G:''' Execute the AT command: <code>AT+ROUTEIP=<newip></code> Note: only addresses in the format of 192.168.x.1 are supported. If you set <code>AT+ROUTEIP=192.168.3.1</code>, the final IP address obtained will be 192.168.3.100. After making the changes, you need to power off and restart the OS. Query current IP: <code>AT+ROUTEIP?</code>, it returns two values, the first one is the old IP, and the second one is the new IP. Test command: <code>AT+ROUTEIP=?</code> '''3. We are not know''' '''how to modify the IP address of EG25-G, If needed, users are required to research it themselves.''' === 5.5 FAQ === ==== 5.5.1 What should I do if I can't ping a domain name? ==== '''Q:''' After executing <code>ifconfig -a</code>, you can see that an IP address has been obtained, but you are unable to ping a domain name. How can this issue be resolved? '''A:''' If pinging the IP address is successful, it indicates that the 4G module can access the internet normally. If pinging the domain name fails (as shown in the figure below), then there is an issue with the DNS server resolution. http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_77.jpg Plug an Ethernet cable into the Gigabit Ethernet port of the Raspberry Pi 5 to connect to the internet via cable. Then install the DNS server switching software udhcpc(Using Ubuntu OS and ZTE CAT4 as examples): <code>sudo apt install udhcpc</code> After installation is complete, unplug the network cable and execute(Please execute <code>ifconfig -a</code> to check the network identifier following <code>-i</code>, and then view the corresponding 4G module information): <code>sudo udhcpc -i enx344b50000000</code> Then you can ping the URL: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_23.jpg ==== 5.5.2 What should I do if I have to run udcpc every time the system starts? ==== '''Q:''' For a 4G module that needs to connect to the internet by modifying the DNS server, it can connect normally after installing and running udcpc. However, udcpc needs to be run every time the system reboots. If you want to automatically connect to the internet via the 4G network upon startup, what should you do? '''A:''' you need to add a startup command in the rc.local file. You can refer to the following steps(Taking Qualcomm 4G as an example, usb0 is the network identifier of the 4G module, which can be seen by executing <code>ifconfig -a</code>. Please refer to the actual situation for details): Enable rc-local service: <code>sudo systemctl enable --now rc-local</code> Open the rc.local file using the following command: <code>sudo nano /etc/rc.local</code> Add the commands you want to execute on startup above "exit 0": <code>sleep 5 && sudo udhcpc -i usb0 && sleep 5 && sudo udhcpc -i usb0 && sleep 5 && sudo udhcpc -i usb0</code> The purpose of the sleep command is to delay the execution of subsequent commands by a specified number of seconds. Since it takes some time for the 4G module to obtain an IP address, to prevent udhcpc from failing, it is necessary to execute the command multiple times with a certain delay between each execution. As a result, the 4G network will be available approximately 20 seconds after the system starts up. Then save the file, so that the OS can automatically connect to the internet via the 4G module upon startup. == '''VI. Work with OpenWrt''' == The OpenWrt was compiled by Mcuzone, and the version is: openwrt-bcm27xx-bcm2712-rpi-5-squashfs-sysupgrade-linux-6.1.100-20240805.img.gz This section uses a CAT4 4G module as an example to explain the operation of a 4G module under the OpenWrt. === 6.1 Login System === Connect the Ethernet port of the Raspberry Pi 5 to the Ethernet port of the PC. After the system starts up, we navigate to Network & Internet in Windows Settings, open the connected network under Ethernet to view the default gateway's IP address. This address is the backend configuration page address for the OpenWrt. As shown in the figure, the address tested in this article is 192.168.198.1. http://www.mcuzone.com/wiki/2001_CM4_Ultra/2001_CM4_Ultra_53.jpg Open a web browser and enter 192.168.198.1 to access the OpenWrt. The default username is <code>root</code>, and the default password is <code>password</code>. http://www.mcuzone.com/wiki/2001_CM4_Ultra/2001_CM4_Ultra_54.jpg Log in to the "System - TTYD Terminal" and execute <code>ifconfig -a</code>: http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_40.jpg We can see that the system has recognized the 4G module (eth1), but it has not yet obtained an IP address. Next, we will proceed to add the 4G interface. === 6.2 Add 4G network === In "Network - Interfaces", click "Add New Interface": http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_41.jpg Set the interface name to WAN, select DHCP client for the interface protocol, choose eth1 for the interface, and then click the "Submit" button. http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_42.jpg After selecting the WAN port in the firewall settings, click the "Save & Apply" button. http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_43.jpg In the "Network - Interfaces" section, we can see that eth1 has already obtained an address as the WAN port. http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_44.jpg Return to "System - TTYD Terminal", and after logging in, execute <code>ifconfig -a</code>: http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_45.jpg We can see that the 4G module(eth1) has successfully obtained an IP address, and we can ping external network addresses, such as: <code>ping www.mcuzone.com</code> http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_46.jpg The PC can now connect to the external network via the 4G module and access the [https://www.speedtest.cn/ speed test website]. The results are as follows: http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_47.jpg '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' === 6.3 AT command operation === If you want to use AT commands on 4G modules, you need to install a serial tool first. If the system does not have a serial tool, it will not be possible to use them. The system demonstrated here already has the minicom installed. The specific steps are as follows: Log in to the "System - TTYD Terminal" and execute <code>ifconfig -a</code>: http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_39.jpg Record the ID value of the 4G module: 1286 4e3d Use the following command to open the ttyUSB serial port, where the value after echo is the ID recorded above: <code>modprobe option</code> <code>sh -c 'echo 1286 4e3d > /sys/bus/usb-serial/drivers/option1/new_id'</code> http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_48.jpg After execution is complete, the system should have 3 additional devices: ttyUSB0 - ttyUSB2, execute <code>ls /dev</code> to view: http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_49.jpg Open AT Command serial port by minicom: <code>minicom -D /dev/ttyUSB1</code> (Note: Which serial port to use should be determined by the ability to enter and execute AT commands without garbled or erratic output after accessing that serial port.) If you need to view the echo, please type the command <code>ate1</code>, then execute other commands. Type the AT command and press Enter to see the result: http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_50.jpg == '''VII.4G application 1 (Remote Connection to Raspberry Pi)''' == With the Raspberry Pi paired with 4G module and using the official remote control software Raspberry Pi Connect, you can securely access your Raspberry Pi from anywhere in the world. The configuration and usage instructions are as follows: 1. Apply for a Raspberry Pi ID at https://id.raspberrypi.com/. 2. Install the Raspberry Pi Connect software in the Raspberry Pi OS (no need to install if it is already installed): <code>sudo apt install rpi-connect</code> 3. Restart the system, and in the GUI, sequentially select the items as shown in the following image to ensure that Raspberry Pi Connect is turned on: <html><img src="http://www.mcuzone.com/wiki/0002_MPS2280iPoE/MPS2280iPoE_08.png" width=550></html> <html><img src="http://www.mcuzone.com/wiki/1002_Zero_4G_Cat1/1002_Zero_4G_Cat1_13.jpg" width=550></html> 4. In the upper right corner, there will be a Raspberry Pi Connect icon. http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_38.jpg 5. Click on this icon, select "Sign in" and use your previously registered Raspberry Pi ID to log in on the pop-up webpage. Then set the device name. http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_39.jpg 6. After successfully logging in, access https://connect.raspberrypi.com/ in a browser on Windows and log in. <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_40.jpg" width=640></html> 7. Click "Connect via" to choose between using Screen sharing or the Remote shell Interface. http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_41.jpg 8. Screen sharing is as follows: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_73.jpg The remote shell line interface is as follows: <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_43.jpg" width=640></html> 9. Measured data usage: Under remote desktop, the Raspberry Pi consumes about 2MB of data per minute; under The remote shell is as follows: line interface, the Raspberry Pi consumes about 100KB of data per minute. == '''VIII. 4G application 2 (Create WiFi hotspot to share 4G)''' == === 8.1 Raspberry Pi OS === Under the Raspberry Pi OS, we can create a hotspot using the built-in WiFi (such as on the Raspberry Pi 5) and then share the Raspberry Pi's network connection through the hotspot. This chapter introduces how to connect the Raspberry Pi OS to a CAT4 4G network, establish a WiFi hotspot, and allow other devices to use the 4G data connection through this hotspot. The steps are as follows: ==== 8.1.1 Establish a WiFi hotspot ==== After the Raspberry Pi OS boots up and successfully connects to the 4G network, click the network icon in the upper right corner to open the wireless network options. http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_48.jpg Under "Advanced Options", click "Create Wireless Hotspot..." <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_49.jpg" width=550></html> In the pop-up window, enter the network name (SSID) for the hotspot. Enable the wireless encryption options below as needed. After completing the setup, click "Create". http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_50.jpg If the creation is successful, the internal IP address of the hotspot will immediately be displayed under the network icon (the fourth icon from the left with up and down arrows in the image below): http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_51.jpg By executing <code>ifconfig -a</code> in the Raspberry Pi terminal, you can view the information of the hotspot (wlan0): http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_52.jpg We can also click on the network icon in the upper right corner, then under "Advanced Options" click on "Connection Information..." (highlighted in red) to view the hotspot details. <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_93.jpg" width=550></html> <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_53.jpg" width=450></html> ==== 8.1.2 Application Operation ==== Connect to this hotspot using your phone: <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_94.jpg" width=450></html> We conducted a speed test on the [https://www.speedtest.cn speed test website], and the results are as follows: <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_54.jpg" width=450></html> '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' Download and install the terminal software MobaXterm on your PC. The download link for MobaXterm is: https://mobaxterm.mobatek.net/download-home-edition.html Connect the PC to this hotspot, then use an SSH tool like MobaXterm to successfully connect to the Raspberry Pi OS. This way, you can wirelessly control the development board via the 4G network without the need for an Ethernet cable or other networks, providing great convenience for on-the-go debugging. <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_107.jpg" width=550></html> <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_55.jpg" width=700></html> === 8.2 Ubuntu OS === Under the Ubuntu OS, we can create a hotspot using the built-in WiFi (such as on the Raspberry Pi 5) and then share the Raspberry Pi's network connection through the hotspot. The steps are as follows: ==== 8.2.1 Establish a WiFi hotspot ==== After the Ubuntu OS starts up and successfully connects to the 4G network, click the network icon in the upper right corner, then click the arrow next to "Wi-Fi" to open the wireless network options. <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_56.jpg" width=450></html> Click "All Networks" to open Wi-Fi settings: <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_57.jpg" width=550></html> Click "Turn On Wi-Fi Hotspot...", enter the network name (SSID) and password (at least 8 characters) in the pop-up window, then click "Turn On". http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_58.jpg http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_97.jpg Thus, the hotspot setup is complete. <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_60.jpg" width=550></html> By executing <code>ifconfig -a</code> in the terminal, you can view the information of the hotspot (wlan0): http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_61.jpg ==== 8.2.2 Application Operation ==== Connect to this hotspot using your phone: <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_98.jpg" width=450></html> We conducted a speed test on the [https://www.speedtest.cn speed test website], and the results are as follows: <html><img src="http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_62.jpg" width=450></html> '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' {{Contact_Us_icon}} [http://wiki.mcuzone.com/index.php?title=0024_M4GUSB%EF%BC%88%E6%A0%91%E8%8E%93%E6%B4%BE5%E7%9A%84USB4G%EF%BC%89 T]
本页使用的模板:
模板:Contact Us icon
(
查看源代码
)
返回
0024 M4GUSB EN
。
开关有限宽度模式