树莓派centos系统使用华为ME909s 4G上网(PPP0)

1 篇文章 0 订阅
1 篇文章 0 订阅

树莓派centos系统使用华为ME909s 4G上网(PPP0)

1. 硬件连接

2.软件依赖库安装

	   1.确保树莓派联网
	   2.安装wvdial
	       yum install wvdial

3.配置wvdial.conf

		1.vim /etc/wvdial.conf
		2.    内容如下 
		    #wvdial启动后首先载入wvdial.conf配置文件,然后再初始化modem并拨号,拨号后等待拨入       方的响应,收到拨入方响应后则启动pppd,所以需要修改配置信息:(可
			[Dialer hw1]
			Auto DNS = on
			Init1 = ATZ
			Init2 = ATQ0 V1 E1 S0=0
			Init3 = AT+CGDCONT=1,"ip","ctnet"
			ISDN = 0
			Modem Type = Analog Modem
			New PPPD = yes
			Phone = *99#
			Modem = /dev/ttyUSB0
			Username = card
			Password = card
			Baud = 9600
     具体是移动或者联通或者电信就是  Init3   Phone 稍有不同 其他基本一致,这里是电信。
      保存并退出。

拨号测试

		输入下述命令测试ME909s模块拨号情况,拨号成功则证明手机卡可以借助ME909s模块使用。
		 wvdial hw1
	 输入该命令后需要等待一段时间,一般30s左右,如果没有错误信息或停止,一直等下去

模块正常通信时,返回数据如下:

			--> WvDial: Internet dialer version 1.61
			--> Initializing modem.
			--> Sending: ATZ
			ERROR
			G
			EATZ
			TPO
			OK
			RT
			--> Sending: ATQ0 V1 E1 S0=0
			MATQ0 V1 E1 S0=0
			OK
			--> Sending: AT+CGDCONT=1,"IP","4gnet"
			AT+CGDCONT=1,"IP","4gnet"
			O
			OK
			D
			--> Modem initialized.
			--> Sending: ATDT*99#
			--> Waiting for carrier.
			EATDT*99#
			CONNECT 150000000
			--> Carrier detected.  Waiting for prompt.
			--> Don't know what to do!  Starting pppd and hoping for the best.
			--> Starting pppd at Tue Oct 23 15:21:28 2018
			--> Pid of pppd: 1264
			--> Using interface ppp0
			--> pppd: €[01]a
			--> pppd: €[01]a
			--> pppd: €[01]a
			--> pppd: €[01]a
			--> pppd: €[01]a
			--> local  IP address 10.140.14.89
			--> pppd: €[01]a
			--> remote IP address 10.64.64.64
			--> pppd: €[01]a
			--> primary   DNS address 221.179.38.7
			--> pppd: €[01]a
			--> secondary DNS address 120.196.165.7
			--> pppd: €[01]a
			Caught signal 15:  Attempting to exit gracefully...
			--> Terminating on signal 15
			--> pppd: €[01]a
			--> Connect time 0.5 minutes.
			--> pppd: €[01]a
			--> pppd: €[01]a
			--> pppd: €[01]a

可以用 ip route来查看显示多了一个ppp0

外网测试

   ping  www.baidu.com
   64 bytes from 61.135.169.125: icmp_seq=1 ttl=54 time=23.3 ms
	64 bytes from 61.135.169.125: icmp_seq=2 ttl=54 time=27.0 ms
	64 bytes from 61.135.169.125: icmp_seq=3 ttl=54 time=13.5 ms
	64 bytes from 61.135.169.125: icmp_seq=4 ttl=54 time=23.1 ms
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值