Now we will introduce how to implement PPP dial-up Internet access. Create the PPP directory under/system/etc and the following files under the PPP Directory: 1. init. GPRS-pppd
- #! /System/bin/sh
- # An unforunate wrapper script
- Pppd_pid =
- /System/bin/setprop
"Net. GPRS. PPP-Exit"
""
- /System/bin/log
-T pppd "Starting pppd"
- /System/bin/pppd call GPRS $ *
- Pppd_exit = $?
- Pppd_pid = $!
- /System/bin/log
-T pppd "pppd exited with $ pppd_exit"
- /System/bin/setprop
"Net. GPRS. PPP-Exit"
"$ Pppd_exit"
- Exit $ pppd_exit
2. GPRS-connect-chat
- Abort
'Busy'
- Abort 'no carrier'
- Abort 'error'
- Abort '+ CME error: 100'
- ""
- OK at + cgdcont = 1, "ip", "cmnet"
- OK at + cgeqreq = 128,384, "0e0", "0e0 ",
- OK
- OK
- OK ats0 = 0
- OK
- OK
- OK atdt * 98*1 #
- Connect
3. GPRS-Disconnect-chat
- Abort OK
- Abort busy
- Abort delayed
- Abort "No answer"
- Abort "no carrier"
- Abort "No dialtone"
- Abort voice
- Abort Error
- Abort ringing
- Timeout 12
- "" \ K \ D ++ ATH
- "No carrier-at-OK"
""
4. IP-up
- #! /System/bin/sh
- /System/bin/setprop
"Net. Interfaces. defaultroute"
"GPRS"
- /System/bin/setprop
"Net. GPRS. dns1" "$ dns1"
- /System/bin/setprop
"Net. GPRS. dns2" "$ dns2"
- /System/bin/setprop
"Net. GPRS. Local-IP"
"$ Iplocal"
- /System/bin/setprop
"Net. GPRS. Remote-IP"
"$ Ipremote"
- Exit 0
5. IP-down
- #! /System/bin/sh
- Case $1 in
- Ppp1)
- Echo 0>/proc/sys/NET/IPv4/ip_forward;
- ;;
- Esac
- Rm/etc/PPP *. PID
- # Use Interface Name
If linkname is not available
- Name =$ {linkname:-"$1 "}
- #/System/bin/setprop
"Net. dns1 """
- #/System/bin/setprop
"Net. dns2 """
- /System/bin/setprop
"Net. $ name. Local-IP"
""
- /System/bin/setprop
"Net. $ name. Remote-IP"
""
6. Peers/GPRS
- #
This is pppd script, used Huawei em770w3g Module
- # Usage: root> pppd call GPRS
- /Dev/ttyusb0
- 115200
- Crtscts
- Modem
- Debug
- Nodetach
- Usepeerdns
- Noipdefault
- Defaultroute
- User "cmnet"
- 0.0.0.0: 0.0.0.0
- Connect '/system/bin/chat-S-v-F/etc/PPP/GPRS-connect-chat'
- # Disconnect '/bin/chat-v-F/etc/PPP/GPRS-Disconnect-chat'
After the file is created, go to "Settings"-> "wireless controls (Wireless Network)"-> "Mobile Networks (Mobile Network)" after Android is started) "->" Access Points Name (Access Point) ", press the menu key to pop up the interface and select" New APN (New Access Point) ". Generally, you only need to enter" name) "and" APN "," MCC "and" MNC "are automatically generated after the network registration of the operator, and finally saved. Now you can access the Internet through GPRS.