Establish GPRS wireless MODEM dialing under LINLUX

Source: Internet
Author: User
Set up GPRS wireless MODEM dialing-Linux general technology-Linux technology and application information under LINLUX. The following is a detailed description. 1. Connect the wireless Modem to the serial port 1 (/dev/ttyS0) of the PC.

2. First Use minicom (we strongly recommend that you create a new Terminal in the linux graphical user interface and then run minicom) to set the speed to 57600, 8N1, and Hardware Flow Control.

3. Run AT to check whether OK is returned. If no result is returned, the serial port settings are incorrect, or the serial port rate settings of the Saro Modem are incorrect;

4. Enter AT + CSQ? Check the signal quality. If the result is similar to + CSQ: (the number before the comma is 12 ~ Between 31) is normal.

5. Enter AT + CGDCONT = 1, "IP", "cmnet" to check whether OK is returned. This command is used to set the Apn (access name ). If your Apn is another value, replace the cmnet value accordingly. For example, if your Apn is gdyd. yl, enter AT + CGDCONT = 1, "IP", "gdyd. yl ";

6. Enter ATDT * 99 *** 1 # to check whether CONNECT is returned. Under normal circumstances, CONNECT should be returned, and some data should appear later;

7. Exit the minicom software.

8. Run wvdialconf/etc/wvdial. conf. The system automatically finds the modem and installs it on ttyS0 at a rate of 57600, as shown in:

[Root @ test ppp] # wvdialconf/etc/wvdial. conf

Scanning your serial ports for a modem.


TtyS0 <* 1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 4800 baud

TtyS0 <* 1>: ATQ0 V1 E1 -- failed with 4800 baud, next try: 9600 baud

TtyS0 <* 1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 19200 baud

TtyS0 <* 1>: ATQ0 V1 E1 -- failed with 19200 baud, next try: 57600 baud

TtyS0 <* 1>: ATQ0 V1 E1 -- OK

TtyS0 <* 1>: ATQ0 V1 E1 Z -- OK

TtyS0 <* 1>: ATQ0 V1 E1 S0 = 0 -- OK

TtyS0 <* 1>: ATQ0 V1 E1 S0 = 0 & C1 -- OK

TtyS0 <* 1>: ATQ0 V1 E1 S0 = 0 & C1 & D2 -- OK

TtyS0 <* 1>: ATQ0 V1 E1 S0 = 0 & C1 & D2 + FCLASS = 0 -- OK

TtyS0 <* 1>: Modem Identifier: ATI? Siemens Mc35 Gprs Modem

TtyS0 <* 1>: Max speed is 57600; that shoshould be safe.

TtyS0 <* 1>: ATQ0 V1 E1 S0 = 0 & C1 & D2 + FCLASS = 0 -- OK


Found a modem on/dev/ttyS0.

Modem configuration written to/etc/wvdial. conf.

TtyS0 : Speed57600; init "ATQ0 V1 E1 S0 = 0 & C1 & D2 + FCLASS = 0"

If the result is different from the preceding one, try multiple times. The system will always find the Modem.

9. vi/etc/wvdial. conf:

[Dialer Defaults]

Modem =/dev/ttyS0

Baud = 57600

Init1 = ATZ

Init2 = ATQ0 V1 E1 S0 = 0 & C1 & D2 + FCLASS = 0

ISDN = 0

Modem Type = Analog Modem

Phone = * 99 *** 1 #

Username =

Password =

10. edit/etc/chap-secrets and/etc/pap-secrets.

Change the content of both files

"" * ""

Note that the first pair of quotation marks is the user name,

* Indicates that there is no limit on the server name,

The second pair is enclosed in the quotation marks to verify the password.



11. Run wvdial. The result is as follows:

[Root @ test ppp] # wvdial

--> WvDial: Internet dialer version 1.53

--> Initializing modem.

--> Sending: ATZ

ATZ

OK

--> Sending: ATQ0 V1 E1 S0 = 0 & C1 & D2 + FCLASS = 0

OK

--> Modem initialized.

--> Sending: ATDT * 99 *** 1 #

--> Waiting for carrier.

ATDT * 99 *** 1 #

CONNECT

--> Carrier detected. Waiting for prompt.

~ [7f] ##@!} } 7} "}}}}}#}% B #}%}%}& I =} 3 [18]} (}"} ^ }#~

--> PPP negotiation detected.

--> Starting pppd at Thu May 13 17:47:11 2004

--> Pid of pppd: 19535

12. Open another Terminal and run ifconfig. You can see that the ppp0 device has appeared in the interface, as shown in:

Ppp0 Link encap: Point-to-Point Protocol

Inet addr: 220.192.68.149 P-t-P: 220.192.64.1 Mask: 255.255.255.255

Up pointopoint running noarp multicast mtu: 1500 Metric: 1

RX packets: 3 errors: 0 dropped: 0 overruns: 0 frame: 0

TX packets: 4 errors: 0 dropped: 0 overruns: 0 carrier: 0

Collisions: 0 txqueuelen: 3

RX bytes: 66 (66.0 B) TX bytes: 84 (84.0 B)

We can see that the dynamic address 220.192.68.149 has been obtained.

13. at this time, you need to manually add a default route: route add default ppp0. After adding the route, you can ping a remote address to check whether the Internet is actually accessed. For example, you can ping 166.111.8.238 on the public network;

14. To stop the ppp connection, you only need to switch to the Terminal of wvdial and press Ctrl + C. You can also kill the wvdial process. The result is as follows:

Caught signal #2! Attempting to exit gracefully...

--> Disconnecting at Thu JULY 13 17:58:26 2004

[Root @ test ppp] # ppp0 Link encap: Point-to-Point Protocol
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.