ApingLai 发表于 2013-4-14 17:43:58

《 配置电信3G卡USB无线上网》

本帖最后由 ApingLai 于 2013-4-14 18:17 编辑


《RaspberryPi[树莓派] 配置电信3G卡USB无线上网》

来源 http://www.apinglai.com

http://www.apinglai.com/wp-content/uploads/2013/04/IMG_20130414_082603-e1365899344138.jpg

http://www.apinglai.com/wp-content/uploads/2013/04/IMG_20130414_072052.jpg

1. 查看USB的3G网卡
pi@raspberrypi ~ $ sudo lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 413c:2003 Dell Computer Corp. Keyboard
Bus 001 Device 005: ID 12d1:140c Huawei Technologies Co., Ltd.#这就是我的3G网卡

pi@raspberrypi ~ $ sudo ls -al /dev/ttyUSB*
crw-rw---T 1 root dialout 188, 0 Apr 14 07:16 /dev/ttyUSB0
crw-rw---T 1 root dialout 188, 1 Jan11970 /dev/ttyUSB1
crw-rw---T 1 root dialout 188, 2 Jan11970 /dev/ttyUSB2

2. 安装wvdial
pi@raspberrypi ~ $ aptitude install usb-modeswitch
pi@raspberrypi ~ $ aptitude install wvdial

3. 修改wvdial配置文件
pi@raspberrypi ~ $ sudo vim /etc/wvdial.conf
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
Phone = #777
ISDN = 0
Username = card
Init1 = ATZ
Password = card
Modem = /dev/ttyUSB0
Baud = 9600
Stupid Mode = 13. 启用连接3G网络
pi@raspberrypi ~ $ sudo pon.wvdial
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
CONNECT 3100000
--> Carrier detected.Starting PPP immediately.
--> Starting pppd at Sun Apr 14 07:14:01 2013
--> Pid of pppd: 2280
--> Using interface ppp0
--> pppd: 皑
--> pppd: 皑
--> pppd: 皑
--> pppd: 皑
--> pppd: 皑
--> localIP address 119.143.117.96
--> pppd: 皑
--> remote IP address 183.41.0.1
--> pppd: 皑
--> primary   DNS address 202.96.128.86
--> pppd: 皑
--> secondary DNS address 202.96.134.133
--> pppd: 皑

4. 已连接成功,测试下
pi@raspberrypi ~ $ ping qq.com
PING qq.com (14.17.32.211) 56(84) bytes of data.
64 bytes from 14.17.32.211: icmp_req=1 ttl=54 time=6.11 ms
64 bytes from 14.17.32.211: icmp_req=2 ttl=54 time=5.88 ms
64 bytes from 14.17.32.211: icmp_req=2 ttl=54 time=5.80 ms

5. 停止3G网络连接
pi@raspberrypi ~ $ sudo killall wvdial
--> Terminating on signal 15
--> pppd: °ϛ01]Іϛ01]
--> Connect time 8.6 minutes.
--> pppd: °ϛ01]Іϛ01]
--> pppd: °ϛ01]Іϛ01]
--> Disconnecting at Sun Apr 14 07:46:15 2013

更多详细请进入 http://www.apinglai.com/category/arm





指尖焰火 发表于 2013-4-14 20:56:12

收藏了,文章

瀚蓝ゞ. 发表于 2013-5-9 15:29:36

板凳我占了

pi_user 发表于 2013-5-16 15:33:13

求教,我是华为其他型号的上网卡,插上后,在sudo ls -al /dev/ttyUSB*后,没有任何ttyUSB信息?
页: [1]
查看完整版本: 《 配置电信3G卡USB无线上网》