How does one implement 4g communication on Linux and 4g communication on linux?

Source: Internet
Author: User
Tags define local stop script define dns nameserver

How does one implement 4g communication on Linux and 4g communication on linux?

The implementation of 4G module PPP dial-up Internet access on the ARM platform took more than a week from ignorance to development. Finally, I was very happy to see that the ARM board was successfully pinged through Now I will sort out the process as follows. Of course, there is still a lot to do.

4G modules use the SIM7100C and SIM7100C of simtech with uart and USB interfaces. In terms of speed, we use the USB interface to communicate with ARM. Therefore, add the driver of the 3G module (USB to serial port driver) and PPP protocol support to the Linux kernel, compile the kernel, and download it to the Development Board.

The workload mainly includes two parts, which are generally included in the module vendor Guide:

Linux driver layer support module start/stop script debugging 1. Compile the kernel

◇ Large-capacity storage drive

> Device Drivers> USB supportmake ARCH = arm menuconfig: <*> USB Mass Storage support [*] USB Mass Storage verbose debug <*> Realtek Card Reader support [*] Realtek Card Reader autosuspend support <*> Datafab Compact Flash Reader support

◇ USB driver

> Device Drivers > USB support<*>   Inventra Highspeed Dual Role Controller (TI, ADI, ...)               MUSB Mode Selection (Dual Role mode)  --->                 <*>     Platform Glue Layer (TI DSPS platforms)  --->                   MUSB DMA mode (Disable DMA (always use PIO))  ---><*>   USB Serial Converter support  --->[*]      USBGeneric Serial Driver <*>     USBdriver for GSM and CDMA modems

◇ PPP-driven

> Device Drivers > Network device support   <*>   PPP (point-to-point protocol) support             <*>     PPP BSD-Compress compression                             <*>     PPP Deflate compression                                   [*]     PPP filtering                                                <*>     PPP MPPE compression (encryption)                               [*]     PPP multilink support                     <*>     PPP over Ethernet                     <*>     PPP support for async serial ports        <*>     PPP support for sync tty ports      <*>   SLIP (serial line) support      [*]   CSLIP compressed headers
2. Cross-compile libusb
Root @ zhaoxc-VBox:/opt/usb-tools/libusb-1.0.20 # mkdir installconfigure: error: "udev support requested but libudev not installed" (resolution: Add -- disable-udev) root @ zhaoxc-VBox:/opt/usb-tools/libusb-1.0.20 #. /configure -- host = arm-none-linux-gnueabi -- prefix =/opt/usb-tools/libusb-1.0.20/install -- disable-udevroot @ zhaoxc-VBox: /opt/usb-tools/libusb-1.0.20 # makeroot @ zhaoxc-VBox:/opt/usb-tools/libusb-1.0.20 # make install

Add the environment variable PKG_CONFIG_PATH)

root@zhaoxc-VBox:/opt/usb-tools/libusb-1.0.20# export PKG_CONFIG_PATH=/opt/usb-tools/libusb-1.0.20/install/lib/pkgconfig:$PKG_CONFIG_PATHroot@zhaoxc-VBox:/opt/usb-tools/libusb-1.0.20# echo $PKG_CONFIG_PATH

Compile libusb-compat:

root@zhaoxc-VBox:/opt/usb-tools/libusb-compat-0.1.5# ./configure --host=arm-none-linux-gnueabi --prefix=/opt/usb-tools/libusb-compat-0.1.5/installroot@zhaoxc-VBox:/opt/usb-tools/libusb-compat-0.1.5# makeroot@zhaoxc-VBox:/opt/usb-tools/libusb-compat-0.1.5# make install

Copy the library files under the generated libusb-1.0.20 and libusb-compat-0.1.5 to the/lib of linux on the ARM board.

3. Cross-compile 4G module driver

Cross-compile GobiSerial. c (ARCH = arm CC = arm-none-linux-gnueabi-gcc) to get GobiSerial. ko. Copy to ARM board to install driver

#insmod GobiSerial.ko
4. view the driver running status

Plug in the 4G module and Virtualize 6 ttyUSB, which are:

root@am335x-evm:/# ls /dev/ttyUSB*/dev/ttyUSB0  /dev/ttyUSB1  /dev/ttyUSB2  /dev/ttyUSB3  /dev/ttyUSB4  /dev/ttyUSB51) /dev/ttyUSB0-diag port for output developing messages2) /dev/ttyUSB1- NMEA port for GPS NMEA data output3) /dev/ttyUSB2-AT port for AT commands4) /dev/ttyUSB3-Modem port for ppp-dial5) /dev/ttyUSB4-audio port6) /dev/ttyUSB5-Virtual Net card

Plug in the USB flash drive and prompt the device to run:

[75097.986054] usb 2-1: New USB device found, idVendor=058f, idProduct=6387[75097.993167] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3[75098.000689] usb 2-1: Product: Mass Storage[75098.004995] usb 2-1: Manufacturer: Generic[75098.009342] usb 2-1: SerialNumber: AC3DF2EE[75098.024341] usb-storage 2-1:1.0: USB Mass Storage device detected[75098.049922] scsi0 : usb-storage 2-1:1.0

Lsusb command to view the results:

Bus 001 Device 002: ID 1e0e:9001Bus 002 Device 002: ID 058f:6387Bus 001 Device 001: ID 1d6b:0002Bus 002 Device 001: ID 1d6b:0002
5. Cross-compilation PPP 6. Configure the dialing script
root@am335x-evm:/etc/ppp# vi gprs-connect-chat#Chat script for China Mobile, used SIMCOM sim4100 TD module.TIMEOUT 15ABORT "DELAYED"ABORT "BUSY"ABORT "ERROR"ABORT "NO DIALTONE"ABORT "NO CARRIER"TIMEOUT 40'' \rATOK ATS0=0OK ATE0V1OK AT+CGDCONT=1,"IP","CMNET"OK AT+CGEQREQ=1,2,128,384,,,0,,,,,,OK ATDT*99*1#CONNECT

Root @ am335x-evm:/etc/ppp/peers # vi gwsdial

#/etc/ppp/peers/gprsdial# This is pppd script for China Mobile, used SIMCOM SIM7100 Module# Usage: root>pppd call gprs#Interface should be used is the interface which connects physics interface of S/dev/ttyUSB3115200crtsctsmodem#noauthdebugnodetach#hide-passwordusepeerdnsnoipdefaultdefaultrouteuser "cmnet" 12#lcp-echo-interval 3#noccp#novj#novjccomp#persistconnect '/usr/sbin/chat -s -v -f /etc/ppp/gprs-connect-chat'#disconnect '/bin/chat -v -f /etc/ppp/gprs-disconnect-chat'
7. Dialing

Root @ am335x-evm: pppd call glassdial

8. Test

After dialing, perform a test and find that the ip address can be pinged but the domain name cannot be pinged. Set/etc/resolv. conf to add the DNS resolution server address.

File/etc/resolv. conf configures the DNS customer. It contains the domain name search sequence of the host and the address of the DNS server. Each line should contain one keyword and one or more parameters separated by spaces. The following is an example file:

Domain test. comsearch test. conameserver # define DNS Server IP address domain # define local domain name search # define domain name search list sortlist # Sort the returned domain Name

It is mainly the nameserver keyword. If nameserver is not specified, the DNS server cannot be found. Other keywords are optional.

I only set two DNS here, as shown below:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.