SIM900GPRS Module PPP Dial-up Internet

Source: Internet
Author: User
Tags nameserver

One: Edit the Linux kernel to support PPP dial-up Internet
[email protected] linux-3.0]$ make Menuconfig

Device Dirver--->network device * * * CAIF Transport Drivers * * *<*>PPP (Point-to-Point Protocol) support [*] PPP Multilink Support (experimental) [*] PPP filtering<*>PPP support for Async serial ports<*>PPP support for sync TTY ports<*>PPP Deflate Compression<*>PPP bsd-compress Compression<*>PPP MPPE Compression (encryption) (experimental)<*>PPP over Ethernet (experimental)

Two: Compiling ppp-2.4.4.tar.gz
Download ppp-2.4.4.tar.gz
http://download.csdn.net/detail/zhyustar/1531748

[[email protected] ~]$ mkdir GPRS

[[Email protected] ~]$ CD GPRS

[Email protected] gprs]$ TAR-XZF ppp-2.4.4.tar.gz

[[email protected] gprs]$ ls

ppp-2.4.4 ppp-2.4.4.tar.gz

[Email protected] gprs]$ CD ppp-2.4.4

[[email protected] ppp-2.4.4]$ ls

[Email protected] ppp-2.4.4]$./configure

[Email protected] ppp-2.4.4]$ CD chat/

[[email protected] chat]$ ls
Chat.8 chat.c Makefile Makefile.linux makefile.sol2

[Email protected] chat]$ vim chat.c

[Email protected] chat]$ vim Makefile

[Email protected] chat]$ CD. /pppd

[Email protected] pppd]$ vim auth.c

[Email protected] pppd]$ vim Makefile


[[email protected] ppp-2.4.4]$ make

[[Email protected] ppp-2.4.4]$ CD Chat

[[email protected] chat]$ ls
Chat chat.8 chat.c chat.o Makefile makefile.linux makefile.sol2

[[Email protected] chat]$ file Chat
Chat:elf 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped

[[Email protected] pppd]$ file pppd
Pppd:elf 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped

Download the generated pppd and chats to your own development Board, put them in/usr/sbin, and modify the permissions
such as: chmod 777 Chat

Three: Making script files
GPRS module PPP dial-up Internet requires the following configuration files:
<1>/etc/ppp/peers/gprs
<2>/etc/ppp/chat-gprs-connect
By default, the file Gprs-connect-chat is established in the/etc/ppp/directory of the Development Board, which is the parameter to the chat process at the time of the PPP underlying session, and each line is a combined sequence of "expect/send".

A simple chat script has the following structure:
"At
OK ATDT Dialnumber
CONNECT ""
1) The modem expects an empty string. The meaning of this sentence is directly understood that the modem no matter what string received, first issued a string at;
2) Expect to receive an "OK" string and then send the string "ATDT Dialnumber"
3) If "Connect" is received, it is no longer sent and the data link is considered to be connected.
4) If time-out control is required, the following fields can be added:
TIMEOUT 10

5) If you want to increase the handling of special cases, add the following fields:
ABORT BUSY
ABORT NO ANSWER
ABORT ringing
This means: If you receive the string "BUSY", "NO ANSWER", "Ringing" exit execution.
Write the chat script as follows: This is all done on the Development Board
~>cd/etc
~>mkdir PPP
~>CD PPP
~>vi Gprs-connect-chat

#/etc/ppp/gprs-connect-chat#Copyright(c) .Hulu [email protected]# Second part of the PPP dial script. It'll perform the connection    ABORT           ' BUSY '    ABORT           ' NO ANSWER '    ABORT           ' NO CARRIER '    ABORT           ' NO dialtone '    ABORT           ' ERROR '    ABORT           ' \nring\r\n\r\nring\r '  "'\rat OK ATE0 SAY"Press Ctrl-c to break the connection process.\n"Ok' at+cgdcont=1, ' IP ', ' 3GNET '   //isp Access Gateway for China Unicom 3GNETOK atdt* About#       //change to your carrier number here. My number is unicom.#拨号上网 SAY"Waiting for connect...\n"CONNECT"'SAY"Connect success!\n"


To write a GPRS configuration file:
Its role is to provide configuration parameters for the PPPD process (see the output of Man 8 pppd, if there is a problem this will be a very important reference page), the content is as follows:
~>mkdir peers
~>CD peers
~>vi GPRS

#/etc/ppp/peers/gprs# USAGE:ROOT>PPPD Call GPRS#set seriral/dev/ttys1# set BaudRate  115200# Set Flowdate may be your serial port is required crtscts, hardware flow control, which is determined by your serial port, the general embedded system serial port without hardware flow control, do not need to add nocrtsctsNocrtscts#set Debug, send Message To/var/log/messagesDebug#To Keep PPPD on the terminalNodetach# Accept The peer's idea of our local IP addressIpcp-accept-local# Accept The peer's idea of its (remote) IP addressIpcp-accept-remote#dial up connetion as the default routeDefaultroute usepeerdns Noipdefault user Hulu Connect'/usr/sbin/chat-s-v-f/etc/ppp/chat-gprs-connect '

PPPD calls the chat session process to access the peer ISP, initiates the peer-to-peer pppd, and then the local PPPD negotiates the network parameters and CHAP/PAP authentication with the PPPD on the end, succeeding, then the NCP layer IP assignment.

Four: Test PPP dialing on the Development Board
To use Ping, you need to disable eth0, which is the network port, so that Ping is looking for a routed connection outside the PPP0 port
~>ifconfig eth0 Down
~>PPPD Call GPRS &//& is the meaning of the background execution. Only this background executes: We can check the Internet at the front desk.

If there is a ping 4.2.2.2, but PNG does not pass www.baidu.com, that is the problem of DNS
Workaround:
You may need to copy the contents of the/etc/ppp/resolv.conf (content being replaced by the newly acquired DNS) into/etc/resolv.conf or make a link to/etc/resolv.conf
You can also edit/etc/resolv.conf directly

~>vi/etc/resolv.conf
NameServer 4.2.2.2
NameServer 8.8.8.8

~>ifconfig

At this point about the SIM900GPRS Module PPP dial-up access to the success of the realization, you read friends have a problem direct private chat me!!

SIM900GPRS Module PPP Dial-up Internet

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.