bnanapi R2 4G模块使用

4G模块使用配置步骤
一.联网设置(ppp模式)
1.输入lsusb查看4G模块是否连接成功(Bus 003 Device 002: ID 2c7c:0125为4G模块)

root@bpi-iot-ros-ai:~# lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 2c7c:0125 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

2.输入ls /dev/ttyUSB* 4G模块进入开发模式

root@bpi-iot-ros-ai:~# ls /dev/ttyUSB*
/dev/ttyUSB0  /dev/ttyUSB1  /dev/ttyUSB2  /dev/ttyUSB3

3.键入ppp1文件目录,执行./ppp1.sh &命令

root@bpi-iot-ros-ai:~# cd /home/pi/Downloads/ppp1/
root@bpi-iot-ros-ai:/home/pi/Downloads/ppp1# ./ppp1.sh &

4.等待ppp.sh脚本执行完毕输入ifconfig查看是否存在ppp0网络

root@bpi-iot-ros-ai:/home/pi/Downloads/ppp1# ifconfig
docker0   Link encap:Ethernet  HWaddr 02:42:6b:22:18:84
          inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 2a:85:dd:f2:14:e2
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:20972 (20.9 KB)
          Interrupt:71

eth1      Link encap:Ethernet  HWaddr 76:29:3b:88:53:03
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:115 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:23048 (23.0 KB)
          Interrupt:71

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1623 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1623 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:238771 (238.7 KB)  TX bytes:238771 (238.7 KB)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:10.87.168.72  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:31 errors:0 dropped:0 overruns:0 frame:0
          TX packets:71 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:12486 (12.4 KB)  TX bytes:7964 (7.9 KB)


二.测速
键入 speedtest-cli所在目录
输入chmod +x ./speedtest-cli 给该文件读写权限
输入 ./speedtest-cli 运行测速文件,等待测速完成

root@bpi-iot-ros-ai:~# chmod +x ./speedtest-cli
root@bpi-iot-ros-ai:~# ./speedtest-cli
Retrieving speedtest.net configuration...
Testing from China Mobile Guangdong (223.72.105.188)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by 湖南联通5G (Changsha) [1341.73 km]: 91.24 ms
Testing download speed................................................................................
Download: 11.44 Mbit/s
Testing upload speed................................................................................................
Upload: 2.81 Mbit/s

三、阿里云内网穿透
1.配置linux服务端
键入ssh -fNCR 2333:localhost:22 root@101.200.240.218

root@bpi-iot-ros-ai:~# ssh -fNCR 2333:localhost:22 root@101.200.240.218

键入密码:zhou1996.
2.配置阿里云服务端
键入ssh -fNCL 2555:localhost:2333 localhost
键入密码:zhou1996.
3.本地计算机ssh设置
IP:101.200.240.218
端口:2555
用户名:pi
密码:bananapi

上一篇:zzulioj 1054: 猴子吃桃


下一篇:1054: 猴子吃桃