initial commit

This commit is contained in:
justmarvinn 2025-04-19 18:17:14 +02:00
commit aca1cb6825
4 changed files with 76 additions and 0 deletions

10
chat Normal file
View 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
View 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
View 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
View 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