102 Commits

Author SHA1 Message Date
tyk
e970703a11 更新 simpleupdates/scripts/update_tailscale.sh 2025-09-17 22:22:42 +08:00
tyk
6b1d2dcca0 更新 simpleupdates/scripts/update_sshd.sh 2025-09-17 22:22:24 +08:00
tyk
de3c77ded7 更新 simpleupdates/scripts/update_simplefirewall.sh 2025-09-17 22:22:06 +08:00
tyk
b79f0435b7 更新 simpleupdates/scripts/update_simpleadmin.sh 2025-09-17 22:21:50 +08:00
tyk
fedca206e8 更新 simpleupdates/scripts/update_socat-at-bridge.sh 2025-09-17 22:21:22 +08:00
tyk
36915e3e8f 更新 README.md 2025-09-17 21:57:31 +08:00
tyk
1d57cbbca8 更新 RMxxx_rgmii_toolkit.sh 2025-09-17 21:56:43 +08:00
tyk
c413a02fc7 更新 RMxxx_rgmii_toolkit.sh 2025-09-17 21:49:01 +08:00
Cameron Thompson
909918c538 Merge pull request #170 from iamromulan/development-SDXLEMUR
Merge new PR's for SDXLEMUR
2025-05-31 20:19:31 -04:00
Cameron Thompson
47aaea465b Prep for SDXLEMUR main branch 2025-05-31 20:18:31 -04:00
Cameron Thompson
a48cb19db8 Merge pull request #168 from clndwhr/bug/fix-sms-phone-number
[BUG FIX] Fix Parsing for the phone number on received SMS
2025-05-31 20:11:12 -04:00
Cameron Thompson
630b897cd5 Merge pull request #167 from 1alessandro1/patch-2
Update year, maybe other branches need this too
2025-05-31 20:10:18 -04:00
Christopher Landwehr
2bc2ae3844 had to adjust for SMS Short codes in New Zealand where the minimum can be 3 digits (12 length hex string) 2025-05-22 14:05:18 -04:00
Christopher Landwehr
5ea71c3ccb Change the conditional to check on the hexString length and what it starts with vs just with what it starts with as a HEX string > 17 should indidcate the string is actual Hexadecimal and likely UTF-16BE, or starting with 003/002B and length >15 2025-05-22 13:55:50 -04:00
1alessandro1
179c9fa702 Update year 2025-05-22 00:55:41 +02:00
Cameron Thompson
6dd3eb8ea2 Update README.md 2025-05-16 23:43:09 -04:00
Cameron Thompson
5030f2c0bd Update deployment
- Updated simpleadmin content deployment script to obtain content from latest PR's #163 and #165

- Updated all deployment scripts to reflect a gitroot branch of development-SDXLEMUR

- Removed an unused deployment script that is no longer needed.
2025-05-16 23:40:53 -04:00
Cameron Thompson
94053b777e Merge pull request #165 from clndwhr/bug/fix-PCI-and-EARFCN-on-Homepage
[BUG FIX] PCI and EARFCN for NSA on Simple Admin Home Page
2025-05-16 23:12:02 -04:00
Cameron Thompson
b4cd059b76 Revert more overhaul stuff 2025-05-16 23:10:20 -04:00
Cameron Thompson
696cbf3054 Revert "Progress..."
This reverts commit ec07fb07ac.
2025-05-16 23:09:39 -04:00
Cameron Thompson
6e9acd8c87 Merge pull request #163 from clndwhr/bug/fix-bandwidth-reporting-and-adjust-tac
[BUG FIX] Bandwidth reporting and TAC Adjustment
2025-05-16 23:08:01 -04:00
Cameron Thompson
23038054bd Revert more overhaul stuff 2025-05-16 23:07:00 -04:00
Cameron Thompson
90d53cfe1d Revert "Progress..."
This reverts commit ec07fb07ac.
2025-05-16 23:03:40 -04:00
Cameron Thompson
2ef3ea4cb7 Revert "Merge branch 'SDXLEMUR' into development-SDXLEMUR"
This reverts commit 8c80eb7c0f, reversing
changes made to 8d7b02ca92.
2025-05-16 22:54:55 -04:00
Cameron Thompson
8c80eb7c0f Merge branch 'SDXLEMUR' into development-SDXLEMUR 2025-05-16 22:53:11 -04:00
Christopher Landwehr
72845b4360 migrate and cleanup code for SA codebase and structures 2025-05-16 11:36:33 -04:00
Christopher Landwehr
6c7ed50953 adjusting the logic for PCI on NSA(ENDC), and fixing the index for EARCN PCC on NSA(ENDC) 2025-05-16 10:48:57 -04:00
Christopher Landwehr
5996be64f4 updated NR_BANDWIDTH_LOOKUP to th eaccurate reference 2025-05-12 22:31:03 -04:00
Christopher Landwehr
2cbe8b76ab code reduction 2025-05-12 22:30:41 -04:00
Christopher Landwehr
f021311c93 Tac formatting 2025-05-12 22:30:31 -04:00
Christopher Landwehr
71f7dacf72 offline fonts and font-awesome icons 2025-05-12 22:01:54 -04:00
Christopher Landwehr
517f41c590 adjusting the reported Bandwidth mapping, utilzed the same functionality as QuecManager, updated TAC to show Base10 and Base16 value 2025-05-12 21:27:36 -04:00
Christopher Landwehr
69800c0608 Merge branch 'development-SDXLEMUR' of https://github.com/clndwhr/quectel-rgmii-toolkit into development-SDXLEMUR
# Conflicts:
#	README.md
2025-05-12 21:25:51 -04:00
Cameron Thompson
8d7b02ca92 Update README.md 2025-05-12 21:11:49 -04:00
Cameron Thompson
7ee03707e3 Update README.md 2025-05-12 21:10:57 -04:00
Cameron Thompson
4a76a5d032 Merge pull request #117 from 1alessandro1/SDXLEMUR
Convert eNB to decimal
2025-04-02 22:41:51 -04:00
Cameron Thompson
6c3cf93ffd Merge pull request #116 from 1alessandro1/patch-1
Fix typo
2025-01-28 20:43:14 -05:00
1alessandro1
924e06a153 Convert eNB to decimal 2025-01-27 23:52:38 +01:00
1alessandro1
a6fbc35f18 Fix typo 2025-01-27 23:33:16 +01:00
Cameron Thompson
ec07fb07ac Progress... 2024-12-20 16:31:13 -05:00
Cameron Thompson
d52f2c1b0f Begin rework process of opkg/opt 2024-12-09 18:48:33 +00:00
Cameron Thompson
370eb276a0 Update update_tailscale.sh 2024-11-22 19:35:29 -05:00
Cameron Thompson
550552d1a1 Update start_menu.sh 2024-11-20 22:27:53 -05:00
Cameron Thompson
b2758616cc Fix wrong link 2024-11-13 03:05:13 +00:00
Cameron Thompson
6f72fb4568 Update for new gitroot 2024-11-06 00:32:24 -05:00
Cameron Thompson
3235bd2c46 Update update_tailscale.sh 2024-11-01 00:17:38 -04:00
Cameron Thompson
d48f2f9c59 Update RMxxx_rgmii_toolkit.sh 2024-10-30 23:39:11 +00:00
Cameron Thompson
4b9785ceff Update RMxxx_rgmii_toolkit.sh 2024-10-30 19:18:59 -04:00
Cameron Thompson
64ff33c056 Update at-list.md
Add disable automapn command
2024-09-25 00:30:41 -04:00
Cameron Thompson
fffa77f106 Update at-list.md
Add more details
2024-09-25 00:20:25 -04:00
Cameron Thompson
0673ed1020 github directories can be downloaded 2024-09-16 23:56:57 -04:00
Cameron Thompson
acddaf7b08 Update download 2024-09-07 14:51:52 -04:00
Cameron Thompson
3117d70408 Update download
-Po not supported by busybox grep
2024-09-07 14:39:24 -04:00
Cameron Thompson
0e93104d53 Update at-list.md 2024-09-07 14:02:39 -04:00
Cameron Thompson
b4646a6875 draft 2024-09-04 23:34:36 -04:00
Cameron Thompson
96158cf859 edits 2024-08-25 23:16:44 -04:00
Cameron Thompson
2b961a40ef edits 2024-08-25 23:10:36 -04:00
Cameron Thompson
780e3b4cc8 Update download 2024-08-25 22:37:25 -04:00
Cameron Thompson
c32e90a436 Update download 2024-08-25 22:33:39 -04:00
Cameron Thompson
c3931dd009 Add more diagnostics 2024-08-25 22:24:52 -04:00
Cameron Thompson
643412f4ae Add diagnostic echos 2024-08-25 22:09:03 -04:00
Cameron Thompson
00ca424ae6 Update download 2024-08-25 00:22:17 -04:00
Cameron Thompson
949863c70e Create download
Create a download command that uses curl and falls back to wget. Should be able to download entire directories recursively from github as well.
2024-08-24 23:25:22 -04:00
Cameron Thompson
44f3a7aeed Update update_tailscale.sh
Updated to install latest 1.70.0
2024-07-23 01:24:39 -04:00
Cameron Thompson
ca190cebd1 Revert Changes 2024-07-14 12:23:25 -04:00
Cameron Thompson
435c472b16 Revert changes 2024-07-14 02:51:54 -04:00
Cameron Thompson
9c2870eb61 Update update_simpleadmin.sh 2024-07-14 01:49:15 -04:00
Cameron Thompson
a061212ff4 fix syntax 2024-07-14 01:57:04 -04:00
Cameron Thompson
91d1ade6a4 Fix syntax 2024-07-14 01:56:40 -04:00
Cameron Thompson
f872efca51 Merge pull request #69 from dr-dolomite/feature-watchcat
User AT command implementation
2024-07-14 01:55:20 -04:00
Cameron Thompson
1cd14a2225 Add ARCH check 2024-07-14 01:16:49 -04:00
Cameron Thompson
5fffcfd80d Update tailscale to 1.68.2 2024-07-14 00:45:01 -04:00
Cameron Thompson
f7780a589e Update get_atcommand
Uses atcmd11 now instead of microcom
2024-07-14 00:32:59 -04:00
Cameron Thompson
f2592a3dbb Merge branch 'development' of https://github.com/iamromulan/quectel-rgmii-toolkit into development 2024-07-13 23:23:26 -04:00
Cameron Thompson
865adc2fcd Add atcmd11
Separate commands for separate AT streams
2024-07-13 23:23:20 -04:00
Cameron Thompson
3f32d4001b Merge pull request #68 from dr-dolomite/feature-watchcat
Hot fix and band locking improvement and 502 support
2024-07-13 22:52:15 -04:00
Cameron Thompson
41b2c6a4f9 Update screenshots 2024-07-13 22:38:12 -04:00
Cameron Thompson
b8cd5b3a2a Merge pull request #67 from dr-dolomite/feature-watchcat
Added Various Changes and Fixes for Simple Network
2024-07-13 21:01:37 -04:00
Cameron Thompson
88d300303c Merge pull request #66 from dr-dolomite/feature-watchcat
Hot Fix
2024-07-03 20:03:01 -04:00
Cameron Thompson
65ceb39c1f Merge pull request #65 from dr-dolomite/feature-watchcat
Fixed SINR and RSRQ Swapped values when using NSA
2024-07-01 20:20:03 -04:00
Cameron Thompson
14b45941b0 Merge pull request #64 from dr-dolomite/feature-watchcat
Added Various Changes
2024-07-01 19:52:28 -04:00
Cameron Thompson
f6290708bf Merge pull request #59 from dr-dolomite/development-socat
Changes for Beta 1.0
2024-05-31 18:24:02 -04:00
Cameron Thompson
7c413fe5a0 Capture whole Firmware rev in ttyd 2024-05-26 15:55:18 -04:00
iamromulan
70e9af1273 Fix version number 2024-05-26 15:46:33 -04:00
Cameron Thompson
155e8dd9bb Merge pull request #57 from dr-dolomite/development-socat
Added Changes for Version 0.9
2024-05-24 20:39:13 -04:00
Cameron Thompson
b1cd03ec72 Remove Requires from unit 2024-05-24 13:03:50 -04:00
Cameron Thompson
3965081d97 Ensure opt.mount is available
Ensure that opt.mount is complete before starting lighttpd
2024-05-24 12:22:52 -04:00
iamromulan
9ea53d593d fix chmod 2024-05-23 23:33:02 -04:00
iamromulan
b4bc15f8ef Dumb mistake fix 2024-05-23 23:06:45 -04:00
iamromulan
e6a0c00ce8 Fix mistakes for update script 2024-05-23 22:26:16 -04:00
Cameron Thompson
f6739360ee Merge pull request #56 from dr-dolomite/development-socat
Added Various Changes
2024-05-23 20:31:31 -04:00
Cameron Thompson
f1b08de405 Merge pull request #55 from dr-dolomite/development-socat
Hot Fix for Index (Home Page) Async Problem
2024-05-23 00:43:00 -04:00
Cameron Thompson
9ca4451ef4 Use curl instead
Downloads ttyd and tailscale with curl now. Needed for newer RM520 firmwares.
2024-05-22 15:20:05 -04:00
Cameron Thompson
08b799a906 Merge pull request #53 from dr-dolomite/development-socat
Added Various Changes for Alpha 0.8
2024-05-19 00:06:01 -04:00
iamromulan
744871a90b Make sure curl is on all firmware versions pt2 2024-05-17 23:36:21 -04:00
iamromulan
79f835fd0f Make sure curl is on all firmware versions 2024-05-17 23:24:46 -04:00
Cameron Thompson
5e8bcd1d3f Merge pull request #52 from dr-dolomite/development-socat
Added Various Changes Ready For Merge
2024-05-14 00:48:43 -04:00
iamromulan
5f387e7b17 menu is executable 2024-05-14 00:17:33 -04:00
iamromulan
bf0c2028b1 Update start_menu.sh 2024-05-14 00:14:37 -04:00
iamromulan
0858b03da2 Update start_menu.sh 2024-05-13 23:20:42 -04:00
iamromulan
408cf583dd Install Console Menu 2024-05-13 22:35:32 -04:00
Cameron Thompson
ff23e5cfac Merge pull request #50 from dr-dolomite/development-socat
NSA Mode Bandwidth Parsing and SMS Layout Fixes
2024-05-11 23:14:10 -04:00
34 changed files with 6946 additions and 310 deletions

View File

@@ -1,9 +1,9 @@
# RGMII Toolkit
Software deployment Toolkit for Quectel RM5xxx series 5G modems utilizing an m.2 to RJ45 adapter (RGMII)
Current Branch: **Development**
Current Branch: **SDXLEMUR**
Please PR to this branch instead of main :)
Please PR to [development-SDXLEMUR](https://github.com/iamromulan/quectel-rgmii-toolkit/tree/development-SDXLEMUR) instead of the main one :)
Fork development, and PR development to development :)
@@ -29,10 +29,14 @@ Fork development, and PR development to development :)
**My goal** is for this to also include any new useful scripts or software for this modem and others that support RGMII mode.
## Screenshots
![Home Page](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/iamromulansimpleindex.png?raw=true)
![AT Commands](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/iamromulanatcommands.png?raw=true)
![TTL](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/iamromulansimpleTTL.png?raw=true)
![Toolkit](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/iamromulantoolkit.png?raw=true)
![Toolkit](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/dev_toolkit.png?raw=true)
![Home](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/dev_home.png?raw=true)
![Simple Network](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/dev_simplenetwork.png?raw=true)
![Simple Scan](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/dev_simplescan.png?raw=true)
![Simple Settings](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/dev_simplesettings.png?raw=true)
![SMS](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/dev_sms.png?raw=true)
![Console](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/dev_console.png?raw=true)
![Device Info](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/dev_deviceinfo.png?raw=true)
# Devleopment Branch: the below commands will download the beta/work in progress toolkit
@@ -45,7 +49,7 @@ Fork development, and PR development to development :)
- If you don't get an error you should be getting replies back endlessly, press `CTRL-C` to stop it.
- Simply Copy/Paste this into your Command Prompt/Shell
```bash
adb shell "cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/development/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh" && cd /
adb shell "cd /tmp && wget -O RMxxx_rgmii_toolkit.sh http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh" && cd /
```
**Or, if you want to stay in the modems shell when you are done**
@@ -55,7 +59,7 @@ adb shell
```
Then run
```
cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/development/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd /
cd /tmp && wget -O RMxxx_rgmii_toolkit.sh http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd /
```
**You should see:**
![Toolkit](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/iamromulantoolkit.png?raw=true)

View File

@@ -1,10 +1,15 @@
#!/bin/sh
# Define toolkit paths
GITUSER="iamromulan"
GITTREE="development"
GITMAINTREE="main"
GITDEVTREE="development"
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:/usrdata/root/bin
GITUSER="tyk"
REPONAME="quectel-rgmii-toolkit"
GITTREE="SDXLEMUR"
GITMAINTREE="SDXLEMUR"
GITDEVTREE="development-SDXLEMUR"
GITROOT="http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR"
GITROOTMAIN="http://git.ievo.top/$GITUSER/$REPONAME/$GITMAINTREE"
GITROOTDEV="http://git.ievo.top/$GITUSER/$REPONAME/$GITDEVTREE"
TMP_DIR="/tmp"
USRDATA_DIR="/usrdata"
SOCAT_AT_DIR="/usrdata/socat-at-bridge"
@@ -104,7 +109,7 @@ ensure_entware_installed() {
remount_rw
if [ ! -f "/opt/bin/opkg" ]; then
echo -e "\e[1;32mInstalling Entware/OPKG\e[0m"
cd /tmp && wget -O installentware.sh "https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/installentware.sh" && chmod +x installentware.sh && ./installentware.sh
cd /tmp && wget -O installentware.sh "$GITROOT/installentware.sh" && chmod +x installentware.sh && ./installentware.sh
if [ "$?" -ne 0 ]; then
echo -e "\e[1;31mEntware/OPKG installation failed. Please check your internet connection or the repository URL.\e[0m"
exit 1
@@ -161,7 +166,17 @@ ensure_entware_installed() {
else
echo "useradd already exists. Continuing..."
fi
if [ ! -f "/usr/bin/curl" ] && [ ! -f "/opt/bin/curl" ]; then
echo "curl does not exist. Installing curl..."
opkg update && opkg install curl
if [ "$?" -ne 0 ]; then
echo -e "\e[1;31mFailed to install curl. Please check your internet connection and try again.\e[0m"
exit 1
fi
else
echo "curl already exists. Continuing..."
fi
}
#Uninstall Entware if the Users chooses
@@ -293,8 +308,8 @@ set_simpleadmin_passwd(){
ensure_entware_installed
opkg update
opkg install libaprutil
wget -O /usrdata/root/bin/htpasswd https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/htpasswd && chmod +x /usrdata/root/bin/htpasswd
wget -O /usrdata/root/bin/simplepasswd https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/simplepasswd && chmod +x /usrdata/root/bin/simplepasswd
wget -O /usrdata/root/bin/htpasswd $GITROOT/simpleadmin/htpasswd && chmod +x /usrdata/root/bin/htpasswd
wget -O /usrdata/root/bin/simplepasswd $GITROOT/simpleadmin/simplepasswd && chmod +x /usrdata/root/bin/simplepasswd
echo -e "\e[1;32mTo change your simpleadmin (admin) password in the future...\e[0m"
echo -e "\e[1;32mIn the console type simplepasswd and press enter\e[0m"
/usrdata/root/bin/simplepasswd
@@ -308,54 +323,31 @@ set_root_passwd() {
# Function to install/update Simple Admin
install_simple_admin() {
while true; do
echo -e "\e[1;32mWhat version of Simple Admin do you want to install? This will start a webserver on port 80/443 on test build\e[0m"
echo -e "\e[1;32m1) Stable current version, (Main Branch)\e[0m"
echo -e "\e[1;31m2) Install Test Build (Development Branch)\e[0m"
echo -e "\e[0;33m3) Return to Main Menu\e[0m"
echo -e "\e[1;32mSelect your choice: \e[0m"
read choice
case $choice in
1)
echo -e "\e[1;32mYou are using the development toolkit; Use the one from main if you want the stable version right now\e[0m"
break
;;
2)
ensure_entware_installed
echo -e "\e[1;31m2) Installing simpleadmin from the development test branch\e[0m"
mkdir /usrdata/simpleupdates > /dev/null 2>&1
mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1
wget -O /usrdata/simpleupdates/scripts/update_socat-at-bridge.sh https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleupdates/scripts/update_socat-at-bridge.sh && chmod +x /usrdata/simpleupdates/scripts/update_socat-at-bridge.sh
echo -e "\e[1;32mInstalling/updating dependency: socat-at-bridge\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_socat-at-bridge.sh
echo -e "\e[1;32m Dependency: socat-at-bridge has been updated/installed.\e[0m"
sleep 1
wget -O /usrdata/simpleupdates/scripts/update_simplefirewall.sh https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleupdates/scripts/update_simplefirewall.sh && chmod +x /usrdata/simpleupdates/scripts/update_simplefirewall.sh
echo -e "\e[1;32mInstalling/updating dependency: simplefirewall\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_simplefirewall.sh
echo -e "\e[1;32m Dependency: simplefirewall has been updated/installed.\e[0m"
sleep 1
set_simpleadmin_passwd
wget -O /usrdata/simpleupdates/scripts/update_simpleadmin.sh https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleupdates/scripts/update_simpleadmin.sh && chmod +x /usrdata/simpleupdates/scripts/update_simpleadmin.sh
echo -e "\e[1;32mInstalling/updating: Simpleadmin content\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_simpleadmin.sh
echo -e "\e[1;32mSimpleadmin content has been updated/installed.\e[0m"
sleep 1
break
;;
3)
echo "Returning to main menu..."
break
;;
*)
echo "Invalid choice. Please try again."
;;
esac
done
echo -e "\e[1;32mInstalling Simpleadmin 2.0\e[0m"
ensure_entware_installed
echo -e "\e[1;31m2) Installing Simpleadmin 2.0\e[0m"
mkdir /usrdata/simpleupdates > /dev/null 2>&1
mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1
wget -O /usrdata/simpleupdates/scripts/update_socat-at-bridge.sh $GITROOT/simpleupdates/scripts/update_socat-at-bridge.sh && chmod +x /usrdata/simpleupdates/scripts/update_socat-at-bridge.sh
echo -e "\e[1;32mInstalling/updating dependency: socat-at-bridge\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_socat-at-bridge.sh
echo -e "\e[1;32m Dependency: socat-at-bridge has been updated/installed.\e[0m"
sleep 1
wget -O /usrdata/simpleupdates/scripts/update_simplefirewall.sh $GITROOT/simpleupdates/scripts/update_simplefirewall.sh && chmod +x /usrdata/simpleupdates/scripts/update_simplefirewall.sh
echo -e "\e[1;32mInstalling/updating dependency: simplefirewall\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_simplefirewall.sh
echo -e "\e[1;32m Dependency: simplefirewall has been updated/installed.\e[0m"
sleep 1
set_simpleadmin_passwd
wget -O /usrdata/simpleupdates/scripts/update_simpleadmin.sh $GITROOT/simpleupdates/scripts/update_simpleadmin.sh && chmod +x /usrdata/simpleupdates/scripts/update_simpleadmin.sh
echo -e "\e[1;32mInstalling/updating: Simpleadmin content\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_simpleadmin.sh
echo -e "\e[1;32mSimpleadmin content has been updated/installed.\e[0m"
sleep 1
break
}
# Function to Uninstall Simpleadmin and dependencies
@@ -475,9 +467,10 @@ tailscale_menu() {
# Function to install, update, or remove Tailscale
install_update_tailscale() {
echo -e "\e[1;31m2) Installing tailscale from the $GITTREE branch\e[0m"
ensure_entware_installed
mkdir /usrdata/simpleupdates > /dev/null 2>&1
mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1
wget -O /usrdata/simpleupdates/scripts/update_tailscale.sh https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleupdates/scripts/update_tailscale.sh && chmod +x /usrdata/simpleupdates/scripts/update_tailscale.sh
wget -O /usrdata/simpleupdates/scripts/update_tailscale.sh $GITROOT/simpleupdates/scripts/update_tailscale.sh && chmod +x /usrdata/simpleupdates/scripts/update_tailscale.sh
echo -e "\e[1;32mInstalling/updating: Tailscale\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
remount_rw
@@ -503,8 +496,8 @@ configure_tailscale() {
1)
remount_rw
cd /lib/systemd/system/
wget -O tailscale-webui.service https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/main/tailscale/systemd/tailscale-webui.service
wget -O tailscale-webui-trigger.service https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/main/tailscale/systemd/tailscale-webui-trigger.service
wget -O tailscale-webui.service $GITROOT/tailscale/systemd/tailscale-webui.service
wget -O tailscale-webui-trigger.service $GITROOT/tailscale/systemd/tailscale-webui-trigger.service
ln -sf /lib/systemd/system/tailscale-webui-trigger.service /lib/systemd/system/multi-user.target.wants/
systemctl daemon-reload
echo "Tailscale Web UI Enabled"
@@ -745,7 +738,7 @@ install_sshd() {
ensure_entware_installed
mkdir /usrdata/simpleupdates > /dev/null 2>&1
mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1
wget -O /usrdata/simpleupdates/scripts/update_sshd.sh https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleupdates/scripts/update_sshd.sh && chmod +x /usrdata/simpleupdates/scripts/update_sshd.sh
wget -O /usrdata/simpleupdates/scripts/update_sshd.sh $GITROOT/simpleupdates/scripts/update_sshd.sh && chmod +x /usrdata/simpleupdates/scripts/update_sshd.sh
echo -e "\e[1;32mInstalling/updating: SSHd\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_sshd.sh
@@ -754,6 +747,20 @@ install_sshd() {
# Main menu
ARCH=$(uname -a)
if echo "$ARCH" | grep -q "aarch64"; then
cd /tmp && wget -O RM55x_rcPCIe_toolkit.sh http://git.ievo.top/iamromulan/quectel-rgmii-toolkit/SDXPINN/RM55x_rcPCIe_toolkit.sh && chmod +x RM55x_rcPCIe_toolkit.sh && ./RM55x_rcPCIe_toolkit.sh && cd /
exit 0
elif echo "$ARCH" | grep -q "armv7l"; then
# Continue if architecture is armv7l
echo "Architecture is armv7l, continuing..."
else
uname -a
echo "Unsupported architecture."
exit 1
fi
while true; do
echo " .%+: "
echo " .*@@@-. "

109
at-list.md Normal file
View File

@@ -0,0 +1,109 @@
# Useful AT Commands
You can send more than one command at once by sperating them with ``;`` and not including the AT part. ``AT+QENG="servingcell";+QCAINFO`` for example to see the info from both ``AT+QENG="servingcell"`` and ``AT+QCAINFO``
## PCIe RC Ethernet mode setup
### For RM500-RM521 modems
``AT+QETH="eth_driver","r8125",1;+QCFG="pcie/mode",1;+QCFG="usbnet",1;+QMAP="MPDN_rule",0,1,0,1,1,"FF:FF:FF:FF:FF:FF";+QMAP="DHCPV4DNS","disable";+QCFG="usbcfg",0x2C7C,0x0801,1,1,1,1,1,2,0;+CFUN=1,1``
This will do the following:
- Set the 2.5Gig Ethernet driver as active
- Enable PCIe RC mode
- Set to ECM mode via USB and AP mode connection behavior
- Enable IPPT
- Enable DNS IPPT (disables onboard proxy)
- Force Enables ADB Access
- Reboots after all the above
### For x70 modems (RM550/551)
For BETA versions of firmware: the adb value 2 trick still works so one and done:
``AT+QCFG="pcie/mode",1;+QCFG="usbnet",1;+QCFG="usbcfg",0x2C7C,0x0122,1,1,1,1,1,2,0;+CFUN=1,1``
OR if you are running the latest non-beta firmware
``AT+QCFG="pcie/mode",1;+QCFG="usbnet",1``
Then unlock ADB:
Ask the modem for its adb code by sending: ``AT+QADBKEY?``
It'll respond with something like ``+QADBKEY: 29229988``
Take that number and paste it in this generator: https://onecompiler.com/python/3znepjcsq (hint: where it says STDIN)
You should get something like
``AT+QADBKEY="mrX4zOPwdSIEjfM"``
Send that command to the modem and adb will be able to be turned on with the next command
Now you can turn it on with the usbcfg command ``AT+QCFG="usbcfg"``
***Be super careful, this controls what ports are on/off over USB.***
Run it and you will get the current settings. Something like this:
``+QCFG: "usbcfg",0x2C7C,0x0122,1,1,1,1,1,0,0``
Send ``AT+QCFG="usbcfg",0x2C7C,0x0122,1,1,1,1,1,1,0`` to enable adb
Now you can reboot: ``AT+CFUN=1,1``
This will do the following:
- Enable PCIe RC mode (Driver selection is automatic now)
- Set to ECM mode via USB and AP mode connection behavior
- Force Enables ADB Access
- Reboots after all the above
Tip: APN automatic selection will somtimes choose the wrong APN. You may need to set your APN after powering up with the SIM inserted.
## The List
- ``AT+CFUN=1,1`` (reboot)
- ``AT+CFUN=0;CFUN=1`` (Disconnect then reconnect)(tip: run this after chnaging APN and you don't have to reboot)
- ``AT+QMAPWAC? ``(get current status of auto connect, 0=disabled 1=enabled)
- ``AT+QMAPWAC=1`` (enable auto connect internet for ethernet)
- ``AT+QMAPWAC=0`` (disable auto connect for ethernet; use when you want internet over USB to work; IPPT must be disabled)
- ``AT+QUIMSLOT?`` (get active sim slot; 1=Slot 1; 2=Slot 2)
- ``AT+QUIMSLOT=1`` (switch to sim slot 1)
- ``AT+QUIMSLOT=2`` (switch to sim slot 2)
- ``AT+CGDCONT?`` (Get active APN profle st 1 through 8)
- ``AT+QMBNCFG="AutoSel",0;+QMBNCFG="Deactivate"`` (Disable Automatic APN selection)(You will need to set your APN when you switch SIMs or Slots)(Can also set APN after you switch the run ``AT+CFUN=0;CFUN=1``
- ``AT+CGDCONT=1,"IPV4V6","APNHERE"`` (Sets APN profile 1 to APNHERE using both IPV4 and IPV6)
- ``AT+GSN`` (Show current IMEI)
- ``AT+EGMR=0,7`` (Show current IMEI)
- ``AT+EGMR=1,7,"IMEIGOESHERE"`` (sets/repairs IMEI)
- ``AT+QCFG="usbcfg",0x2C7C,0x0801,1,1,1,1,1,2,0`` (enables adb bypasses adb key)
- ``AT+QENG="servingcell"`` (shows anchor band and network connection status)
- ``AT+QCAINFO`` (Show all connected bands/CA info)
- ``AT+QNWPREFCFG="mode_pref"`` (Check what the current network search mode is set to)
- ``AT+QNWPREFCFG="mode_pref",AUTO`` (Set network search mode to automatic)
- ``AT+QNWPREFCFG="mode_pref",NR5G:LTE`` (Set network search mode to 5GNR and 4GLTE only)
- ``AT+QNWPREFCFG="mode_pref",NR5G`` (Set network search mode to 5GNR only)
- ``AT+QNWPREFCFG="mode_pref",LTE`` (Set network search mode to 4GLTE only)
- ``AT+QNWPREFCFG="nr5g_disable_mode"`` (Check to see if SA or NSA NR5G is disabled)
- ``AT+QNWPREFCFG="nr5g_disable_mode",0`` (Enable Both SA and NSA 5GNR)
- ``AT+QNWPREFCFG="nr5g_disable_mode",1`` (Disable SA 5GNR only)
- ``AT+QNWPREFCFG="nr5g_disable_mode",2`` (Disable NSA 5GNR only)
- ``AT+QNWPREFCFG="nr5g_band"`` (Get current SA 5GNR bandlock settings)
- ``AT+QNWPREFCFG="nsa_nr5g_band"`` (Get current NSA 5GNR bandlock settings)
- ``AT+QNWPREFCFG="nr5g_band",1:2:3:4:5:6`` (Example: Lock to SA 5G/NR bands n1,n2,n3,n4,n5, and n6)
- ``AT+QNWPREFCFG="nsa_nr5g_band",1:2:3:4:5:6`` (Example: Lock to SA 5G/NR bands n1,n2,n3,n4,n5, and n6)
- ``AT+QNWPREFCFG="lte_band"`` (Get current 4GLTE bandlock settings)
- ``AT+QNWPREFCFG="lte_band",1:2:3:4:5:6`` (Example: Lock to 4G/LTE bands 1,2,3,4,5, and 6)
- ``AT+QMAP="WWAN"`` (Show currently assigned IPv4 and IPv6 from the provider)
- ``AT+QMAP="LANIP"`` (Show current DHCP range and Gateway address for VLAN0)
- ``AT+QMAP="LANIP",IP_start_range,IP_end_range,Gateway_IP `` (Set IPv4 Start/End range and Gateway IP of DHCP for VLAN0)
- ``AT+QMAP="DHCPV4DNS","disable"`` (disable the onboard DNS proxy; recommended for IPPT)
- ``AT+QMAP="MPDN_rule",0,1,0,1,1,"FF:FF:FF:FF:FF:FF"`` (Turn on IP Passthrough for Ethernet)
(:warning: On the RM551E-GL you must specify the ethernet devices MAC address instead of FF:FF:FF...)
- ``AT+QMAP="MPDN_rule",0`` (turn off IPPT/clear MPDN rule 0; Remember to run AT+QMAPWAC=1 and reboot after)

114
download Normal file
View File

@@ -0,0 +1,114 @@
#!/bin/sh
# Determine the absolute path of the script
SCRIPT_PATH=$(realpath "$0")
download() {
if [ "$1" = "github" ]; then
download_github_directory "$2" "$3"
else
download_file "$1" "$2"
fi
}
download_file() {
url="$1"
output="${2:-$(basename "$url")}"
echo "Attempting to download file from URL: $url"
echo "Saving to output: $output"
# Ensure the output directory exists
mkdir -p "$(dirname "$output")"
if command -v curl > /dev/null 2>&1; then
curl -L -o "$output" "$url"
elif command -v wget > /dev/null 2>&1; then
wget -O "$output" "$url"
else
echo "Error: Neither curl nor wget is available."
exit 1
fi
}
download_github_directory() {
github_url="$1"
output_dir="${2:-.}" # Set output directory to the provided parameter or current directory
repo_info=$(echo "$github_url" | sed -n 's|https://github.com/\([^/]*\)/\([^/]*\)/tree/\([^/]*\)/\(.*\)|\1 \2 \3 \4|p')
owner=$(echo "$repo_info" | cut -d' ' -f1)
repo=$(echo "$repo_info" | cut -d' ' -f2)
branch=$(echo "$repo_info" | cut -d' ' -f3)
directory=$(echo "$repo_info" | cut -d' ' -f4)
echo "Owner: $owner, Repo: $repo, Branch: $branch, Directory: $directory"
if [ -z "$owner" ] || [ -z "$repo" ] || [ -z "$branch" ] || [ -z "$directory" ]; then
echo "Error: Invalid GitHub URL."
exit 1
fi
echo "Output directory set to: $output_dir"
api_url="https://api.github.com/repos/$owner/$repo/contents/$directory?ref=$branch"
echo "Fetching directory contents from API URL: $api_url"
if command -v curl > /dev/null 2>&1; then
contents=$(curl -s -H "Accept: application/vnd.github.v3+json" "$api_url")
elif command -v wget > /dev/null 2>&1; then
contents=$(wget -qO- --header="Accept: application/vnd.github.v3+json" "$api_url")
else
echo "Error: Neither curl nor wget is available."
exit 1
fi
echo "API Response Contents:"
echo "$contents"
# Use awk to parse JSON content and prepare commands
echo "$contents" | awk -v output_dir="$output_dir" -v owner="$owner" -v repo="$repo" -v branch="$branch" -v script_path="$SCRIPT_PATH" '
BEGIN {
RS="},"; FS=","; # Set Record Separator to "}," and Field Separator to ","
}
/"type": "file"/ {
file_path = ""; download_url = "";
for (i = 1; i <= NF; i++) {
if ($i ~ /"path": "/) {
gsub(/.*"path": "/, "", $i);
gsub(/".*/, "", $i);
file_path = $i;
}
if ($i ~ /"download_url": "/) {
gsub(/.*"download_url": "/, "", $i);
gsub(/".*/, "", $i);
download_url = $i;
}
}
if (file_path && download_url) {
output_file_path = output_dir "/" file_path;
print "Calling download_file for:", download_url, "to", output_file_path;
system("'"$SCRIPT_PATH"'" " \"" download_url "\" \"" output_file_path "\"");
}
}
/"type": "dir"/ {
sub_dir = "";
for (i = 1; i <= NF; i++) {
if ($i ~ /"path": "/) {
gsub(/.*"path": "/, "", $i);
gsub(/".*/, "", $i);
sub_dir = $i;
}
}
if (sub_dir) {
print "Calling download_github_directory for sub-directory:", sub_dir;
system("'"$SCRIPT_PATH"'" " github \"https://github.com/" owner "/" repo "/tree/" branch "/" sub_dir "\" \"" output_dir "\"");
}
}'
}
if [ "$#" -eq 0 ]; then
echo "Usage: download <type> <url> [output_directory]"
exit 1
else
download "$@"
fi

View File

@@ -81,9 +81,9 @@ set_ttl(){
# function to configure the fetures of simplefirewall
simple_firewall_menu() {
if [ ! -f "$SIMPLE_FIREWALL_SCRIPT" ]; then
echo -e "\033[0;31mSimplefirewall is not installed, would you like to install it?\033[0m"
echo -e "\033[0;32m1) Yes\033[0m"
echo -e "\033[0;31m2) No\033[0m"
display_random_color "Simplefirewall is not installed, would you like to install it?"
display_green "1) Yes"
display_red "2) No"
read -p "Enter your choice (1-2): " install_choice
case $install_choice in
@@ -94,14 +94,15 @@ simple_firewall_menu() {
return
;;
*)
echo -e "\033[0;31mInvalid choice. Please select either 1 or 2.\033[0m"
display_red "Invalid choice. Please select either 1 or 2."
;;
esac
fi
echo -e "\e[1;32mConfigure Simple Firewall:\e[0m"
echo -e "\e[38;5;208m1) Configure incoming port block\e[0m"
echo -e "\e[38;5;27m2) Configure TTL\e[0m"
display_random_color "Configure Simple Firewall:"
display_green "1) Configure incoming port block"
display_green "2) Configure TTL"
display_green "3) Exit to Main Menu"
read -p "Enter your choice (1-2): " menu_choice
case $menu_choice in
@@ -111,6 +112,9 @@ simple_firewall_menu() {
2)
set_ttl
;;
3)
return
;;
*)
echo -e "\e[1;31mInvalid choice. Please select either 1 or 2.\e[0m"
;;
@@ -120,6 +124,6 @@ simple_firewall_menu() {
echo -e "\e[1;32mFirewall configuration updated.\e[0m"
}
# Start by checking and installing xml if necessary, then mount filesystem as rw and run the menu
# Main execution
mount -o remount,rw /
simple_firewall_menu

View File

@@ -24,18 +24,18 @@ display_red() {
toolkit_menu() {
while true; do
display_green "Run a Toolkit version"
display_random_color "Run a Toolkit version"
display_green "Select an option:"
echo "------------------"
display_green "1. Get and run the Toolkit"
display_red "2. Get and run the Development/unstable Toolkit"
display_red "3. Exit (Enter Root Shell)"
display_random_color "2. Get and run the Development/unstable Toolkit"
display_random_color "3. Exit (Enter Root Shell)"
echo
read -p "Select an option (1-11): " option
read -p "Select an option (1-3): " option
case "$option" in
1) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
2) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/development/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
1) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/SDXLEMUR/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
2) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/development-SDXLEMUR/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
3) break ;;
*) echo "Invalid option. Please try again." ;;
esac
@@ -44,7 +44,7 @@ toolkit_menu() {
apps_menu() {
while true; do
display_green "Run a modem App"
display_random_color "Run a modem App"
display_green "Select an option:"
echo "------------------"
display_random_color "1. Open File Browser/Editor (mc)"
@@ -52,17 +52,17 @@ apps_menu() {
display_random_color "3. Open Task Manager/View CPU Load"
display_random_color "4. Run speedtest.net test"
display_random_color "5. Run fast.com test (30Mbps max)"
display_red "6. Go Back"
display_green "6. Go Back"
echo
read -p "Select an option (1-11): " option
read -p "Select an option (1-6): " option
case "$option" in
4) mc ;;
5) dfc ;;
6) htop ;;
7) speedtest ;;
8) fast ;;
11) break ;;
1) mc ;;
2) dfc ;;
3) htop ;;
4) speedtest ;;
5) fast ;;
6) break ;;
*) echo "Invalid option. Please try again." ;;
esac
done
@@ -70,21 +70,23 @@ apps_menu() {
settings_menu() {
while true; do
display_green "Welcome to iamromulan's Simple Console Menu"
display_random_color "Welcome to" && display_green "iamromulan's" && display_random_color "Simple Console Menu"
display_green "Select an option:"
echo "------------------"
display_green "1. LAN Settings"
display_green "2. Change simpleadmin (admin) password"
display_green "3. Change root password (shell/ssh/console)"
display_green "4. Go back"
display_green "2. simplefirewall settings (TTL and Port Block)"
display_green "3. Change simpleadmin (admin) password"
display_green "4. Change root password (shell/ssh/console)"
display_green "5. Go back"
echo
read -p "Select an option (1-11): " option
read -p "Select an option (1-5): " option
case "$option" in
1) $MENU_SH/LAN_settings ;;
2) $EXE/simplepasswd ;;
3) passwd ;;
4) break ;;
1) $MENU_SH/LAN_settings.sh ;;
2) $MENU_SH/sfirewall_settings.sh ;;
3) simplepasswd ;;
4) passwd ;;
5) break ;;
*) echo "Invalid option. Please try again." ;;
esac
done
@@ -93,15 +95,15 @@ settings_menu() {
main_menu() {
while true; do
display_green "Welcome to iamromulan's Simple Console Menu"
display_green "To get back to this from the root shell, just type 'menu'"
display_green "To get back to this from the root shell, just type 'menu'"
display_green "Select an option:"
echo "------------------"
display_random_color "1) Apps"
display_random_color "2) Settings"
display_random_color "3) Toolkit"
display_random_color "4) Exit (Enter Root Shell)"
display_random_color "1. Apps"
display_random_color "2. Settings"
display_random_color "3. Toolkit"
display_random_color "4. Exit (Enter Root Shell)"
echo
read -p "Select an option (1-11): " option
read -p "Select an option (1-4): " option
case "$option" in
1) apps_menu ;;
@@ -113,4 +115,4 @@ main_menu() {
done
}
main_menu
main_menu

View File

@@ -5,7 +5,7 @@ if [ -f "/usrdata/socat-at-bridge/atcmd" ]; then
# Read the serial number
serial_number=$(/usrdata/socat-at-bridge/atcmd 'AT+EGMR=0,5' | grep '+EGMR:' | cut -d '"' -f2)
# Read the firmware revision
firmware_revision=$(/usrdata/socat-at-bridge/atcmd 'AT+CGMR' | grep -o 'RM[0-9A-Z]*' | head -1)
firmware_revision=$(/usrdata/socat-at-bridge/atcmd 'AT+QGMR' | grep -o 'RM[0-9A-Z].*')
else
serial_number="UNKNOWN"
firmware_revision="UNKNOWN"

View File

@@ -1,6 +1,6 @@
[Unit]
Description=Lighttpd Daemon
After=network.target
After=network.target opt.mount
[Service]
Type=simple

View File

@@ -5,7 +5,7 @@ After=network.target
[Service]
Type=simple
ExecStartPre=/bin/sleep 5
ExecStart=/usrdata/simpleadmin/ttyd -i 127.0.0.1 -p 8080 -t 'theme={"foreground":"white","background":"black"}' -t fontSize=25 --writable /usrdata/simpleadmin/console/ttyd.bash
ExecStart=/usrdata/simpleadmin/console/ttyd -i 127.0.0.1 -p 8080 -t 'theme={"foreground":"white","background":"black"}' -t fontSize=25 --writable /usrdata/simpleadmin/console/ttyd.bash
Restart=on-failure
[Install]

View File

@@ -16,11 +16,20 @@ fi
x=$(urldecode "$atcmd")
MYATCMD=$(printf '%b\n' "${atcmd//%/\\x}")
if [ -n "${MYATCMD}" ]; then
# Capture the response and remove ANSI color codes using awk
runcmd=$(atcmd11 "$x" | awk '{ gsub(/\x1B\[[0-9;]*[mG]/, "") }1')
# Initialize wait time to 200 ms
wait_time=200
while true; do
runcmd=$(echo -en "$x\r\n" | microcom -t $wait_time /dev/ttyOUT2)
# Check if "OK" or "ERROR" is present in the response
if [[ $runcmd =~ "OK" ]] || [[ $runcmd =~ "ERROR" ]]; then
break # Exit the loop if "OK" or "ERROR" is found
fi
# If neither "OK" nor "ERROR" is found, increment wait time by 1 second
((wait_time++))
done
fi
echo "Content-type: text/plain"
echo $x
echo ""
echo "$runcmd"
echo $runcmd

View File

@@ -17,10 +17,10 @@ x=$(urldecode "$atcmd")
MYATCMD=$(printf '%b\n' "${atcmd//%/\\x}")
if [ -n "${MYATCMD}" ]; then
# Capture the response and remove ANSI color codes using awk
runcmd=$(atcmd "$x" | awk '{ gsub(/\x1B\[[0-9;]*[mG]/, "") }1')
runcmd=$(atcmd '$x' | awk '{ gsub(/\x1B\[[0-9;]*[mG]/, "") }1')
fi
echo "Content-type: text/plain"
echo $x
echo ""
echo "$runcmd"
echo "$runcmd"

6143
simpleadmin/www/css/all.min.css vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,86 @@
/* import poppins */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
/* poppins-300 - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Poppins';
font-style: normal;
font-weight: 300;
src: url('../fonts/poppins-v23-latin-300.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-300italic - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Poppins';
font-style: italic;
font-weight: 300;
src: url('../fonts/poppins-v23-latin-300italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-regular - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Poppins';
font-style: normal;
font-weight: 400;
src: url('../fonts/poppins-v23-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-italic - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Poppins';
font-style: italic;
font-weight: 400;
src: url('../fonts/poppins-v23-latin-italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-500 - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
src: url('../fonts/poppins-v23-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-500italic - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Poppins';
font-style: italic;
font-weight: 500;
src: url('../fonts/poppins-v23-latin-500italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-600 - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Poppins';
font-style: normal;
font-weight: 600;
src: url('../fonts/poppins-v23-latin-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-600italic - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Poppins';
font-style: italic;
font-weight: 600;
src: url('../fonts/poppins-v23-latin-600italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-700 - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Poppins';
font-style: normal;
font-weight: 700;
src: url('../fonts/poppins-v23-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-700italic - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Poppins';
font-style: italic;
font-weight: 700;
src: url('../fonts/poppins-v23-latin-700italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* import fontawesome icons */
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css");
@import url("./all.min.css");
* {
font-family: "Poppins", sans-serif;

View File

@@ -302,7 +302,7 @@
class="text-reset"
>documentation</a
>
for more information. All rights reserved. 2024
for more information. All rights reserved. 2025
</div>
</div>
</div>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -275,7 +275,7 @@
<table class="table">
<tbody>
<tr>
<th scope="row">Assesment</th>
<th scope="row">Assessment</th>
<td x-text="signalAssessment"></td>
</tr>
<tr>
@@ -852,14 +852,15 @@
}
// --- Bandwidth ---
// find this example value from lines "+QENG: \"servingcell\"
const bandwidth_line = lines.find((line) =>
line.includes('+QENG: "servingcell"')
);
if (
this.networkMode == "5G SA TDD" ||
this.networkMode == "5G SA FDD"
) {
// find this example value from lines "+QENG: \"servingcell\"
const bandwidth_line = lines.find((line) =>
line.includes('+QENG: "servingcell"')
);
const nr_bw = bandwidth_line.split(",")[11];
const calculated_bandwidth = this.calculate_nr_bw(nr_bw);
this.bandwidth = "NR " + calculated_bandwidth + " MHz";
@@ -867,11 +868,6 @@
this.networkMode == "4G LTE FDD" ||
this.networkMode == "4G LTE TDD"
) {
// find this example value from lines "+QENG: \"servingcell\"
const bandwidth_line = lines.find((line) =>
line.includes('+QENG: "servingcell"')
);
const lte_bw_ul = bandwidth_line.split(",")[10];
const lte_bw_dl = bandwidth_line.split(",")[11];
const calculated_bandwidth_ul =
@@ -985,7 +981,7 @@
// find this value from lines "+QCAINFO: \"PCC\"
const lte_pcc_arfcn = lines
.find((line) => line.includes('+QCAINFO: "PCC"'))
.split(",")[5];
.split(",")[1];
try {
// Look for all the lines with this value "+QCAINFO: \"SCC\" and store them in an array
@@ -1054,7 +1050,6 @@
const lte_pcc_pci = lines
.find((line) => line.includes('+QCAINFO: "PCC"'))
.split(",")[5];
try {
// Look for all the lines with this value "+QCAINFO: \"SCC\" and store them in an array
const lte_scc_pci = lines.filter((line) =>
@@ -1079,39 +1074,38 @@
this.sccPCI = "-";
}
} else if (this.networkMode == "5G NSA") {
// find this value from lines "+QCAINFO: \"PCC\"
const lte_pcc_pci = lines
.find((line) => line.includes('+QCAINFO: "PCC"'))
.split(",")[5];
try {
// Look for all the lines with this value "+QCAINFO: \"SCC\" and store them in an array
const lte_scc_pci = lines.filter((line) =>
line.includes('+QCAINFO: "SCC"')
);
// if empty, then proceed to error block
if (lte_scc_pci.length == 0) {
throw "No SCC PCI";
const pccparts = lines.find((m) => m.includes("QCAINFO: \"PCC\"")).split(":")[1].split(",");
const sccarr = lines.filter((m) => m.includes("QCAINFO: \"SCC\""));
const sccpci = [];
sccarr.forEach((s) => {
const sccparts = s.split(":")[1].split(",");
let sccIndex = 5;
switch (sccparts.length) {
case 8: // length 8, PCI is at index 4, NR5G PCC and NR5G SCC Band when NR5G-NSA
sccIndex = 4;
break;
case 13: // length 13, PCI is at index 5, LTE SCC Band
case 12: // length 12, PCI is at index 5, NR5G SCC Band
case 10: // length 10, PCI is at index 5, LTE PCC Band
default:
sccIndex = 5;
break;
}
// process all the values in the array and extract the PCI part only
for (let i = 0; i < lte_scc_pci.length; i++) {
// if line contains LTE BAND then do this process
if (lte_scc_pci[i].includes("LTE BAND")) {
lte_scc_pci[i] = lte_scc_pci[i].split(",")[5];
} else {
lte_scc_pci[i] = lte_scc_pci[i].split(",")[4];
}
}
// combine the PCC and SCC PCI values
this.pccPCI = lte_pcc_pci;
this.sccPCI = lte_scc_pci.join(", ");
} catch (error) {
this.pccPCI = lte_pcc_pci.replace(/,/g, "");
this.sccPCI = "-";
sccpci.push(sccparts[sccIndex]);
});
this.sccPCI = sccpci.join(', ');
switch (pccparts.length) {
case 8: // length 8, PCI is at index 4, NR5G PCC and NR5G SCC Band when NR5G-NSA
pccIndex = 4;
break;
case 13: // length 13, PCI is at index 5, LTE SCC Band
case 12: // length 12, PCI is at index 5, NR5G SCC Band
case 10: // length 10, PCI is at index 5, LTE PCC Band
default:
pccIndex = 5;
break;
}
this.pccPCI = pccparts[pccIndex]?.trim();
} else {
this.pccPCI = "0";
this.sccPCI = "-";
@@ -1186,7 +1180,7 @@
.replace(/"/g, "");
// Get the eNBID. Its just Cell ID minus the last 2 characters
this.eNBID = longCID.substring(0, longCID.length - 2);
this.eNBID = parseInt(longCID.substring(0, longCID.length - 2), 16);
// Get the short Cell ID (Last 2 characters of the Cell ID)
const shortCID = longCID.substring(longCID.length - 2);
@@ -1196,11 +1190,11 @@
currentNetworkMode == "5G SA FDD"
) {
// TAC
this.tac = lines
const localTac = lines
.find((line) => line.includes('+QENG: "servingcell"'))
.split(",")[8]
.replace(/"/g, "");
this.tac = parseInt(localTac, 16) + " (" + localTac + ")";
// CSQ
this.csq = "NR-SA Mode";
@@ -1250,11 +1244,11 @@
} else {
// LTE Only
// TAC
this.tac = lines
const localTac = lines
.find((line) => line.includes('+QENG: "servingcell"'))
.split(",")[12]
.replace(/"/g, "");
this.tac = parseInt(localTac, 16) + " (" + localTac + ")";
// CSQ
this.csq = lines
.find((line) => line.includes("+CSQ:"))
@@ -1334,7 +1328,7 @@
.replace(/"/g, "");
// Get the eNBID. Its just Cell ID minus the last 2 characters
this.eNBID = longCID.substring(0, longCID.length - 2);
this.eNBID = parseInt(longCID.substring(0, longCID.length - 2), 16);
// Get the short Cell ID (Last 2 characters of the Cell ID)
const shortCID = longCID.substring(longCID.length - 2);
@@ -1354,11 +1348,24 @@
")";
// TAC
this.tac = lines
const localTac = lines
.find((line) => line.includes('+QENG: "LTE"'))
.split(",")[10]
.replace(/"/g, "");
this.tac = parseInt(localTac, 16) + " ("+localTac+")";
this.cellID =
"Short " +
shortCID +
"(" +
parseInt(shortCID, 16) +
")" +
", " +
"Long " +
longCID +
"(" +
parseInt(longCID, 16) +
")";
// CSQ
this.csq = lines
.find((line) => line.includes("+CSQ:"))
@@ -1489,32 +1496,40 @@
},
calculate_lte_bw(lte_bw) {
switch (true) {
case 0:
return 1.4;
case 1:
return 3;
// Now case 2 - 5
case lte_bw >= 2 && lte_bw <= 5:
return (lte_bw - 1) * 5;
default:
return "Unknown";
}
const BANDWIDTH_MAP = {
0: 1.4,
1: 3,
2: 5,
3: 10,
4: 15,
5: 20,
6: 40,
7: 80,
8: 100,
9: 200,
};
return BANDWIDTH_MAP[lte_bw];
},
calculate_nr_bw(nr_bw) {
switch (true) {
case nr_bw >= 0 && nr_bw <= 5:
return (nr_bw + 1) * 5;
case nr_bw >= 6 && nr_bw <= 12:
return (nr_bw - 2) * 10;
case nr_bw === 13:
return "200";
case nr_bw === 14:
return "400";
default:
return "Unknown";
}
const NR_BANDWIDTH_MAP = {
0: 5,
1: 10,
2: 15,
3: 20,
4: 25,
5: 30,
6: 40,
7: 50,
8: 60,
9: 70,
10: 80,
11: 90,
12: 100,
13: 200,
14: 400,
};
return NR_BANDWIDTH_MAP[nr_bw];
},
calculateRSRPPercentage(rsrp) {

View File

@@ -104,7 +104,7 @@
placeholder="ATI"
aria-describedby="atCommandInput"
x-model="atcmd"
@keydown.enter="sendUserATCommand()"
@keydown.enter="sendATCommand()"
/>
<div id="atCommandInputHelper" class="form-text">
Seperate multiple commands with comma (,).
@@ -116,7 +116,7 @@
<button
class="btn btn-primary me-md-2"
type="button"
@click="sendUserATCommand()"
@click="sendATCommand()"
:disabled="isLoading"
>
Submit

View File

@@ -220,7 +220,10 @@
while ((match = cmglRegex.exec(data)) !== null) {
const index = parseInt(match[1]);
const senderHex = match[2];
const sender = senderHex.startsWith("003") ? this.convertHexToText(senderHex) : senderHex;
// Maximum world wide phone number length is 17 (North Korea), UTF-16BE Hex string comes back at 48+ for US Number, min length is 3.
// When 3 digit SMS short code is used the result is a 12 length string (which we then need to check if the sender hex starts with 003 or 002B(+))
// This check is probably completley unecessary but I have no data on how the modems behave with different firmware(whether support for CSCS="UCS2" is available).
const sender = senderHex.length > 11 && (senderHex.startsWith('002B') || senderHex.startsWith('003')) ? this.convertHexToText(senderHex) : senderHex;
const dateStr = match[3].replace(/\+\d{2}$/, "");
const date = this.parseCustomDate(dateStr);
if (isNaN(date)) {

View File

@@ -1,13 +1,23 @@
#!/bin/bash
# Define constants
# Define GitHub repo info
GITUSER="iamromulan"
GITTREE="development"
REPONAME="quectel-rgmii-toolkit"
GITTREE="development-SDXLEMUR"
GITMAINTREE="SDXLEMUR"
GITDEVTREE="development-SDXLEMUR"
GITROOT="http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR"
GITROOTMAIN="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITMAINTREE"
GITROOTDEV="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITDEVTREE"
# Define filesystem path
DIR_NAME="simpleadmin"
SERVICE_FILE="/lib/systemd/system/install_simpleadmin.service"
SERVICE_NAME="install_simpleadmin"
TMP_SCRIPT="/tmp/install_simpleadmin.sh"
LOG_FILE="/tmp/install_simpleadmin.log"
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:/usrdata/root/bin
# Tmp Script dependent constants
SIMPLE_ADMIN_DIR="/usrdata/simpleadmin"
@@ -44,9 +54,20 @@ EOF
cat <<EOF > "$TMP_SCRIPT"
#!/bin/bash
# Define GitHub repo info
GITUSER="iamromulan"
GITTREE="development"
REPONAME="quectel-rgmii-toolkit"
GITTREE="development-SDXLEMUR"
GITMAINTREE="SDXLEMUR"
GITDEVTREE="development-SDXLEMUR"
GITROOT="http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR"
GITROOTMAIN="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITMAINTREE"
GITROOTDEV="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITDEVTREE"
# Define filesystem path
SIMPLE_ADMIN_DIR="/usrdata/simpleadmin"
export HOME=/usrdata/root
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:/usrdata/root/bin
# Function to remount file system as read-write
remount_rw() {
@@ -107,8 +128,8 @@ install_lighttpd() {
systemctl stop lighttpd
echo -e "\033[0;32mInstalling/Updating Lighttpd...\033[0m"
mkdir -p "$SIMPLE_ADMIN_DIR"
wget -O "$SIMPLE_ADMIN_DIR/lighttpd.conf" https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/lighttpd.conf
wget -O "/lib/systemd/system/lighttpd.service" https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/systemd/lighttpd.service
wget -O "$SIMPLE_ADMIN_DIR/lighttpd.conf" $GITROOT/simpleadmin/lighttpd.conf
wget -O "/lib/systemd/system/lighttpd.service" $GITROOT/simpleadmin/systemd/lighttpd.service
ln -sf "/lib/systemd/system/lighttpd.service" "/lib/systemd/system/multi-user.target.wants/"
echo "www-data ALL = (root) NOPASSWD: /usr/sbin/iptables, /usr/sbin/ip6tables, /usrdata/simplefirewall/ttl-override, /bin/echo, /bin/cat" > /opt/etc/sudoers.d/www-data
@@ -135,51 +156,79 @@ echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
mkdir $SIMPLE_ADMIN_DIR/www/cgi-bin
mkdir $SIMPLE_ADMIN_DIR/www/css
mkdir $SIMPLE_ADMIN_DIR/www/js
mkdir $SIMPLE_ADMIN_DIR/www/fonts
cd $SIMPLE_ADMIN_DIR/systemd
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/systemd/lighttpd.service
wget $GITROOT/simpleadmin/systemd/lighttpd.service
sleep 1
cd $SIMPLE_ADMIN_DIR/script
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/script/ttl_script.sh
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/script/remove_watchcat.sh
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/script/create_watchcat.sh
wget $GITROOT/simpleadmin/script/ttl_script.sh
wget $GITROOT/simpleadmin/script/remove_watchcat.sh
wget $GITROOT/simpleadmin/script/create_watchcat.sh
sleep 1
cd $SIMPLE_ADMIN_DIR/console
wget $GITROOT/simpleadmin/console/.profile
sleep 1
cd $SIMPLE_ADMIN_DIR/console/menu
wget $GITROOT/simpleadmin/console/menu/start_menu.sh
ln -f $SIMPLE_ADMIN_DIR/console/menu/start_menu.sh /usrdata/root/bin/menu
wget $GITROOT/simpleadmin/console/menu/sfirewall_settings.sh
wget $GITROOT/simpleadmin/console/menu/start_menu.sh
sleep 1
cd $SIMPLE_ADMIN_DIR/www
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/deviceinfo.html
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/favicon.ico
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/index.html
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/network.html
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/settings.html
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/sms.html
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/scanner.html
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/watchcat.html
wget $GITROOT/simpleadmin/www/deviceinfo.html
wget $GITROOT/simpleadmin/www/favicon.ico
wget $GITROOT/simpleadmin/www/index.html
wget $GITROOT/simpleadmin/www/network.html
wget $GITROOT/simpleadmin/www/settings.html
wget $GITROOT/simpleadmin/www/sms.html
wget $GITROOT/simpleadmin/www/scanner.html
wget $GITROOT/simpleadmin/www/watchcat.html
sleep 1
cd $SIMPLE_ADMIN_DIR/www/js
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/js/alpinejs.min.js
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/js/bootstrap.bundle.min.js
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/js/dark-mode.js
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/js/generate-freq-box.js
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/js/parse-settings.js
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/js/populate-checkbox.js
wget $GITROOT/simpleadmin/www/js/alpinejs.min.js
wget $GITROOT/simpleadmin/www/js/bootstrap.bundle.min.js
wget $GITROOT/simpleadmin/www/js/dark-mode.js
wget $GITROOT/simpleadmin/www/js/generate-freq-box.js
wget $GITROOT/simpleadmin/www/js/parse-settings.js
wget $GITROOT/simpleadmin/www/js/populate-checkbox.js
sleep 1
cd $SIMPLE_ADMIN_DIR/www/css
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/css/bootstrap.min.css
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/css/styles.css
wget $GITROOT/simpleadmin/www/css/bootstrap.min.css
wget $GITROOT/simpleadmin/www/css/styles.css
wget $GITROOT/simpleadmin/www/css/all.min.css
sleep 1
cd $SIMPLE_ADMIN_DIR/www/fonts
wget $GITROOT/simpleadmin/www/fonts/poppins-v23-latin-300italic.woff2
wget $GITROOT/simpleadmin/www/fonts/poppins-v23-latin-300.woff2
wget $GITROOT/simpleadmin/www/fonts/poppins-v23-latin-500italic.woff2
wget $GITROOT/simpleadmin/www/fonts/poppins-v23-latin-500.woff2
wget $GITROOT/simpleadmin/www/fonts/poppins-v23-latin-600italic.woff2
wget $GITROOT/simpleadmin/www/fonts/poppins-v23-latin-600.woff2
wget $GITROOT/simpleadmin/www/fonts/poppins-v23-latin-700italic.woff2
wget $GITROOT/simpleadmin/www/fonts/poppins-v23-latin-700.woff2
wget $GITROOT/simpleadmin/www/fonts/poppins-v23-latin-italic.woff2
wget $GITROOT/simpleadmin/www/fonts/poppins-v23-latin-regular.woff2
sleep 1
cd $SIMPLE_ADMIN_DIR/www/cgi-bin
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/cgi-bin/get_atcommand
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/cgi-bin/get_ping
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/cgi-bin/get_sms
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/cgi-bin/get_ttl_status
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/cgi-bin/set_ttl
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/cgi-bin/send_sms
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/cgi-bin/get_uptime
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/cgi-bin/get_watchcat_status
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/cgi-bin/set_watchcat
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/cgi-bin/watchcat_maker
wget $GITROOT/simpleadmin/www/cgi-bin/get_atcommand
wget $GITROOT/simpleadmin/www/cgi-bin/user_atcommand
wget $GITROOT/simpleadmin/www/cgi-bin/get_ping
wget $GITROOT/simpleadmin/www/cgi-bin/get_sms
wget $GITROOT/simpleadmin/www/cgi-bin/get_ttl_status
wget $GITROOT/simpleadmin/www/cgi-bin/set_ttl
wget $GITROOT/simpleadmin/www/cgi-bin/send_sms
wget $GITROOT/simpleadmin/www/cgi-bin/get_uptime
wget $GITROOT/simpleadmin/www/cgi-bin/get_watchcat_status
wget $GITROOT/simpleadmin/www/cgi-bin/set_watchcat
wget $GITROOT/simpleadmin/www/cgi-bin/watchcat_maker
sleep 1
cd /
chmod +x $SIMPLE_ADMIN_DIR/www/cgi-bin/*
chmod +x $SIMPLE_ADMIN_DIR/script/*
chmod +x $SIMPLE_ADMIN_DIR/console/menu/*
chmod +x $SIMPLE_ADMIN_DIR/console/.profile
cp -f $SIMPLE_ADMIN_DIR/console/.profile /usrdata/root/.profile
chmod +x /usrdata/root/.profile
cp -rf $SIMPLE_ADMIN_DIR/systemd/* /lib/systemd/system
sleep 1
systemctl daemon-reload
@@ -187,10 +236,11 @@ echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
}
install_ttyd() {
echo -e "\e[1;34mStarting ttyd installation process...\e[0m"
cd $SIMPLE_ADMIN_DIR
wget -O ttyd https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.armhf && chmod +x ttyd
wget -O $SIMPLE_ADMIN_DIR/console/ttyd.bash "https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/console/ttyd.bash" && chmod +x console/ttyd.bash
wget -O $SIMPLE_ADMIN_DIR/systemd/ttyd.service "https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/systemd/ttyd.service"
cd $SIMPLE_ADMIN_DIR/console
curl -L -o ttyd https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.armhf && chmod +x ttyd
wget "$GITROOT/simpleadmin/console/ttyd.bash" && chmod +x ttyd.bash
cd $SIMPLE_ADMIN_DIR/systemd/
wget "$GITROOT/simpleadmin/systemd/ttyd.service"
cp -f $SIMPLE_ADMIN_DIR/systemd/ttyd.service /lib/systemd/system/
ln -sf /usrdata/simpleadmin/ttyd /bin

View File

@@ -1,8 +1,17 @@
#!/bin/bash
# Define constants
# Define GitHub repo info
GITUSER="iamromulan"
GITTREE="development"
REPONAME="quectel-rgmii-toolkit"
GITTREE="development-SDXLEMUR"
GITMAINTREE="SDXLEMUR"
GITDEVTREE="development-SDXLEMUR"
GITROOT="http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR"
GITROOTMAIN="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITMAINTREE"
GITROOTDEV="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITDEVTREE"
# Define filesystem path
DIR_NAME="simplefirewall"
SERVICE_FILE="/lib/systemd/system/install_simplefirewall.service"
SERVICE_NAME="install_simplefirewall"
@@ -41,8 +50,17 @@ EOF
cat <<EOF > "$TMP_SCRIPT"
#!/bin/bash
# Define GitHub repo info
GITUSER="iamromulan"
GITTREE="development"
REPONAME="quectel-rgmii-toolkit"
GITTREE="SDXLEMUR"
GITMAINTREE="SDXLEMUR"
GITDEVTREE="development-SDXLEMUR"
GITROOT="http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR"
GITROOTMAIN="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITMAINTREE"
GITROOTDEV="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITDEVTREE"
# Define filesystem path
SIMPLE_FIREWALL_DIR="/usrdata/simplefirewall"
SIMPLE_FIREWALL_SCRIPT="$SIMPLE_FIREWALL_DIR/simplefirewall.sh"
SIMPLE_FIREWALL_SYSTEMD_DIR="$SIMPLE_FIREWALL_DIR/systemd"
@@ -76,14 +94,14 @@ install_simple_firewall() {
mount -o remount,rw /
mkdir -p "$SIMPLE_FIREWALL_DIR"
mkdir -p "$SIMPLE_FIREWALL_SYSTEMD_DIR"
wget -O "$SIMPLE_FIREWALL_DIR/simplefirewall.sh" https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simplefirewall/simplefirewall.sh
wget -O "$SIMPLE_FIREWALL_DIR/ttl-override" https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simplefirewall/ttl-override
wget -O "$SIMPLE_FIREWALL_DIR/ttlvalue" https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simplefirewall/ttlvalue
wget -O "$SIMPLE_FIREWALL_DIR/simplefirewall.sh" $GITROOT/simplefirewall/simplefirewall.sh
wget -O "$SIMPLE_FIREWALL_DIR/ttl-override" $GITROOT/simplefirewall/ttl-override
wget -O "$SIMPLE_FIREWALL_DIR/ttlvalue" $GITROOT/simplefirewall/ttlvalue
chmod 666 $SIMPLE_FIREWALL_DIR/ttlvalue
chmod +x "$SIMPLE_FIREWALL_DIR/simplefirewall.sh"
chmod +x "$SIMPLE_FIREWALL_DIR/ttl-override"
wget -O "$SIMPLE_FIREWALL_SYSTEMD_DIR/simplefirewall.service" https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simplefirewall/systemd/simplefirewall.service
wget -O "$SIMPLE_FIREWALL_SYSTEMD_DIR/ttl-override.service" https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simplefirewall/systemd/ttl-override.service
wget -O "$SIMPLE_FIREWALL_SYSTEMD_DIR/simplefirewall.service" $GITROOT/simplefirewall/systemd/simplefirewall.service
wget -O "$SIMPLE_FIREWALL_SYSTEMD_DIR/ttl-override.service" $GITROOT/simplefirewall/systemd/ttl-override.service
cp -rf $SIMPLE_FIREWALL_SYSTEMD_DIR/* /lib/systemd/system
ln -sf "/lib/systemd/system/simplefirewall.service" "/lib/systemd/system/multi-user.target.wants/"
ln -sf "/lib/systemd/system/ttl-override.service" "/lib/systemd/system/multi-user.target.wants/"

View File

@@ -1,46 +0,0 @@
#!/bin/bash
# WORK IN PROGRESS
# Define constants
GITUSER="iamromulan"
GITTREE="development"
DIR_NAME="simpleupdates"
SERVICE_FILE="/lib/systemd/system/install_simpleupdates.service"
SERVICE_NAME="install_simpleupdates"
TMP_SCRIPT="/tmp/install_simpleupdates.sh"
LOG_FILE="/tmp/install_simpleupdates.log"
# Tmp Script dependent constants
# Create the systemd service file
cat <<EOF > "$SERVICE_FILE"
[Unit]
Description=Update $DIR_NAME temporary service
[Service]
Type=oneshot
ExecStart=/bin/bash $TMP_SCRIPT > $LOG_FILE 2>&1
[Install]
WantedBy=multi-user.target
EOF
# Create and populate the temporary shell script for installation
cat <<EOF > "$TMP_SCRIPT"
#!/bin/bash
install_simpleupdates() {
# CONTENT
}
install_simpleupdates
exit 0
EOF
# Make the temporary script executable
chmod +x "$TMP_SCRIPT"
# Reload systemd to recognize the new service and start the update
systemctl daemon-reload
systemctl start $SERVICE_NAME

View File

@@ -1,8 +1,16 @@
#!/bin/bash
# Define constants
# Define GitHub repo info
GITUSER="iamromulan"
GITTREE="development"
REPONAME="quectel-rgmii-toolkit"
GITTREE="development-SDXLEMUR"
GITMAINTREE="SDXLEMUR"
GITDEVTREE="development-SDXLEMUR"
GITROOT="http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR"
GITROOTMAIN="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITMAINTREE"
GITROOTDEV="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITDEVTREE"
# Define filesystem path
DIR_NAME="socat-at-bridge"
SERVICE_FILE="/lib/systemd/system/install_socat-at-bridge.service"
SERVICE_NAME="install_socat-at-bridge"
@@ -39,8 +47,17 @@ EOF
cat <<EOF > "$TMP_SCRIPT"
#!/bin/bash
# Define GitHub repo info
GITUSER="iamromulan"
GITTREE="development"
REPONAME="quectel-rgmii-toolkit"
GITTREE="SDXLEMUR"
GITMAINTREE="SDXLEMUR"
GITDEVTREE="development-SDXLEMUR"
GITROOT="http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR"
GITROOTMAIN="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITMAINTREE"
GITROOTDEV="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITDEVTREE"
# Define filesystem path
SOCAT_AT_DIR="/usrdata/socat-at-bridge"
SOCAT_AT_SYSD_DIR="/usrdata/socat-at-bridge/systemd_units"
@@ -85,26 +102,29 @@ install_at_socat() {
mkdir $SOCAT_AT_DIR
cd $SOCAT_AT_DIR
mkdir $SOCAT_AT_SYSD_DIR
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/socat-at-bridge/socat-armel-static
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/socat-at-bridge/killsmd7bridge
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/socat-at-bridge/atcmd
wget $GITROOT/socat-at-bridge/socat-armel-static
wget $GITROOT/socat-at-bridge/killsmd7bridge
wget $GITROOT/socat-at-bridge/atcmd
wget $GITROOT/socat-at-bridge/atcmd11
cd $SOCAT_AT_SYSD_DIR
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/socat-at-bridge/systemd_units/socat-smd11.service
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/socat-at-bridge/systemd_units/socat-smd11-from-ttyIN.service
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/socat-at-bridge/systemd_units/socat-smd11-to-ttyIN.service
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/socat-at-bridge/systemd_units/socat-killsmd7bridge.service
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/socat-at-bridge/systemd_units/socat-smd7-from-ttyIN2.service
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/socat-at-bridge/systemd_units/socat-smd7-to-ttyIN2.service
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/socat-at-bridge/systemd_units/socat-smd7.service
wget $GITROOT/socat-at-bridge/systemd_units/socat-smd11.service
wget $GITROOT/socat-at-bridge/systemd_units/socat-smd11-from-ttyIN.service
wget $GITROOT/socat-at-bridge/systemd_units/socat-smd11-to-ttyIN.service
wget $GITROOT/socat-at-bridge/systemd_units/socat-killsmd7bridge.service
wget $GITROOT/socat-at-bridge/systemd_units/socat-smd7-from-ttyIN2.service
wget $GITROOT/socat-at-bridge/systemd_units/socat-smd7-to-ttyIN2.service
wget $GITROOT/socat-at-bridge/systemd_units/socat-smd7.service
# Set execute permissions
cd $SOCAT_AT_DIR
chmod +x socat-armel-static
chmod +x killsmd7bridge
chmod +x atcmd
chmod +x atcmd11
# Link new command for AT Commands from the shell
ln -sf $SOCAT_AT_DIR/atcmd /bin
ln -sf $SOCAT_AT_DIR/atcmd11 /bin
# Install service units
echo -e "\033[0;32mAdding AT Socat Bridge systemd service units...\033[0m"

View File

@@ -1,8 +1,17 @@
#!/bin/bash
# Define constants
# Define GitHub repo info
GITUSER="iamromulan"
GITTREE="development"
REPONAME="quectel-rgmii-toolkit"
GITTREE="development-SDXLEMUR"
GITMAINTREE="SDXLEMUR"
GITDEVTREE="development-SDXLEMUR"
GITROOT="http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR"
GITROOTMAIN="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITMAINTREE"
GITROOTDEV="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITDEVTREE"
# Define filesystem path
DIR_NAME="simpleupdates"
SERVICE_FILE="/lib/systemd/system/install_sshd.service"
SERVICE_NAME="install_sshd"
@@ -29,15 +38,23 @@ EOF
cat <<EOF > "$TMP_SCRIPT"
#!/bin/bash
# Define GitHub repo info
GITUSER="iamromulan"
GITTREE="development"
REPONAME="quectel-rgmii-toolkit"
GITTREE="SDXLEMUR"
GITMAINTREE="SDXLEMUR"
GITDEVTREE="development-SDXLEMUR"
GITROOT="http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR"
GITROOTMAIN="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITMAINTREE"
GITROOTDEV="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITDEVTREE"
install_sshd() {
echo -e "\e[1;32mOpenSSH Server\e[0m"
remount_rw
mkdir /usrdata/sshd
wget -O /lib/systemd/system/sshd.service "https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/sshd/sshd.service"
wget -O /lib/systemd/system/sshd.service "$GITROOT/sshd/sshd.service"
ln -sf "/lib/systemd/system/sshd.service" "/lib/systemd/system/multi-user.target.wants/"
opkg install openssh-server-pam

View File

@@ -1,13 +1,22 @@
#!/bin/bash
# Define constants
# Define GitHub repo info
GITUSER="iamromulan"
GITTREE="development"
REPONAME="quectel-rgmii-toolkit"
GITTREE="development-SDXLEMUR"
GITMAINTREE="SDXLEMUR"
GITDEVTREE="development-SDXLEMUR"
GITROOT="http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR"
GITROOTMAIN="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITMAINTREE"
GITROOTDEV="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITDEVTREE"
# Define filesystem path
DIR_NAME="tailscale"
SERVICE_FILE="/lib/systemd/system/install_tailscale.service"
SERVICE_NAME="install_tailscale"
TMP_SCRIPT="/tmp/install_tailscale.sh"
LOG_FILE="/tmp/install_sshd.log"
LOG_FILE="/tmp/install_tailscale.log"
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:/usrdata/root/bin
# Tmp Script dependent constants
TAILSCALE_DIR="/usrdata/tailscale/"
@@ -46,8 +55,17 @@ cat <<EOF > "$TMP_SCRIPT"
#!/bin/bash
export HOME=/usrdata/root
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:/usrdata/root/bin
# Define GitHub repo info
GITUSER="iamromulan"
GITTREE="development"
REPONAME="quectel-rgmii-toolkit"
GITTREE="SDXLEMUR"
GITMAINTREE="SDXLEMUR"
GITDEVTREE="development-SDXLEMUR"
GITROOT="http://git.ievo.top/tyk/quectel-rgmii-toolkit/raw/branch/SDXLEMUR"
GITROOTMAIN="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITMAINTREE"
GITROOTDEV="https://raw.githubusercontent.com/$GITUSER/$REPONAME/$GITDEVTREE"
# Define filesystem path
TAILSCALE_DIR="/usrdata/tailscale/"
TAILSCALE_SYSD_DIR="/usrdata/tailscale/systemd"
@@ -75,15 +93,16 @@ install_update_tailscale() {
mkdir -p "$TAILSCALE_DIR" "$TAILSCALE_SYSD_DIR"
echo "Downloading binary files..."
cd /usrdata
wget https://pkgs.tailscale.com/stable/tailscale_1.64.0_arm.tgz
tar -xzf tailscale_1.64.0_arm.tgz
cd tailscale_1.64.0_arm
curl -O https://pkgs.tailscale.com/stable/tailscale_1.76.1_arm.tgz
tar -xzf tailscale_1.76.1_arm.tgz
rm tailscale_1.76.1_arm.tgz
cd /usrdata/tailscale_1.76.1_arm
mv tailscale tailscaled "$TAILSCALE_DIR/"
rm -rf /usrdata/tailscale_1.64.0_arm
rm -rf /usrdata/tailscale_1.76.1_arm
echo "Downloading systemd files..."
cd "$TAILSCALE_SYSD_DIR"
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/main/tailscale/systemd/tailscaled.service
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/main/tailscale/systemd/tailscaled.defaults
wget $GITROOT/tailscale/systemd/tailscaled.service
wget $GITROOT/tailscale/systemd/tailscaled.defaults
sleep 2s
echo "Setting Permissions..."
chmod +x "$TAILSCALE_DIR/tailscaled" "$TAILSCALE_DIR/tailscale"
@@ -94,6 +113,7 @@ install_update_tailscale() {
echo "Starting Tailscaled..."
systemctl start tailscaled
cd /
ln -sf /usrdata/tailscale/tailscale /usrdata/root/bin
remount_ro
echo -e "\e[32mTailscale installed successfully.\e[0m"
exit 0

69
socat-at-bridge/atcmd11 Normal file
View File

@@ -0,0 +1,69 @@
#!/bin/bash
DEVICE=/dev/ttyOUT
BAUD=115200
# Function to setup device communication parameters
setup_device() {
stty -F $DEVICE cs8 $BAUD ignbrk -brkint -icrnl -imaxbel \
-opost -onlcr -isig -icanon -iexten -echo -echoe -echok \
-echoctl -echoke noflsh -ixon -crtscts
}
# Function to send AT command and capture the output
send_at_command() {
local command="$1"
# Clear the device buffer before sending a new command
echo -n > $DEVICE
# Send the AT command, preserving the integrity of the input
echo -e "$command\r" > $DEVICE
# Use a temporary file to capture the command output
tmpfile=$(mktemp)
# Start reading the device output to the temporary file
cat $DEVICE > "$tmpfile" &
CAT_PID=$!
# Monitor the output file for "OK" or "ERROR"
while ! grep -qe "OK" -e "ERROR" "$tmpfile"; do
sleep 1
done
# Kill the `cat` process after capturing the response
kill $CAT_PID
wait $CAT_PID 2>/dev/null
# Display the response
cat "$tmpfile" | while IFS= read -r line; do
echo -e "\033[0;32m$line\033[0m"
done
# Clean up
rm "$tmpfile"
}
# Prepare the device for communication
setup_device
# Check if an AT command is provided as an argument
if [ $# -gt 0 ]; then
# Concatenate all arguments to handle commands with spaces and/or quotes correctly
FULL_CMD="$*"
send_at_command "$FULL_CMD"
else
echo -e "\033[0;36mType 'exit' to end the session.\033[0m"
while true; do
echo -en "\033[0;36mEnter AT Command: \033[0m"
read user_input
if [[ "$user_input" == "exit" ]]; then
echo -e "\033[0;32mExiting...\033[0m"
break
fi
send_at_command "$user_input"
done
fi