From 4a3dd558733f6f895bcaf41f76e07f0488f73418 Mon Sep 17 00:00:00 2001 From: justmarvinn Date: Sat, 7 Jun 2025 23:41:01 +0200 Subject: [PATCH] deleted all old files --- README.md | 33 -------------------------- chat | 10 -------- healthcheck-service | 8 ------- healthcheck-timer | 12 ---------- install.sh | 26 -------------------- peer | 23 ------------------ script | 58 --------------------------------------------- service | 16 ------------- 8 files changed, 186 deletions(-) delete mode 100644 README.md delete mode 100644 chat delete mode 100644 healthcheck-service delete mode 100644 healthcheck-timer delete mode 100644 install.sh delete mode 100644 peer delete mode 100644 script delete mode 100644 service diff --git a/README.md b/README.md deleted file mode 100644 index ba0c998..0000000 --- a/README.md +++ /dev/null @@ -1,33 +0,0 @@ -## Dependencies - -### Ubuntu -```SHELL -sudo apt remove -y inetutils-ping -sudo apt install -y ppp iputils-ping -``` - -## Install - -### Ubuntu -```SHELL -curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/install.sh" | bash -``` - -## Usage (via systemd unit) - -- Start & enable on startup -```SHELL -sudo systemctl start sim800-healthcheck.timer -sudo systemctl enable sim800-healthcheck.timer -``` - -- Stop & disable on startup -```SHELL -sudo systemctl stop sim800-healthcheck.timer -sudo systemctl disable sim800-healthcheck.timer -``` - -- Restart immediately -```SHELL -sudo systemctl restart sim800 -``` diff --git a/chat b/chat deleted file mode 100644 index f542ec8..0000000 --- a/chat +++ /dev/null @@ -1,10 +0,0 @@ -# /etc/ppp/chatscripts/sim800c - -TIMEOUT 15 -ABORT "BUSY" -ABORT "ERROR" -ABORT "NO CARRIER" -"" AT -OK "AT+CGDCONT=1,\"IP\",\"internet.beeline.ru\"" -OK ATD*99# -CONNECT "" diff --git a/healthcheck-service b/healthcheck-service deleted file mode 100644 index 065267b..0000000 --- a/healthcheck-service +++ /dev/null @@ -1,8 +0,0 @@ -# /etc/systemd/system/sim800-healthcheck.service - -[Unit] -Description=SIM800 Healthcheck service - -[Service] -Type=oneshot -ExecStart=/etc/init.d/sim800c healthcheck diff --git a/healthcheck-timer b/healthcheck-timer deleted file mode 100644 index e2f0383..0000000 --- a/healthcheck-timer +++ /dev/null @@ -1,12 +0,0 @@ -# /etc/systemd/system/sim800-healthcheck.timer - -[Unit] -Description=SIM800 healthcheck timer -After=rc-local.service - -[Timer] -OnBootSec=2min -OnUnitActiveSec=2m - -[Install] -WantedBy=timers.target diff --git a/install.sh b/install.sh deleted file mode 100644 index 503128b..0000000 --- a/install.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# force run from root user -if [[ $EUID -ne 0 ]]; then - exec sudo "$0" "$@" -fi - -set -e - -apt update -apt remove -y inetutils-ping -apt install -y ppp curl iputils-ping - -mkdir -p /etc/ppp/chatscripts -mkdir -p /etc/ppp/peers -mkdir -p /etc/init.d -mkdir -p /etc/systemd/system - -curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/chat" > /etc/ppp/chatscripts/sim800c -curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/peer" > /etc/ppp/peers/sim800c -curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/script" > /etc/init.d/sim800c -curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/service" > /etc/systemd/system/sim800.service -curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/healthcheck-service" > /etc/systemd/system/sim800-healthcheck.service -curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/healthcheck-timer" > /etc/systemd/system/sim800-healthcheck.timer - -chmod +x /etc/init.d/sim800c diff --git a/peer b/peer deleted file mode 100644 index 42d9a4a..0000000 --- a/peer +++ /dev/null @@ -1,23 +0,0 @@ -# /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' diff --git a/script b/script deleted file mode 100644 index a57db2b..0000000 --- a/script +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -# /etc/init.d/sim800c - -INTERFACE_NAME=ppp0 -# see https://wiki.luckfox.com/Luckfox-Pico/Luckfox-Pico-GPIO for details -PIN_NUMBER=34 - -case "$1" in -start) - if ip link show $INTERFACE_NAME > /dev/null 2>&1; then - echo "Interface $INTERFACE_NAME already exists" - exit 1 - fi - - if [ ! -d "/sys/class/gpio/gpio{PIN_NUMBER}" ]; then - echo $PIN_NUMBER > /sys/class/gpio/export - fi - echo out > "/sys/class/gpio/gpio$PIN_NUMBER/direction" - echo 1 > "/sys/class/gpio/gpio$PIN_NUMBER/active_low" - echo 1 > "/sys/class/gpio/gpio$PIN_NUMBER/value" - pon sim800c - ;; - -stop) - poff sim800c - echo 0 > "/sys/class/gpio/gpio$PIN_NUMBER/value" - echo $PIN_NUMBER > /sys/class/gpio/unexport - ;; - -restart|reload) - $0 stop - sleep 10 - $0 start - ;; - -healthcheck) - # DNS names also available - PUBLIC_ADDR=1.1.1.1 - PACKET_COUNT=5 - TIMEOUT=10 - if ! ping -I $INTERFACE_NAME -c $PACKET_COUNT -W $TIMEOUT $PUBLIC_ADDR > /dev/null 2>&1; then - echo "Healthcheck failed" - systemctl restart sim800.service - # $0 restart - exit 1 - else - echo "Healthcheck passed" - exit 0 - fi - ;; - -*) - echo "Usage: $0 {start|stop|restart|healthcheck}" - exit 1 -esac - -exit 0 diff --git a/service b/service deleted file mode 100644 index 86bd732..0000000 --- a/service +++ /dev/null @@ -1,16 +0,0 @@ -# /etc/systemd/system/sim800.service - -[Unit] -Description=SIM800C PPP Connection -After=rc-local.service - -[Service] -Type=forking -ExecStart=/etc/init.d/sim800c start -ExecStop=/etc/init.d/sim800c stop -# PIDFile=/run/ppp0.pid -# Restart=on-failure -# RestartSec=5s - -[Install] -WantedBy=multi-user.target