Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
4IceG authored Jan 12, 2022
1 parent e253e02 commit 1fd2001
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 32 deletions.
4 changes: 2 additions & 2 deletions luci-app-3ginfo-lite/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Rafał Wabik - IceG - From eko.one.pl forum
# Copyright 2021-2022 Rafał Wabik - IceG - From eko.one.pl forum
# MIT License

include $(TOPDIR)/rules.mk
Expand All @@ -7,7 +7,7 @@ PKG_NAME:=luci-app-3ginfo-lite
LUCI_TITLE:=LuCI panel for 3ginfo-lite
LUCI_PKGARCH:=all
LUCI_DEPENDS:=+sms-tool
PKG_VERSION:=1.0.9-20211218
PKG_VERSION:=1.0.9-20220112
PKG_RELEASE:=1

include $(TOPDIR)/feeds/luci/luci.mk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var pc = Math.floor((100 / mn) * vn);
var tip = _('Very weak');
};
pg.firstElementChild.style.width = pc + '%';
pg.style.width = '50%';
pg.style.width = '33%';
pg.setAttribute('title', '%s'.format(v) + ' | ' + tip + ' ');
}

Expand Down Expand Up @@ -70,7 +70,7 @@ var pc = Math.floor(100*(1-(-50 - vn)/(-50 - mn)));
var tip = _('Very weak');
};
pg.firstElementChild.style.width = pc + '%';
pg.style.width = '50%';
pg.style.width = '33%';
pg.firstElementChild.style.animationDirection = "reverse";
pg.setAttribute('title', '%s'.format(v) + ' | ' + tip + ' ');
}
Expand Down Expand Up @@ -103,7 +103,7 @@ var pc = Math.floor(120*(1-(-50 - vn)/(-50 - mn)));
var tip = _('Very weak');
};
pg.firstElementChild.style.width = pc + '%';
pg.style.width = '50%';
pg.style.width = '33%';
pg.firstElementChild.style.animationDirection = "reverse";
pg.setAttribute('title', '%s'.format(v) + ' | ' + tip + ' ');
}
Expand Down Expand Up @@ -134,7 +134,7 @@ var pc = Math.floor(100-(100*(1-((mn - vn)/(mn - 25)))));
var tip = _('Cell edge');
};
pg.firstElementChild.style.width = pc + '%';
pg.style.width = '50%';
pg.style.width = '33%';
pg.firstElementChild.style.animationDirection = "reverse";
pg.setAttribute('title', '%s'.format(v) + ' | ' + tip + ' ');
}
Expand Down Expand Up @@ -166,7 +166,7 @@ if (vn > 0) { vn = 0; };
var tip = _('Cell edge');
};
pg.firstElementChild.style.width = pc + '%';
pg.style.width = '50%';
pg.style.width = '33%';
pg.firstElementChild.style.animationDirection = "reverse";
pg.setAttribute('title', '%s'.format(v) + ' | ' + tip + ' ');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ if [ -n "$T" ]; then
*"B7") MODE=$(band 7 "LTE ");;
*"B8") MODE=$(band 8 "LTE ");;
*"B20") MODE=$(band 20 "LTE ");;
*) MODE="$T";;
*) MODE="LTE B${T}";;
esac
fi

T=$(echo "$O" | awk '/^RSSI/ {print $3}' | xargs)
if [ -n "$T" ]; then
RSSI='$T'
RSSI="'$T' dBm"
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"RSSI":"'$T' dBm"}'
fi
T=$(echo "$O" | awk '/^RSRP/ {print $3}' | xargs)
if [ -n "$T" ]; then
RSRP='$T'
RSRP="'$T' dBm"
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"RSRP":"'$T' dBm"}'
fi
T=$(echo "$O" | awk '/^RSRQ/ {print $3}' | xargs)
if [ -n "$T" ]; then
RSRQ='$T'
RSRQ="'$T' dB"
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"RSRQ":"'$T' dB"}'
fi
T=$(echo "$O" | awk '/^SINR/ {print $3}' | xargs)
if [ -n "$T" ]; then
SINR='$T'
SINR="'$T' dB"
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"SINR":"'$T' dB"}'
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if [ -n "$T" ]; then
*"B29") MODE=$(band 29 "LTE ");;
*"B30") MODE=$(band 30 "LTE ");;
*"B41") MODE=$(band 41 "LTE ");;
*) MODE="$T";;
*) MODE="LTE B${T}";;
esac

T=$(echo "$O" | awk -F: '/^LTE CA state:.*ACTIVE/ {print $3}' | xargs)
Expand All @@ -42,17 +42,9 @@ if [ -n "$T" ]; then
*"B29") MODE="{MODE/LTE/LTE_A} / "$(band 29 "");;
*"B30") MODE="{MODE/LTE/LTE_A} / "$(band 30 "");;
*"B41") MODE="{MODE/LTE/LTE_A} / "$(band 41 "");;
*) MODE="${MODE/LTE/LTE_A} / $T";;
*) MODE="${MODE/LTE/LTE_A} / B${T}";;
esac

SPACEOFF=$(echo $MODE | tr -d '"')
MAIN=$(echo $SPACEOFF | cut -d "/" -f 1)
PLUS=$(echo $SPACEOFF | cut -d "/" -f 2)
MAINCUT=$(echo $MAIN | sed 's/LTE //g')
PLUSCUT=$(echo $PLUS | sed 's/LTE //g')
PLUSVIEW=$(echo $PLUSCUT | sed 's/[0-9] /&\/ /g')
MODE="LTE-A | $MAINCUT + "$PLUSVIEW

fi
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if [ -n "$T" ]; then
*"Band:7") MODE=$(band 7 "LTE ");;
*"Band:8") MODE=$(band 8 "LTE ");;
*"Band:20") MODE=$(band 20 "LTE ");;
*) MODE="$T";;
*) MODE="LTE B${T}";;
esac
fi

Expand All @@ -81,7 +81,7 @@ if [ -n "$T" ]; then
*"(S)Band:7") MODE="${MODE/LTE/LTE_A} / "$(band 7 "");;
*"(S)Band:8") MODE="${MODE/LTE/LTE_A} / "$(band 8 "");;
*"(S)Band:20") MODE="${MODE/LTE/LTE_A} / "$(band 20 "");;
*) MODE="${MODE/LTE/LTE_A} / $T";;
*) MODE="${MODE/LTE/LTE_A} / B${T}";;
esac
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ case "$MODE1" in
*"B7") MODE=$(band 7 "LTE ");;
*"B8") MODE=$(band 8 "LTE ");;
*"B20") MODE=$(band 20 "LTE ");;
*) MODE="$MODE $BAND";;
*) MODE="$MODE B${BAND}";;
esac
;;
*)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# ZTE MF286

O=$(sms_tool -d $DEVICE at "at+zrssi;+zcellinfo?;+zcainfo?;+zdon?")

case "$MODE1" in
2*| \
3*)
T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $2}' | xargs)
[ -n "$ADDON" ] && ADDON="$ADDON,"
RSSI="'$T' dBm"
ADDON="$ADDON"'{"RSSI":"'$T' dBm"}'
;;
4*| \
5*| \
6*)
T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $2}' | xargs)
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"RSCP":"'$T' dBm"}'
T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $3}' | xargs)
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"ECIO":"'$T' dB"}'
T=$(echo "$O" | awk -F[,:] '/^\+ZCELLINFO/ {print $4}' | xargs)
[ -n "$T" ] && MODE="$T"
;;
7*)
T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $2}' | xargs)
[ -n "$ADDON" ] && ADDON="$ADDON,"
RSRP="'$T' dBm"
ADDON="$ADDON"'{"RSRP":"'$T' dBm"}'
T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $3}' | xargs)
[ -n "$ADDON" ] && ADDON="$ADDON,"
RSRQ="'$T' dB"
ADDON="$ADDON"'{"RSRQ":"'$T' dB"}'
T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $4}' | xargs)
[ -n "$ADDON" ] && ADDON="$ADDON,"
RSSI="'$T' dBm"
ADDON="$ADDON"'{"RSSI":"'$T' dBm"}'
T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $5}' | xargs)
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"SINR":"'$T' dB"}'
SINR="'$T' dB"
T=$(echo "$O" | awk -F[,:] '/^\+ZCELLINFO/ {print $4}' | xargs)
case "$T" in
*"LTE B1") MODE=$(band 1 "LTE ");;
*"LTE B3") MODE=$(band 3 "LTE ");;
*"LTE B7") MODE=$(band 7 "LTE ");;
*"LTE B8") MODE=$(band 8 "LTE ");;
*"LTE B20") MODE=$(band 20 "LTE ");;
*) MODE="LTE B${T}";;
esac
T=$(echo "$O" | awk -F[,:] '/^\+ZCAINFO/ {print $8}' | xargs)
if [ -n "$T" ]; then
case $T in
*"1") MODE="${MODE/LTE/LTE_A} / "$(band 1 "");;
*"3") MODE="${MODE/LTE/LTE_A} / "$(band 3 "");;
*"7") MODE="${MODE/LTE/LTE_A} / "$(band 7 "");;
*"8") MODE="${MODE/LTE/LTE_A} / "$(band 8 "");;
*"20") MODE="{MODE/LTE/LTE_A} / "$(band 20 "");;
*) MODE="${MODE/LTE/LTE_A} / B${T}";;
esac
fi
;;
esac

T=$(echo "$O" | awk -F[,:] '/^\+ZDON/ {print $2}' | xargs)
if [ -n "$T" ]; then
COPS="$T"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [ "x$MODE" = "xLTE" ]; then
*"7") MODE=$(band 7 "LTE ");;
*"8") MODE=$(band 8 "LTE ");;
*"20") MODE=$(band 20 "LTE ");;
*) MODE="$T";;
*) MODE="LTE B${T}";;
esac
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ if [ -n "$T" ]; then
*"LTE BAND 38") MODE=$(band 38 "LTE ");;
*"LTE BAND 40") MODE=$(band 40 "LTE ");;
*"LTE BAND 41") MODE=$(band 41 "LTE ");;
*) MODE=${T:-$MODE};;
*) MODE="$T";;
*) MODE="LTE B${T}";;
esac

T=$(echo "$O" | awk -F[,] '/^\+QCAINFO: "sss"/{print $4}')
Expand All @@ -37,7 +36,7 @@ if [ -n "$T" ]; then
*"LTE BAND 38") MODE="${MODE/LTE/LTE_A} / "$(band 38 "");;
*"LTE BAND 40") MODE="${MODE/LTE/LTE_A} / "$(band 40 "");;
*"LTE BAND 41") MODE="${MODE/LTE/LTE_A} / "$(band 41 "");;
*) MODE="${MODE/LTE/LTE_A} / $T";;
*) MODE="${MODE/LTE/LTE_A} / B${T}";;
esac
fi
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ fi
T=$(echo "$O" | awk -F[,:] '/^\+CESQ/ {print $6}' | xargs)
if [ -n "$T" ]; then
if [ "$T" != "255" ]; then
RSRQ="-'$T' dB"
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"RSRQ":"-'$T' dB"}'
fi
fi
T=$(echo "$O" | awk -F[,:] '/^\+CESQ/ {print $7}' | xargs)
if [ -n "$T" ]; then
if [ "$T" != "255" ]; then
RSRP="-'$T' dBm"
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"RSRP":"-'$T' dBm"}'
fi
Expand Down Expand Up @@ -57,7 +59,7 @@ case "$MODE1" in
*"7") MODE="$MODE / "$(band 7 "");;
*"8") MODE="$MODE / "$(band 8 "");;
*"20") MODE="$MODE / "$(band 20 "");;
*) MODE="$MODE / $T";;
*) MODE="$MODE / B${T}";;
esac
fi
fi
Expand Down
4 changes: 2 additions & 2 deletions luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh

#
# (c) 2010-2021 Cezary Jackiewicz <[email protected]>
# (c) 2021 modified by Rafał Wabik - IceG - From eko.one.pl forum
# (c) 2010-2022 Cezary Jackiewicz <[email protected]>
# (c) 2021-2022 modified by Rafał Wabik - IceG - From eko.one.pl forum
#

band() {
Expand Down

0 comments on commit 1fd2001

Please sign in to comment.