--------------------------------------------------------------------------------------------------------------- ---------------
Cross compiler: arm-linux-gcc-4.5.4
Linux kernel version: Linux-3.0
Host operating system: Centos 6.5
Development Board: FL2440
gprs:sim900a
Before developing the SIM900 module, the board has loaded the Linux kernel as well as the file system, and the Development Board serial port has been enabled. And be sure to note that: to have a phone card without a fee! don't laugh, this is a serious problem!
--------------------------------------------------------------------------------------------------------------- ---------------
The source code required:
Ppp-2.4.4.tar.gz http://download.chinaunix.net/download.php?id=35208&ResourceID=8334
Note: Personally think this is a more typical and relatively simple transplant problem.
General Step: Add kernel PPP Support--compile ppp-2.4.4 generate some executables (pppd, chat, Pppdump, pppstats) into the/usr/sbin/directory of the Development Board-- Place the executable script at the specified location on the board (/ETC/PPP/PEERS/GPRS,/etc/ppp/chat-gprs-connect) and execute the PPPD command.
First, add kernel support
Linux-3.0 above version, rt3070 's driver has been added to the kernel source code, this article uses the Linux-3.0 kernel, only need to choose the support of PPP Internet in the kernel make menuconfig.
Modify the following:
Device Drivers--->
[*] Network Device Support--->
<*> PPP (Point-to-Point Protocol) support
[*] PPP Multilink Support (experimental)
<*> PPP support for async serial ports
<*> PPP support for sync TTY ports
<*> SLIP (serial line) support
[*] Cslip Compressed headers
Second, compiling ppp-2.4.4
# TAR-XZF Ppp-2.4.4.tar.gz
#./configure
# Make CC=/OPT/BUILDROOT-2012.08/ARM920T/USR/BIN/ARM-LINUX-GCC (cross compiler)
If the compilation succeeds, the executable program PPPD, chat, Pppdump, Pppstats will be generated under PPPD, chat, Pppdump, Pppstats, respectively. Copy it to the/usr/sbin directory of the Development Board.
Three, the Development Board configuration
# Vi/etc/ppp/peers/gprs
1# usage:root>PPPD Call GPRS2 3#Setseriral4/dev/ttyS15 6#Setbaudrate7 1152008 9#SetflowdateTen nocrtscts One AConnect'/usr/sbin/chat-v-f/etc/ppp/gprs-connect-chat' - -#SetDebug, send Message to/var/log/Messages the Debug - - #To Keep PPPD on the terminal - Nodetach + -#hide-Password + A# Accept The Peer's idea of our local IP address atipcp-accept-Local -# Accept The Peer's idea of the ITS (remote) IP address -ipcp-accept-Remote - -#dial up Connetion asThedefaultRoute - Defaultroute in -Usepeerdns
# Vi/etc/ppp/chat-gprs-connect
1#Copyright (c) .Guanlei995318056@qq. com2# this isSecond part of the PPP dial script. It'll perform the connection3 #4ABORT'BUSY'5ABORT'NO ANSWER'6ABORT'NO CARRIER'7ABORT'NO Dialtone'8ABORT'ERROR'9ABORT'\nring\r\n\r\nring\r'TenTIMEOUT - One "'\rat A#SetAPN -OK at+cgdcont=1,"IP","cmnet" - # ............ theOK atdt* About***1#//this will be changed to the corresponding operator's settings -SAY"+ requesting data connection\n" -CONNECT"' -SAY"+ connected\n"
Enable to PPPD:
# PPPD Call GPRS & (& run in the background)
After the configuration is ready, you can now test the Internet function:
# ping Www.baidu.com
PING www.baidu.com (103.235.46.39): Data bytes
Bytes from 103.235.46.39:seq=0 ttl=48 time=555.719 ms
Bytes from 103.235.46.39:seq=1 ttl=48 time=273.481 ms
---www.baidu.com ping statistics---
3 packets transmitted, 2 packets received, 33% packet loss
Round-trip Min/avg/max = 273.481/414.600/555.719 ms
# ifconfig
Ppp0 Link Encap:point-to-point Protocol
inet addr:10.110.1.110 p-t-p:192.200.1.21 mask:255.255.255.255
Up Pointopoint RUNNING noarp multicast mtu:1500 metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 Txqueuelen:3
RX bytes:686 (686.0 b) TX bytes:557 (557.0 b)
GPRS module PPP dial-up network under Linux