In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces how to migrate the Linux system to the EC20 4G module, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Hardware platform: i.MX6Q development board
1. 4G network connection
For embedded Linux, 4G network connection is a relatively easy function, most 4G module interfaces are MiniPCIE interfaces, but after a deep understanding, we will find that the communication interface of 4G module is USB, so the driver of 4G module is USB driver. As long as the USB driver is normal, 4G module can communicate normally on hardware. Let's take a look at the hardware schematic of the 4G module:
2. EC20 4G module configuration 2.1. Add USB device information
To use the EC20 4G module, you first need to add the USB information of EC20 to the Linux kernel, so that the EC20 4G module can be correctly identified after the kernel starts. Open the drivers/usb/serial/option.c file under the Linux kernel and add the following information:
The configuration is shown in figure 2.2.1:
The configuration is shown in figure 2.2.2:
The configuration is shown in figure 2.2.3:
It can be seen that the EC20 4G module is identified successfully, and five USB devices are virtual, which are ttyUSB0~ttyUSB4.
3. EC20 4G module networking test 3.1. Compilation of PPP software package
First copy ppp-2.4.4.tar.gz to Ubuntu, and then execute the following command to extract:
Tar-xvf ppp-2.4.4.tar.gz
After decompressing, you can get the ppp-2.4.4 directory and enter the ppp-2.4.4 directory as shown in figure 3.1.1:
After the configuration is complete, compile using the following command:
Make CC=arm-linux-gnueabihf-gcc
"CC=arm-linux-gnueabihf-gcc" specifies the compiler, which uses the same compiler as the Linux kernel of the development board. The compilation is completed as shown in figure 3.1.3:
When the development board is ready, start the Linux system. After the system starts, enter the / etc directory, and then create the ppp directory. The specific commands are as follows:
Cd / etc / / enter the etc directory
Mkdir ppp / / create a ppp directory
After the directory is created, use the USB drive to copy the four executable files chat, pppd, pppdump, and pppstats compiled in the previous section to the / etc/ppp directory, as shown in figure 3.2.2:
Enter the following:
Here the words OK\ rAT+CGDCONT=1, "IP", "3gnet", 0 OK-AT-OK ATDT*99# will change according to Mobile Unicom or Telecom, where Mobile 4G is used.
Create a wcdma-chat-disconnect file:
Touch wcdma-chat-disconnect
Vi wcdma-chat-disconnect
The contents are as follows:
The figure above shows that the IP address after successful networking is 10.47.135.182. Use the ifconfig command to view the result as shown in figure 3.2.4:
Found that ping can not be connected to the public network, willing to be because DNS is not set up, there is a file resolv.conf under etc. This file is used to put DNS. This is the domain name that is not set up correctly. However, it is mandatory to copy this file to 192.168.1.1 in eth0's run script. As a result, even if you set the correct DNS in the file here, you will find that it already contains 192.168.1.1 when you turn it on. This is because eth0 is self-booting.
Let's create a new file resolv.conf_back in the / etc directory:
Touch resolv.conf_back
Vi resolv.conf_back
Enter the following:
Nameserver 202.99.160.68nameserver 221.130.33.52nameserver 221.130.33.60nameserver 192.168.1.1
Then create a new script file ppp0:
Touch ppp0
Vi ppp0
Enter the following:
#! / bin/shifconfig eth0 downcp / etc/resolv.conf_back / etc/resolv.conf/etc/ppp/pppd call wcdma&
Modify the execution permissions of the ppp0 file:
Chmod 777 ppp0
The first step here is to turn off eth0, the second step is to overwrite our DNS file on resolv.conf, and the third step is to run it. Then reboot and execute the ppp0 script with the following command:
/ etc/ppp0
After the script executes successfully, re-use the ping command
Displays the IP address that can ping Baidu normally. At this point, the EC20 4G module can be used normally.
On the Linux system to move away from the EC20 4G module migration method is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.