Realization of 4G module PPP dial-up Internet "turn" on Arm-linux

Source: Internet
Author: User
Tags nameserver

This article was reproduced from: http://blog.csdn.net/zqixiao_09/article/details/52540887

In the arm platform to implement the 4G module PPP dial-up Internet access, reference information on the Internet and their own understanding, from the ignorance to the development of the completion of more than a week. Finally see the arm board Ping Pass Www.baidu.com is very happy, now this process is organized as follows. There is, of course, a lot more work to do.

The SIMTech sim7100c,sim7100c used by the 4G module comes with a UART and USB interface, and we use the USB interface to communicate with the arm at the speed of consideration. So add support for the 3G module driver (USB to serial port drive) and PPP protocol to the Linux kernel, then compile the kernel and download it to the Development Board.

1. Compiling the kernel

◇ High Capacity Storage drive

> Device Drivers > USB Support
Make Arch=arm menuconfig Configure USB drive:
<*> USB Mass Storage Support
[*] USB Mass Storage Verbose debug
<*> Realtek Card Reader Support
[*] Realtek Card Reader autosuspend Support
<*> Datafab Compact Flash Reader Support

◇usb Drive

> 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 Drive

> 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-compiling LIBUSB

Download Usblib libraries and Libusb-compat

https://sourceforge.NET/projects/libusb/files/

[Email protected]:/opt/usb-tools/libusb-1.0.20# mkdir Install
Configure:error: "Udev support requested and Libudev not installed" (FIX: Add--disable-udev)
[Email protected]:/opt/usb-tools/libusb-1.0.20#./configure--host=arm-none-linux-gnueabi--prefix=/opt/usb-tools/ Libusb-1.0.20/install--disable-udev
[Email protected]:/opt/usb-tools/libusb-1.0.20# make
[Email protected]:/opt/usb-tools/libusb-1.0.20# make install

Add environment variable http://www.linuxidc.com/Linux/2011-03/33432.htm (pkg_config_path setting)

[Email protected]:/opt/usb-tools/libusb-1.0.20# Export pkg_config_path=/opt/usb-tools/libusb-1.0.20/install/lib/ Pkgconfig: $PKG _config_path
[Email protected]:/opt/usb-tools/libusb-1.0.20# echo $PKG _config_path

Compile Libusb-compat:

[Email protected]:/opt/usb-tools/libusb-compat-0.1.5#./configure--host=arm-none-linux-gnueabi--prefix=/opt/ Usb-tools/libusb-compat-0.1.5/install
[Email protected]:/opt/usb-tools/libusb-compat-0.1.5# make
[Email protected]:/opt/usb-tools/libusb-compat-0.1.5# make install

Copy the generated library files under libusb-1.0.20 and libusb-compat-0.1.5 to the Linux/lib on the arm board.

3. Cross-compiling 4G module driver

Cross-compile gobiserial.c (arch=arm cc=arm-none-linux-gnueabi-gcc) to get Gobiserial.ko. Copy to arm board Mount driver

#insmod Gobiserial.ko

4. View Drive Health

Plug in the 4G module, virtual out of 6 Ttyusb, respectively:

[Email protected]:/# ls/dev/ttyusb*
/dev/ttyusb0/dev/ttyusb1/dev/ttyusb2/dev/ttyusb3/dev/ttyusb4/dev/ttyusb5
1)/dev/ttyusb0-diag port for output developing messages
2)/dev/ttyusb1-nmea port for GPS NMEA data output
3)/dev/ttyusb2-at port for AT commands
4)/dev/ttyusb3-modem Port for Ppp-dial
5)/dev/ttyusb4-audio Port
6)/dev/ttyusb5-virtual Net card

Plug in the USB flash drive to 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:9001
Bus 002 Device 002:id 058f:6387
Bus 001 Device 001:id 1d6b:0002
Bus 002 Device 001:id 1d6b:0002

5. Cross-Compiling PPP

See also: http://blog.sina.com.cn/s/blog_7880d3350102wb3e.html

6. Dial-up script settings

[Email protected]:/etc/ppp# VI gprs-connect-chat
#Chat script for China Mobile, used simcom sim4100 TD module.
TIMEOUT 15
ABORT "DELAYED"
ABORT "BUSY"
ABORT "ERROR"
ABORT "NO Dialtone"
ABORT "NO CARRIER"
TIMEOUT 40
"' \rat
OK ats0=0
OK ATE0V1
Ok at+cgdcont=1, "IP", "CMNET"
OK at+cgeqreq=1,2,128,384,,, 0,,,,,,
OK atdt*99*1#
CONNECT
[Email protected]:/etc/ppp/peers# VI gprsdial
#/etc/ppp/peers/gprsdial
# PPPD script for China Mobile, used simcom SIM7100 Module
# USAGE:ROOT&GT;PPPD Call GPRS
#Interface should be used is the Interface which connects physics Interface of S
/dev/ttyusb3
115200
Crtscts
Modem
#noauth
Debug
Nodetach
#hide-password
Usepeerdns
Noipdefault
Defaultroute
User "Cmnet"
0.0.0.0:0.0.0.0
#ipcp-accept-local
#ipcp-accept-remote
#lcp-echo-failure 12
#lcp-echo-interval 3
#noccp
#novj
#novjccomp
#persist
Connect '/usr/sbin/chat-s-v-f/etc/ppp/gprs-connect-chat '
#disconnect '/bin/chat-v-f/etc/ppp/gprs-disconnect-chat '

6. Dialing

[Email protected]: PPPD call gprsdial

6. Testing

After dialing the test, found that can ping the IP but cannot ping the domain name. This requires setting/etc/resolv.conf to add the address of the DNS resolution server

File/etc/resolv.conf configures a DNS client that contains the domain name search order of the host and the address of the DNS server, each of which should contain one keyword and one or more parameters separated by spaces. Here is an example file:
Domain test.com
Search www.test.com test.com
NameServer 202.96.128.86
NameServer 202.96.128.166
NameServer #定义DNS服务器的IP地址
Domain #定义本地域名
Search #定义域名的搜索列表
Sortlist #对返回的域名进行排序
Mainly nameserver keywords, if not specified nameserver can not find the DNS server, other keywords are optional.
I have only set up two DNS here, as follows:
Ameserver 114.114.114.114
NameServer 8.8.8.8

Reference Documentation:
How to use the SIM7100 module in Linux.pdf
http://blog.csdn.net/hanmengaidudu/article/details/17099737
Http://www.linuxidc.com/Linux/2011-03/33430p2.htm
Http://www.linuxidc.com/Linux/2011-03/33430.htm

Realization of 4G module PPP dial-up Internet "turn" on Arm-linux

Related Article

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: info-contact@alibabacloud.com 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.