Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use 4G Module in embedded Linux Series

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Embedded Linux series how to use 4G module, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

one

Introduction

With the rapid development of mobile communication technology, from 2G module a few years ago to 4G module which is widely used now, 5G module is very hot, but 5G module is not very mature. In addition, it is said that experts are already studying 6G. Mobile communication is really developing rapidly. With the continuous supply of their speed, the interface form of the module is also constantly changing. 2G module only needs serial port, and 4G module generally uses USB interface, of course, serial port is also possible, but the speed is slower. Because the driver of 4G module is more complex, if it is USB interface, it will be difficult to do it on ordinary MCU. At this time, the advantage of Linux system is reflected. Because of its complete driver support, it will be much easier to do 4G on Linux.

two

Environment introduction

2.1. Hardware 1) A NUC972 development board made by a third party on the Internet: friends who are interested in buying can go to their Taobao store to buy: https://s.click.taobao.com/X8mza8w2) moved away from the EC20 module, moved away from the modules made in the past few years, and was listed not long ago. 2.2. Software 1) Uboot continues to use what was used in the previous article without change. 2) Kernel should make some changes on the basis of the previous article. 3) Rootfs should be modified on the basis of the previous article generated by Buildroot.

three

Kernel configuration

Go to the kernel directory driver/usb/serial/ to modify the option.c file, add the VID and PID of the device: VID is 0x2c7ctern pid and configure the 0x0125 kernel

four

Buildroot configuration

Pppd configuration, used to generate pppd, pppdump and other related instructions, encountered a problem here, which was stuck for a long time. After checking pppd, a compilation error was reported, indicating that the utmp.h header file could not be found. Later, it was solved after consulting a former colleague for remote assistance. The following modifications are needed. It seems that we still have to study the compilation principle of buildroot, otherwise I really don't know how to solve the problem.

five

test

After downloading the above modified kernel and file system to the board and starting, plug in the EC20 of the USB interface. After boot (there is a GPIO on the EC20 module that controls boot), the following message is prompted to generate ttyUSBx (x is 0 to 4).

Using the lsusb instruction, we can see the USB devices corresponding to the above PID and VID. This step is the most critical step in debugging the 4G module, and more than half of the successful debugging work has been completed. In fact, as long as the completion of section 3 kernel configuration, you can achieve the above phenomenon. Then we can send some AT commands through the serial port to check some status of the module microcom-s 115200 / dev/ttyUSB2

AT is used to check whether Module and serial port are connected. Command format: AT command returns: OK (normal communication with serial port) (no return, no communication with serial port) AT+CPIN? (check the status of SIM card) enter and return: + CPIN:READY OK (normal). + CPIN:ERROR (indicates that the SIM card failed or did not insert the SIM card) AT+CSQ is used to detect the signal quality to determine whether you can log on to the network; command return: + CSQ: *, where * * should be between 10 and 31, the higher the value, the better the signal quality, # # should be 99. Otherwise, check that the antenna or SIM card is installed correctly and copy quectel-chat-connect quectel-chat-disconnect quectel-ppp to the / etc/ppp/peers directory (you need to create this directory with mkdir). Then use the following command to start ppp dialing, the last command & you can let pppd background run pppd call quectel-ppp & and then you can ping the extranet.

After reading the above, have you mastered how the embedded Linux series uses 4G modules? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report