i2SOM:Yocto: add dial script for LTE module
quectel-dial for EC20 module gprs-dial for HuaWei 909s-821 module
This commit is contained in:
32
meta-i2som-yocto/recipes-connectivity/ppp/files/gprs-dial
Executable file
32
meta-i2som-yocto/recipes-connectivity/ppp/files/gprs-dial
Executable file
@ -0,0 +1,32 @@
|
||||
hide-password
|
||||
noauth
|
||||
connect "/usr/sbin/chat -v -t 50 -f /etc/ppp/chatscripts/gprs-chat"
|
||||
|
||||
#debug
|
||||
logfile
|
||||
/var/log/pppd-gprs.log
|
||||
/dev/ttyUSB0
|
||||
460800
|
||||
defaultroute
|
||||
noipdefault
|
||||
local
|
||||
lock
|
||||
dump
|
||||
#nodetach
|
||||
user " "
|
||||
remotename cmnet
|
||||
ipparam cmnet
|
||||
usepeerdns
|
||||
|
||||
# reconnect while dial terminated instead of exit
|
||||
persist
|
||||
|
||||
# send lcp-echo every 5 seconds to check the connection
|
||||
lcp-echo-interval 5
|
||||
|
||||
# set max lcp-echo failue to 12, result in 12x5=60 seconds redial
|
||||
# if connection disconnected for some reason
|
||||
lcp-echo-failure 12
|
||||
|
||||
# keep retrying forever if dial failed
|
||||
maxfail 0
|
||||
16
meta-i2som-yocto/recipes-connectivity/ppp/files/quectel-chat-connect
Executable file
16
meta-i2som-yocto/recipes-connectivity/ppp/files/quectel-chat-connect
Executable file
@ -0,0 +1,16 @@
|
||||
# /etc/ppp/peers/quectel-chat-connect
|
||||
ABORT "BUSY"
|
||||
ABORT "NO CARRIER"
|
||||
ABORT "NO DIALTONE"
|
||||
ABORT "ERROR"
|
||||
ABORT "NO ANSWER"
|
||||
TIMEOUT 30
|
||||
"" AT
|
||||
OK ATE0
|
||||
OK AT+CGATT=0
|
||||
OK AT+CGATT=1
|
||||
OK ATI;+CSUB;+CSQ;+CPIN?;+COPS?;+CGREG?;&D2
|
||||
# Insert the APN provided by your network operator, default apn is 3gnet
|
||||
OK AT+CGDCONT=1,"IP","3gnet",,0,0
|
||||
OK ATDT*99#
|
||||
CONNECT
|
||||
8
meta-i2som-yocto/recipes-connectivity/ppp/files/quectel-chat-disconnect
Executable file
8
meta-i2som-yocto/recipes-connectivity/ppp/files/quectel-chat-disconnect
Executable file
@ -0,0 +1,8 @@
|
||||
# /etc/ppp/peers/quectel-chat-disconnect
|
||||
ABORT "ERROR"
|
||||
ABORT "NO DIALTONE"
|
||||
SAY "\nSending break to the modem\n"
|
||||
"" +++
|
||||
"" +++
|
||||
"" +++
|
||||
SAY "\nGoodbay\n"
|
||||
65
meta-i2som-yocto/recipes-connectivity/ppp/files/quectel-dial
Executable file
65
meta-i2som-yocto/recipes-connectivity/ppp/files/quectel-dial
Executable file
@ -0,0 +1,65 @@
|
||||
# /etc/ppp/peers/quectel-dial
|
||||
# Usage:root>pppd call quectel-pppd
|
||||
#Modem path, like /dev/ttyUSB3,/dev/ttyACM0, depend on your module, default path is /dev/ttyUSB3
|
||||
/dev/ttyUSB3 115200
|
||||
|
||||
#Insert the username and password for authentication, default user and password are test
|
||||
#user "test" password "test"
|
||||
|
||||
# The chat script, customize your APN in this file
|
||||
connect 'chat -s -v -f /etc/ppp/chatscripts/quectel-chat-connect'
|
||||
|
||||
# The close script
|
||||
disconnect 'chat -s -v -f /etc/ppp/chatscripts/quectel-chat-disconnect'
|
||||
|
||||
# Hide password in debug messages
|
||||
hide-password
|
||||
|
||||
# The phone is not required to authenticate
|
||||
noauth
|
||||
|
||||
# Debug info from pppd
|
||||
debug
|
||||
logfile
|
||||
/var/log/quectel-dial.log
|
||||
|
||||
# If you want to use the HSDPA link as your gateway
|
||||
defaultroute
|
||||
|
||||
# pppd must not propose any IP address to the peer
|
||||
noipdefault
|
||||
|
||||
# No ppp compression
|
||||
#novj
|
||||
#novjccomp
|
||||
noccp
|
||||
ipcp-accept-local
|
||||
ipcp-accept-remote
|
||||
local
|
||||
|
||||
# For sanity, keep a lock on the serial line
|
||||
lock
|
||||
dump
|
||||
#nodetach
|
||||
|
||||
# Hardware flow control
|
||||
nocrtscts
|
||||
remotename 3gppp
|
||||
ipparam 3gppp
|
||||
ipcp-max-failure 10
|
||||
|
||||
# Ask the peer for up to 2 DNS server addresses
|
||||
usepeerdns
|
||||
|
||||
# reconnect while dial terminated instead of exit
|
||||
persist
|
||||
|
||||
# send lcp-echo every 5 seconds to check the connection
|
||||
lcp-echo-interval 5
|
||||
|
||||
# set max lcp-echo failue to 12, result in 12x5=60 seconds redial
|
||||
# if connection disconnected for some reason
|
||||
lcp-echo-failure 12
|
||||
|
||||
# keep retrying forever if dial failed
|
||||
maxfail 0
|
||||
22
meta-i2som-yocto/recipes-connectivity/ppp/ppp_%.bbappend
Normal file
22
meta-i2som-yocto/recipes-connectivity/ppp/ppp_%.bbappend
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
FILESEXTRAPATHS_append := "${THISDIR}/files:"
|
||||
|
||||
SRC_URI += " \
|
||||
file://quectel-dial \
|
||||
file://gprs-dial \
|
||||
file://quectel-chat-connect \
|
||||
file://quectel-chat-disconnect \
|
||||
"
|
||||
|
||||
do_install_append () {
|
||||
install -d ${D}${sysconfdir}/ppp/chatscripts
|
||||
install -d ${D}${sysconfdir}/ppp/peers
|
||||
install -m 0755 ${WORKDIR}/quectel-dial ${D}${sysconfdir}/ppp/peers/
|
||||
install -m 0755 ${WORKDIR}/gprs-dial ${D}${sysconfdir}/ppp/peers/
|
||||
install -m 0755 ${WORKDIR}/quectel-chat-connect ${D}${sysconfdir}/ppp/chatscripts/
|
||||
install -m 0755 ${WORKDIR}/quectel-chat-disconnect ${D}${sysconfdir}/ppp/chatscripts/
|
||||
}
|
||||
|
||||
#FILES_${PN} += "${sysconfdir}/ppp/"
|
||||
#FILES_${PN} += "${sysconfdir}/ppp/peers/"
|
||||
#FILES_${PN} += "${sysconfdir}/ppp/chatscripts"
|
||||
Reference in New Issue
Block a user