initial commit
This commit is contained in:
commit
aca1cb6825
10
chat
Normal file
10
chat
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
# /etc/ppp/peers/sim800c
|
||||||
|
|
||||||
|
TIMEOUT 15
|
||||||
|
ABORT "BUSY"
|
||||||
|
ABORT "ERROR"
|
||||||
|
ABORT "NO CARRIER"
|
||||||
|
"" AT
|
||||||
|
OK "AT+CGDCONT=1,\"IP\",\"internet.beeline.ru\""
|
||||||
|
OK ATD*99#
|
||||||
|
CONNECT ""
|
||||||
23
peer
Normal file
23
peer
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
# /etc/ppp/peers/sim800c
|
||||||
|
|
||||||
|
/dev/ttyS3
|
||||||
|
115200
|
||||||
|
|
||||||
|
debug
|
||||||
|
# nodetach
|
||||||
|
dump
|
||||||
|
lock
|
||||||
|
|
||||||
|
defaultroute
|
||||||
|
replacedefaultroute
|
||||||
|
defaultroute-metric 200
|
||||||
|
|
||||||
|
nocrtscts
|
||||||
|
ipcp-accept-local
|
||||||
|
ipcp-accept-remote
|
||||||
|
noipdefault
|
||||||
|
usepeerdns
|
||||||
|
persist
|
||||||
|
noauth
|
||||||
|
|
||||||
|
connect '/usr/sbin/chat -v -f /etc/ppp/chatscripts/sim800c'
|
||||||
27
script
Normal file
27
script
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# /etc/init.d/sim800c
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo "AT+CFUN=1,1" > /dev/ttyS3
|
||||||
|
echo "AT+IPR=115200" > /dev/ttyS3
|
||||||
|
pon sim800c
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
poff sim800c
|
||||||
|
# sleep 3
|
||||||
|
# echo "+++" > /dev/ttyS3
|
||||||
|
# sleep 3
|
||||||
|
echo "AT+CFUN=1,1" > /dev/ttyS3
|
||||||
|
;;
|
||||||
|
restart|reload)
|
||||||
|
$0 stop
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start|stop|restart}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
16
service
Normal file
16
service
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
# /etc/systemd/system/sim800c.service
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=SIM800C PPP Connection
|
||||||
|
After=rc-local.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
PIDFile=/run/ppp0.pid
|
||||||
|
ExecStart=/home/pico/sim800c start
|
||||||
|
ExecStop=/home/pico/sim800c stop
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5s
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Loading…
Reference in New Issue
Block a user