Browse Source

Signed-off-by: Caner <5658514@qq.com>

Caner 4 years ago
parent
commit
ea4e420f67
7 changed files with 110 additions and 0 deletions
  1. 12 0
      LTE.service
  2. 2 0
      STLTE.sh
  3. 0 0
      apt-get install ppp -%3E peer copy.txt
  4. 35 0
      peers/provider
  5. 14 0
      peers/quectel-chat-connect
  6. 8 0
      peers/quectel-chat-disconnect
  7. 39 0
      peers/quectel-ppp

+ 12 - 0
LTE.service

@@ -0,0 +1,12 @@
+[Unit]
+Description=LTE Service
+
+[Service]
+Type=simple
+User=root
+Restart=always
+RestartSec=10s
+ExecStart=/LTES/STLTE.sh &
+
+[Install]
+WantedBy=multi-user.target

+ 2 - 0
STLTE.sh

@@ -0,0 +1,2 @@
+#!/bin/sh
+pppd call quectel-ppp

+ 0 - 0
apt-get install ppp -%3E peer copy.txt


+ 35 - 0
peers/provider

@@ -0,0 +1,35 @@
+# example configuration for a dialup connection authenticated with PAP or CHAP
+#
+# This is the default configuration used by pon(1) and poff(1).
+# See the manual page pppd(8) for information on all the options.
+
+# MUST CHANGE: replace myusername@realm with the PPP login name given to
+# your by your provider.
+# There should be a matching entry with the password in /etc/ppp/pap-secrets
+# and/or /etc/ppp/chap-secrets.
+user "myusername@realm"
+
+# MUST CHANGE: replace ******** with the phone number of your provider.
+# The /etc/chatscripts/pap chat script may be modified to change the
+# modem initialization string.
+connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T ********"
+
+# Serial device to which the modem is connected.
+/dev/modem
+
+# Speed of the serial line.
+115200
+
+# Assumes that your IP address is allocated dynamically by the ISP.
+noipdefault
+# Try to get the name server addresses from the ISP.
+usepeerdns
+# Use this connection as the default route.
+defaultroute
+
+# Makes pppd "dial again" when the connection is lost.
+persist
+
+# Do not ask the remote to authenticate.
+noauth
+

+ 14 - 0
peers/quectel-chat-connect

@@ -0,0 +1,14 @@
+# /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 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 ATD*99#
+CONNECT

+ 8 - 0
peers/quectel-chat-disconnect

@@ -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"

+ 39 - 0
peers/quectel-ppp

@@ -0,0 +1,39 @@
+# /etc/ppp/peers/quectel-pppd
+# 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/peers/quectel-chat-connect'
+# The close script
+disconnect 'chat -s -v -f /etc/ppp/peers/quectel-chat-disconnect'
+# Hide password in debug messages
+hide-password
+# The phone is not required to authenticate
+noauth
+# Debug info from pppd
+debug
+# 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
+modem
+dump
+nodetach
+# Hardware flow control
+nocrtscts
+remotename 3gppp
+ipparam 3gppp
+ipcp-max-failure 30
+# Ask the peer for up to 2 DNS server addresses
+usepeerdns