环境:
树莓派3B
apsync镜像系统
联通3G无线网卡
4G无线上网卡托设备 联通电信4g 无线路由器随身wifi
步骤:
1、查看USB设备中3G网卡
lsusb
ls /dev/ttyUSB0*
2、将此USB设备驱动为USB-MODEM
下载安装 usb-modeswitch软件包。
下载安装命令:sudo aptitude install usb-modeswitch
其配置文件位于 /etc/usb_modeswitch.conf
apt-cache search usb-modeswitch
sudo apt-get install usb-modeswitch
移动:
China Mobile Internet 1
联通:
设置完成后:
连接:
点击 China Mobile Internet 1 那栏,然后输入密码(我是随便写的):
连接完成:
测试:
ping www.baidu.com
手上2011年的硬件太旧了,测试未通过,买4G无线网卡测试吧!
终于 有4G无线上网卡可以测试了:
插入后,lsusb,出现相关设备,ls /dev/ttyUSB*,没有ttyUSB设备;
安装 wvdial
sudo apt-get install wvdial
打开usb_modeswitch
cd /usr/share/usb_modeswitch
解压:
sudo tar -xzvf configPack.tar.gz
再测试
lsusb
ls /dev/
ls /dev/ttyUSB*
测试modem端口,一般为ttyUSB0
sudo wvdialconf
# cat /dev/usb_modeswitch.d/05c6:6000
echo TargetVendor = 0x05c6 > /dev/usb_modeswitch.d/05c6:6000
echo TargetProduct = 0x6000 >> /dev/usb_modeswitch.d/05c6:6000
echo MessageContent = "5553424312345678000000000000061b000000020000000000000000000000" >> /dev/usb_modeswitch.d/05c6:6000
echo NeadResponse = 1 >> /dev/usb_modeswitch.d/05c6:6000
修改wxdial默认配置
sudo nano /etc/wvdial.conf
配置如下:
[Dialer Defaults]
Phone = #777
Username = new
Password = new
New PPPD = yes
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0
Init3 = AT+CGDCONT=1,"IP","ctnet"
Modem Type = Analog Modem
Baud = 115200 # 波特率常见的是9600 115200 460800
Modem = /dev/ttyUSB0
ISDN = 0
Auto DNS = on
#移动
[Dialer Defaults]
Auto DNS = on
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
ISDN = 0
New PPPD = yes
Phone = *98*1#
Modem = /dev/ttyUSB0
Username = new
Password = new
Baud = 9600
#移动
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0
Init3 = AT+CGDCONT=1,"IP","cmnet"
Modem Type = Analog Modem
Baud = 9600
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Phone = *98*1#
Password =
Username =
Auto DNS = on
运行测试:
sudo wvdial Defaults
sudo ifconfig
参考链接:
ubuntu系统4G卡上网操作图解
https://blog.csdn.net/subfate/article/details/79719465?utm_source=blogxgwz0
wvdial.conf配置
https://github.com/morfikov/files/blob/master/configs/etc/wvdial.conf
1\树莓派3b连接并调试华为ME-909s-821 4G模块
https://blog.csdn.net/qq_32384313/article/details/77725235
2\ME909S-821 4G-LTE模块在Linux系统下拨号上网测试
https://blog.csdn.net/CSDNhuaong/article/details/74910569
3\树莓派使用4G模块(华为ME909s-821)亲身尝试的可行方法(上)
https://blog.csdn.net/jiaojian8063868/article/details/79295570
4\树莓派使用4G模块(华为ME909s-821)亲身尝试的可行方法(下)
https://blog.csdn.net/jiaojian8063868/article/details/79295786
移远EC20在树莓派下的移植以及4G网络TCP阿里云链接
https://www.jianshu.com/p/47b4c7ed926f
移远EC20 4G模块Linux驱动移植和测试
https://blog.csdn.net/u011728480/article/details/78588827?locationNum=11&fps=1
Linux下4G LTE连接
https://blog.csdn.net/zhang_danf/article/details/42015213?utm_source=blogxgwz4
[原创] 树莓派使用多个联通4G上网卡
https://blog.csdn.net/u012731379/article/details/78732774
在ARM-linux上实现4G模块PPP拨号上网
https://blog.csdn.net/qq361294382/article/details/52136126?utm_source=blogxgwz7