3G module debugging under android2.1 (3)

Source: Internet
Author: User
Tags dns2
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
  1. #! /System/bin/sh
  2. # An unforunate wrapper script
  3. Pppd_pid =
  4. /System/bin/setprop
    "Net. GPRS. PPP-Exit"
    ""
  5. /System/bin/log
    -T pppd "Starting pppd"
  6. /System/bin/pppd call GPRS $ *
  7. Pppd_exit = $?
  8. Pppd_pid = $!
  9. /System/bin/log
    -T pppd "pppd exited with $ pppd_exit"
  10. /System/bin/setprop
    "Net. GPRS. PPP-Exit"
    "$ Pppd_exit"
  11. Exit $ pppd_exit

2. GPRS-connect-chat

  1. Abort
    'Busy'
  2. Abort 'no carrier'
  3. Abort 'error'
  4. Abort '+ CME error: 100'
  5. ""
  6. OK at + cgdcont = 1, "ip", "cmnet"
  7. OK at + cgeqreq = 128,384, "0e0", "0e0 ",
  8. OK
  9. OK
  10. OK ats0 = 0
  11. OK
  12. OK
  13. OK atdt * 98*1 #
  14. Connect

3. GPRS-Disconnect-chat

  1. Abort OK
  2. Abort busy
  3. Abort delayed
  4. Abort "No answer"
  5. Abort "no carrier"
  6. Abort "No dialtone"
  7. Abort voice
  8. Abort Error
  9. Abort ringing
  10. Timeout 12
  11. "" \ K \ D ++ ATH
  12. "No carrier-at-OK"
    ""

4. IP-up

  1. #! /System/bin/sh
  2. /System/bin/setprop
    "Net. Interfaces. defaultroute"
    "GPRS"
  3. /System/bin/setprop
    "Net. GPRS. dns1" "$ dns1"
  4. /System/bin/setprop
    "Net. GPRS. dns2" "$ dns2"
  5. /System/bin/setprop
    "Net. GPRS. Local-IP"
    "$ Iplocal"
  6. /System/bin/setprop
    "Net. GPRS. Remote-IP"
    "$ Ipremote"
  7. Exit 0

5. IP-down

  1. #! /System/bin/sh
  2. Case $1 in
  3. Ppp1)
  4. Echo 0>/proc/sys/NET/IPv4/ip_forward;
  5. ;;
  6. Esac
  7. Rm/etc/PPP *. PID
  8. # Use Interface Name
    If linkname is not available
  9. Name =$ {linkname:-"$1 "}
  10. #/System/bin/setprop
    "Net. dns1 """
  11. #/System/bin/setprop
    "Net. dns2 """
  12. /System/bin/setprop
    "Net. $ name. Local-IP"
    ""
  13. /System/bin/setprop
    "Net. $ name. Remote-IP"
    ""

6. Peers/GPRS

  1. #
    This is pppd script, used Huawei em770w3g Module
  2. # Usage: root> pppd call GPRS
  3. /Dev/ttyusb0
  4. 115200
  5. Crtscts
  6. Modem
  7. Debug
  8. Nodetach
  9. Usepeerdns
  10. Noipdefault
  11. Defaultroute
  12. User "cmnet"
  13. 0.0.0.0: 0.0.0.0
  14. Connect '/system/bin/chat-S-v-F/etc/PPP/GPRS-connect-chat'
  15. # 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.

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.