diff --git a/README.md b/README.md index aba4a5e..b39292d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,35 @@ # AT Telnet Daemon and Simple Admin combo installer/uninstaller + This will install a Combination of https://github.com/natecarlson/quectel-rgmii-at-command-client/tree/main/at_telnet_daemon and; https://github.com/rbflurry/quectel-rgmii-simpleadmin + ONLY FOR THE QUECTEL RM520N-GL + *****WORK IN PROGRESS NOT READY TO INSTALL***** +## Installation Automated +Script will do everything but setup Nate's at_telnet_daemon +```bash +adb shell wget -P /tmp https://raw.githubusercontent.com/iamromulan/quectel-rgmii-simpleadmin-at-telnet-daemon/main/install_on_modem.sh +adb shell chmod +x /tmp/install_on_modem.sh +adb shell sh /tmp/install_on_modem.sh +``` + + + +## Uninstallation Automated +Script will ask to remove Simpleadmin then ask to remove AT Telnet Daemon +```bash +adb shell wget -P /tmp https://raw.githubusercontent.com/iamromulan/quectel-rgmii-simpleadmin-at-telnet-daemon/main/uninstall_on_modem.sh +adb shell chmod +x /tmp/install_on_modem.sh +adb shell sh /tmp/install_on_modem.sh +``` + + + +# 2 Original README.md files + + + + # AT Telnet Daemon for Quectel Modem This will provide a telnet interface to the AT command port of Quectel modems that are connected via a RGMII Ethernet interface (aka a "RJ45 to M.2" or "Ethernet to M.2" adapter board). It is an alternative to the ETH AT command interface that Quectel provides, which is a bit flaky and requires a custom client. @@ -118,7 +146,7 @@ If you are able to test on other modems and get it working, feel free to PR. ## Installation Automated Script will do everything but setup Nate's at_telnet_daemon ```bash -adb shell wget -P /tmp https://raw.githubusercontent.com/rbflurry/quectel-rgmii-simpleadmin/main/install_on_modem.sh +adb shell wget -P /tmp https://raw.githubusercontent.com/iamromulan/quectel-rgmii-simpleadmin-at-telnet-daemon/main/install_on_modem.sh adb shell chmod +x /tmp/install_on_modem.sh adb shell sh /tmp/install_on_modem.sh ``` diff --git a/at-telnet/modem-multiclient.py b/attelnetdaemon/at-telnet/modem-multiclient.py similarity index 100% rename from at-telnet/modem-multiclient.py rename to attelnetdaemon/at-telnet/modem-multiclient.py diff --git a/at-telnet/picocom b/attelnetdaemon/at-telnet/picocom similarity index 100% rename from at-telnet/picocom rename to attelnetdaemon/at-telnet/picocom diff --git a/at-telnet/socat-armel-static b/attelnetdaemon/at-telnet/socat-armel-static similarity index 100% rename from at-telnet/socat-armel-static rename to attelnetdaemon/at-telnet/socat-armel-static diff --git a/at-telnet/systemd_units/at-telnet-daemon.service b/attelnetdaemon/at-telnet/systemd_units/at-telnet-daemon.service similarity index 100% rename from at-telnet/systemd_units/at-telnet-daemon.service rename to attelnetdaemon/at-telnet/systemd_units/at-telnet-daemon.service diff --git a/at-telnet/systemd_units/socat-smd11-from-ttyIN.service b/attelnetdaemon/at-telnet/systemd_units/socat-smd11-from-ttyIN.service similarity index 100% rename from at-telnet/systemd_units/socat-smd11-from-ttyIN.service rename to attelnetdaemon/at-telnet/systemd_units/socat-smd11-from-ttyIN.service diff --git a/at-telnet/systemd_units/socat-smd11-to-ttyIN.service b/attelnetdaemon/at-telnet/systemd_units/socat-smd11-to-ttyIN.service similarity index 100% rename from at-telnet/systemd_units/socat-smd11-to-ttyIN.service rename to attelnetdaemon/at-telnet/systemd_units/socat-smd11-to-ttyIN.service diff --git a/at-telnet/systemd_units/socat-smd11.service b/attelnetdaemon/at-telnet/systemd_units/socat-smd11.service similarity index 100% rename from at-telnet/systemd_units/socat-smd11.service rename to attelnetdaemon/at-telnet/systemd_units/socat-smd11.service diff --git a/micropython/errno.py b/attelnetdaemon/micropython/errno.py similarity index 100% rename from micropython/errno.py rename to attelnetdaemon/micropython/errno.py diff --git a/micropython/fcntl.py b/attelnetdaemon/micropython/fcntl.py similarity index 100% rename from micropython/fcntl.py rename to attelnetdaemon/micropython/fcntl.py diff --git a/micropython/ffilib.py b/attelnetdaemon/micropython/ffilib.py similarity index 100% rename from micropython/ffilib.py rename to attelnetdaemon/micropython/ffilib.py diff --git a/micropython/logging.py b/attelnetdaemon/micropython/logging.py similarity index 100% rename from micropython/logging.py rename to attelnetdaemon/micropython/logging.py diff --git a/micropython/micropython b/attelnetdaemon/micropython/micropython similarity index 100% rename from micropython/micropython rename to attelnetdaemon/micropython/micropython diff --git a/micropython/os_compat.py b/attelnetdaemon/micropython/os_compat.py similarity index 100% rename from micropython/os_compat.py rename to attelnetdaemon/micropython/os_compat.py diff --git a/micropython/serial.py b/attelnetdaemon/micropython/serial.py similarity index 100% rename from micropython/serial.py rename to attelnetdaemon/micropython/serial.py diff --git a/micropython/stat.py b/attelnetdaemon/micropython/stat.py similarity index 100% rename from micropython/stat.py rename to attelnetdaemon/micropython/stat.py diff --git a/micropython/time.py b/attelnetdaemon/micropython/time.py similarity index 100% rename from micropython/time.py rename to attelnetdaemon/micropython/time.py diff --git a/micropython/traceback.mpy b/attelnetdaemon/micropython/traceback.mpy similarity index 100% rename from micropython/traceback.mpy rename to attelnetdaemon/micropython/traceback.mpy diff --git a/install_on_modem.sh b/install_on_modem.sh index 0757181..abe5877 100644 --- a/install_on_modem.sh +++ b/install_on_modem.sh @@ -1,10 +1,10 @@ #!/bin/bash # -# Installs SimpleAdmin +# Installs AT Telnet Daemon and Simple Admin # -read -p "Do you want to install SimpleAdmin (yes/no) " yn +read -p "Do you want to download AT Telnet Daemon and Simple Admin (yes/no) " yn case $yn in yes ) echo ok, we will proceed;; @@ -17,14 +17,68 @@ esac # Download cd /tmp -wget https://github.com/rbflurry/quectel-rgmii-simpleadmin/archive/refs/heads/main.zip +wget https://github.com/iamromulan/quectel-rgmii-simpleadmin-at-telnet-daemon/archive/refs/heads/main.zip # Unzip unzip main.zip -cp -R quectel-rgmii-simpleadmin-main* simpleadmin/ +cp -R quectel-rgmii-simpleadmin-at-telnet-daemon-main* simpleadminattelnetdaemon/ + + +read -p "Do you want to Install AT Telnet Daemon (yes/no) " yn + +case $yn in + yes ) echo ok, we will proceed;; + no ) echo exiting...; + exit;; + * ) echo invalid response; + exit 1;; +esac + # Copy over to /usrdata -cp -R /tmp/simpleadmin /usrdata/ +cp -R /tmp/simpleadminattelnetdaemon/attelnetdaemon/at-telnet /usrdata/ +cp -R /tmp/simpleadminattelnetdaemon/attelnetdaemon/micropython /usrdata/ + +# Chmod execute +chmod +x /usrdata/micropython/micropython /usrdata/at-telnet/modem-multiclient.py /usrdata/at-telnet/socat-armel-static /usrdata/at-telnet/picocom + +# Remount +mount -o remount,rw / + +# Copy systemd init files & reload +cp /usrdata/at-telnet/systemd_units/*.service /lib/systemd/system +systemctl daemon-reload + +# Link systemd files +ln -s /lib/systemd/system/at-telnet-daemon.service /lib/systemd/system/multi-user.target.wants/ +ln -s /lib/systemd/system/socat-smd11.service /lib/systemd/system/multi-user.target.wants/ +ln -s /lib/systemd/system/socat-smd11-to-ttyIN.service /lib/systemd/system/multi-user.target.wants/ +ln -s /lib/systemd/system/socat-smd11-from-ttyIN.service /lib/systemd/system/multi-user.target.wants/ + +# Remount readonly +mount -o remount,ro / + +# Start Services +systemctl start socat-smd11 +sleep 2s +systemctl start socat-smd11-to-ttyIN +systemctl start socat-smd11-from-ttyIN +systemctl start at-telnet-daemon + + +read -p "Do you want to install Simple Admin (yes/no) " yn + +case $yn in + yes ) echo ok, we will proceed;; + no ) echo exiting...; + exit;; + * ) echo invalid response; + exit 1;; +esac + + +# Copy over to /usrdata +cp -R /tmp/simpleadminattelnetdaemon/simpleadmin /usrdata/ # Chmod execute on scripts and cgi-bin chmod +x /usrdata/simpleadmin/scripts/* /usrdata/simpleadmin/www/cgi-bin/* /usrdata/simpleadmin/ttl/ttl-override diff --git a/scripts/build_modem_status b/simpleadmin/scripts/build_modem_status similarity index 100% rename from scripts/build_modem_status rename to simpleadmin/scripts/build_modem_status diff --git a/scripts/doAT.py b/simpleadmin/scripts/doAT.py similarity index 100% rename from scripts/doAT.py rename to simpleadmin/scripts/doAT.py diff --git a/scripts/modemstatus_parse.sh b/simpleadmin/scripts/modemstatus_parse.sh similarity index 100% rename from scripts/modemstatus_parse.sh rename to simpleadmin/scripts/modemstatus_parse.sh diff --git a/scripts/tojson.sh b/simpleadmin/scripts/tojson.sh similarity index 100% rename from scripts/tojson.sh rename to simpleadmin/scripts/tojson.sh diff --git a/systemd/simpleadmin_generate_status.service b/simpleadmin/systemd/simpleadmin_generate_status.service similarity index 100% rename from systemd/simpleadmin_generate_status.service rename to simpleadmin/systemd/simpleadmin_generate_status.service diff --git a/systemd/simpleadmin_httpd.service b/simpleadmin/systemd/simpleadmin_httpd.service similarity index 100% rename from systemd/simpleadmin_httpd.service rename to simpleadmin/systemd/simpleadmin_httpd.service diff --git a/systemd/ttl-override.service b/simpleadmin/systemd/ttl-override.service similarity index 100% rename from systemd/ttl-override.service rename to simpleadmin/systemd/ttl-override.service diff --git a/ttl/ttl-override b/simpleadmin/ttl/ttl-override similarity index 100% rename from ttl/ttl-override rename to simpleadmin/ttl/ttl-override diff --git a/ttl/ttlvalue b/simpleadmin/ttl/ttlvalue similarity index 100% rename from ttl/ttlvalue rename to simpleadmin/ttl/ttlvalue diff --git a/www/atcommander.html b/simpleadmin/www/atcommander.html similarity index 100% rename from www/atcommander.html rename to simpleadmin/www/atcommander.html diff --git a/www/cgi-bin/get_atcommand b/simpleadmin/www/cgi-bin/get_atcommand similarity index 100% rename from www/cgi-bin/get_atcommand rename to simpleadmin/www/cgi-bin/get_atcommand diff --git a/www/cgi-bin/get_csq b/simpleadmin/www/cgi-bin/get_csq similarity index 100% rename from www/cgi-bin/get_csq rename to simpleadmin/www/cgi-bin/get_csq diff --git a/www/cgi-bin/get_ttl_status b/simpleadmin/www/cgi-bin/get_ttl_status similarity index 100% rename from www/cgi-bin/get_ttl_status rename to simpleadmin/www/cgi-bin/get_ttl_status diff --git a/www/cgi-bin/set_ttl b/simpleadmin/www/cgi-bin/set_ttl similarity index 100% rename from www/cgi-bin/set_ttl rename to simpleadmin/www/cgi-bin/set_ttl diff --git a/www/css/admin.css b/simpleadmin/www/css/admin.css similarity index 100% rename from www/css/admin.css rename to simpleadmin/www/css/admin.css diff --git a/www/css/bulma.css b/simpleadmin/www/css/bulma.css similarity index 100% rename from www/css/bulma.css rename to simpleadmin/www/css/bulma.css diff --git a/www/index.html b/simpleadmin/www/index.html similarity index 100% rename from www/index.html rename to simpleadmin/www/index.html diff --git a/www/js/alpinejs.min.js b/simpleadmin/www/js/alpinejs.min.js similarity index 100% rename from www/js/alpinejs.min.js rename to simpleadmin/www/js/alpinejs.min.js diff --git a/www/ttl.html b/simpleadmin/www/ttl.html similarity index 100% rename from www/ttl.html rename to simpleadmin/www/ttl.html diff --git a/uninstall_on_modem.sh b/uninstall_on_modem.sh index ab9a455..5d6b1e3 100644 --- a/uninstall_on_modem.sh +++ b/uninstall_on_modem.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# Removes SimpleAdmin +# Removes SimpleAdmin and AT Telnet Daemon # read -p "Do you want to uninstall SimpleAdmin (yes/no) " yn @@ -47,3 +47,46 @@ systemctl daemon-reload # Remount readonly mount -o remount,ro / + + +read -p "Do you want to uninstall AT Telnet Daemon (yes/no) " yn + +case $yn in + yes ) echo ok, we will proceed;; + no ) echo exiting...; + exit;; + * ) echo invalid response; + exit 1;; +esac + +# ExecStop + +systemctl at-telnet-daemon socat-smd11 socat-smd11-to-ttyIN socat-smd11-from-ttyIN + +#Remove from /usrdata + +rm -rf /usrdata/at-telnet +rm -rf /usrdata/micropython + +# Remount +mount -o remount,rw / + +# Copy systemd init files & reload +#remove links +rm /lib/systemd/system/multi-user.target.wants/at-telnet-daemon.service +rm /lib/systemd/system/multi-user.target.wants/socat-smd11.service +rm /lib/systemd/system/timers.target.wants/socat-smd11-to-ttyIN.service +rm /lib/systemd/system/multi-user.target.wants/socat-smd11-from-ttyIN.service + +#remove files +rm /lib/systemd/system/at-telnet-daemon.service +rm /lib/systemd/system/socat-smd11.service +rm /lib/systemd/system/socat-smd11-to-ttyIN.service +rm /lib/systemd/system/socat-smd11-from-ttyIN.service + +systemctl daemon-reload + +# Link systemd files + +# Remount readonly +mount -o remount,ro / \ No newline at end of file