当前位置:网站首页>Raspberry connects EC20 for PPP dialing
Raspberry connects EC20 for PPP dialing
2022-07-28 20:18:00 【K.L.Zous】
Use raspberry pie to connect EC20 Extended version ( Here's the picture ), Conduct ppp dial , Achieve the purpose of using cellular network to surf the Internet 

Raspberry pie version :Raspberry 3B
Operating system version :
4G modular :EC20
One 、 Get ready :
1、 Add SIM card
2、 take EC20 Extended version inserted Raspberry On
3、 take EC20 On the expanded version “ data / Power supply port ” use USB Line connected Raspberry Of USB On the interface ,
4、 Check whether
lsusb

5、 Check
lsmod

6、 Get into /dev/ Catalog view ttyUSB equipment , See if the module device is recognized .
ls /dev |grep ttyUSB

Two 、 To configure
1、 Get into /etc/ Catalog view rc.local file , Add the following device information 【 The seller tutorial says to do this step , But it will cause an error when starting up , Comment out does not affect the Internet 】
echo '2c7c 0125 ff' > /sys/bus/usb-serial/drivers/option1/new_id
echo '1c9e 9b05 ff' > /sys/bus/usb-serial/drivers/option1/new_id
echo '2001 7e16 ff' > /sys/bus/usb-serial/drivers/option1/new_id
echo '05c6 6000 ff' > /sys/bus/usb-serial/drivers/option1/new_id
echo '05c6 9025 ff' > /sys/bus/usb-serial/drivers/option1/new_id
echo '05c6 9020 ff' > /sys/bus/usb-serial/drivers/option1/new_id
echo '05c6 9215 ff' > /sys/bus/usb-serial/drivers/option1/new_id
echo '19d2 0579 ff' > /sys/bus/usb-serial/drivers/option1/new_id
echo '2949 8247 ff' > /sys/bus/usb-serial/drivers/option1/new_id
echo '1c9e 9b3c ff' > /sys/bus/usb-serial/drivers/option1/new_id
2、 New configuration file ( It seems that it must be placed in this position ):
sudo nano /etc/ppp/peers/myppp
The contents of the document are as follows
#/etc/ppp/peers/file_name
# Usage: root> pppd call file_name
# Hide the password when debugging
hide-password
# This phone does not require authentication
noauth
#############################################
# Be careful : Here we need to know chat Installation location , If not in the environment variable
# Inside , Then specify the location ( Such as /usr/sbin/chat -s -v -f)
#############################################
# For call control scripts
connect 'chat -s -v -f /etc/ppp/peers/myppp-chat-connect'
# Disconnect script
disconnect 'chat -s -v -f /etc/ppp/peers/myppp-chat-disconnect'
# Debugging information
debug
# Module serial port device
/dev/ttyUSB3
# Serial port baud rate
115200
# Use default routing
defaultroute
# Cannot specify default IP
noipdefault
# No ppp compression
novj
novjccomp
noccp
ipcp-accept-local
ipcp-accept-remote
local
# It is better to lock the serial bus
lock
dump
nodetach
# Keep pppd attached to the terminal
# user name password
# user root
# password
# Hardware control flow
crtscts
remotename 3gppp
ipparam 3gppp
# Request the most from the other party 2 individual DNS Server address
usepeerdns
3、 Create a new connection file :
sudo nano myppp-chat-connect
The contents of the document are as follows
TIMEOUT 15
# continuity 15 second , Received the following characters , Exit execution
ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 40
# 40 The specified character is not received within seconds , sign out
# Such as : OK \rATZ, send out ATZ, Hope to receive OK.
"" AT
OK \rATZ
# Establishing a connection : The mobile is cmnet\ Unicom's is 3gnet, Modify according to your own situation
OK \rAT+CGDCONT=1,"IP","cmnet",,0,0
# dial
OK-AT-OK ATDT*99#
CONNECT \d\c
4、 Create a new disconnected file
sudo nano myppp-chat-disconnect
The contents of the document are as follows
ABORT "ERROR"
ABORT "NO DIALTONE"
SAY "\NSending break to the modem\n"
""\k" ""+++ATH" SAY "\nGood bye !\n"
5、 install ppp
sudo apt-get install ppp
3、 ... and 、 networking
1、 Connect 【 must cd To /etc/ppp/peers, Otherwise, the report will be wrong 】
pppd call myppp &
The print is as follows
pppd options in effect:
debug # (from /etc/ppp/peers/myppp)
nodetach # (from /etc/ppp/peers/myppp)
dump # (from /etc/ppp/peers/myppp)
noauth # (from /etc/ppp/peers/myppp)
remotename 3gppp # (from /etc/ppp/peers/myppp)
/dev/ttyUSB3 # (from /etc/ppp/peers/myppp)
115200 # (from /etc/ppp/peers/myppp)
lock # (from /etc/ppp/peers/myppp)
connect chat -s -v -f /etc/ppp/peers/myppp-chat-connect # (from /etc/ppp/peers/myppp)
disconnect chat -s -v -f /etc/ppp/peers/myppp-chat-disconnect # (from /etc/ppp/peers/myppp)
crtscts # (from /etc/ppp/peers/myppp)
local # (from /etc/ppp/peers/myppp)
asyncmap 0 # (from /etc/ppp/options)
lcp-echo-failure 4 # (from /etc/ppp/options)
lcp-echo-interval 30 # (from /etc/ppp/options)
hide-password # (from /etc/ppp/peers/myppp)
novj # (from /etc/ppp/peers/myppp)
novjccomp # (from /etc/ppp/peers/myppp)
ipcp-accept-local # (from /etc/ppp/peers/myppp)
ipcp-accept-remote # (from /etc/ppp/peers/myppp)
ipparam 3gppp # (from /etc/ppp/peers/myppp)
noipdefault # (from /etc/ppp/peers/myppp)
defaultroute # (from /etc/ppp/peers/myppp)
usepeerdns # (from /etc/ppp/peers/myppp)
noccp # (from /etc/ppp/peers/myppp)
noipx # (from /etc/ppp/options)
timeout set to 15 seconds
abort on (BUSY)
abort on (NO CARRIER)
abort on (NO DIALTONE)
abort on (ERROR)
abort on (NO ANSWER)
timeout set to 40 seconds
send (AT^M)
expect (OK)
AT^M^M
OK
-- got it
send (^MATZ^M)
expect (OK)
^M
ATZ^M^M
OK
-- got it
send (^MAT+CGDCONT=1,"IP","cmnet",,0,0^M)
expect (OK)
^M
AT+CGDCONT=1,"IP","cmnet",,0,0^M^M
OK
-- got it
send (ATDT*99#^M)
expect (CONNECT)
^M
ATDT*99#^M^M
CONNECT
-- got it
send (\d)
Script chat -s -v -f /etc/ppp/peers/myppp-chat-connect finished (pid 685), status = 0x0
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB3
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x916190ae> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x79503a8c> <pcomp> <accomp>]
No auth is possible
sent [LCP ConfRej id=0x0 <auth chap MD5>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x916190ae> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x79503a8c> <pcomp> <accomp>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x79503a8c> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0x916190ae]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [LCP DiscReq id=0x2 magic=0x79503a8c]
rcvd [LCP EchoRep id=0x0 magic=0x79503a8c 91 61 90 ae]
rcvd [IPCP ConfReq id=0x0]
sent [IPCP ConfNak id=0x0 <addr 0.0.0.0>]
rcvd [IPCP ConfNak id=0x1 <addr 10.115.59.42> <ms-dns1 211.136.20.203> <ms-dns2 211.136.17.107>]
sent [IPCP ConfReq id=0x2 <addr 10.115.59.42> <ms-dns1 211.136.20.203> <ms-dns2 211.136.17.107>]
rcvd [IPCP ConfReq id=0x1]
sent [IPCP ConfAck id=0x1]
rcvd [IPCP ConfAck id=0x2 <addr 10.115.59.42> <ms-dns1 211.136.20.203> <ms-dns2 211.136.17.107>]
Could not determine remote IP address: defaulting to 10.64.64.64
not replacing default route to eth0 [192.168.1.1]
local IP address 10.115.59.42
remote IP address 10.64.64.64
primary DNS address 211.136.20.203
secondary DNS address 211.136.17.107
Script /etc/ppp/ip-up started (pid 690)
Script /etc/ppp/ip-up finished (pid 690), status = 0x0
After dialing successfully , Two... Will be returned DNS Server address :
primary DNS address 211.136.20.203
secondary DNS address 211.136.17.107
2、 take /etc/ppp/resolv.conf File copy to /etc/ Next , be used for DNS analysis
nameserver DNS address 211.136.20.203
nameserver DNS address 211.136.17.107
3、 Add route ( If there were no other network cards and routing tables [default], You can go online directly , This step is not necessary )
You need to add a route , Because , pppd When dialing, a virtual network card , We need to access the Internet through this network card , Use ifconfig command , You can see an additional network card , It's usually ppp0:
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.186.110.45 P-t-P:10.64.64.64 Mask:255.255.255.255
Execute the following command
sudo route del default
sudo route add default dev ppp0
4、 Last ping You can surf the Internet in a moment 
This is encapsulated python Code
https://download.csdn.net/download/u014492512/11752490
Reference link :
【PPP Dial up steps 】
【 The embedded Linux utilize ppp Realization 4G Module networking 】
边栏推荐
- [C language] function
- English translation Italian - batch English translation Italian tools free of charge
- 长轮询,iframe和sse三种web消息实时推送demo实践
- [in depth study of 4g/5g/6g topics -44]: urllc-15 - in depth interpretation of 3GPP urllc related protocols, specifications and technical principles -9-low delay technology -3-non slot scheduling mini
- 3、 Are formal and actual parameters in a programming language variables?
- Richpedia: A Large-Scale, Comprehensive Multi-Modal Knowledge Graph
- 9. Pointer of C language (5) how many bytes does the pointer variable occupy
- English translation Portuguese - batch English conversion Portuguese - free translation and conversion of various languages
- Communication learning static routing across regional networks
- C+ + core programming
猜你喜欢
![[C language] print pattern summary](/img/48/d8ff17453e810fcd9269f56eda4d47.png)
[C language] print pattern summary

C语言数据 3(2)

CDGA|工业互联网行业怎么做好数据治理?

Implementation of strstr in C language

Intermediate soft test (system integration project management engineer) high frequency test site

9. Pointer of C language (5) how many bytes does the pointer variable occupy

Stories of Party members | Li qingai uses cartoons to drive farmers to increase income and become rich

中国能否在元宇宙的未来发展中取得突破,占领高地?

C+ + core programming

Saltstack advanced
随机推荐
Basic knowledge of communication network 01
MySQL command statement (personal summary)
Crawl IP
5. Difference between break and continue (easy to understand version)
In the second half of 2022, the system integration project management engineer certification starts on August 20
C语言数据 3(2)
2022年下半年系统集成项目管理工程师认证8月20日开班
Storage of C language data in memory (1)
plt. What does it mean when linestyle, marker, color equals none in plot()
9. Pointer of C language (3) classic program, exchange the value of two numbers for deep analysis, (easy to understand), are formal parameters and arguments a variable?
What is the variance?
Sequential linear table - practice in class
Basic usage of docker
HSETNX KEY_ Name field value usage
robobrowser的简单使用
Durham High Lord (classic DP)
Tencent cloud deployment lamp_ Experience of building a station
adb remount of the / superblock failed: Permission denied
83. (cesium home) how the cesium example works
6. Functions of C language, why functions are needed, how functions are defined, and the classification of functions