Skip to content

Commit

Permalink
Updated scripts for modems.
Browse files Browse the repository at this point in the history
  • Loading branch information
4IceG authored Jul 18, 2021
1 parent 098cef6 commit 1e795bf
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 9 deletions.
2 changes: 1 addition & 1 deletion luci-app-3ginfo-lite/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.3-14072021
PKG_VERSION:=1.0.4-18072021
PKG_RELEASE:=1

include $(TOPDIR)/feeds/luci/luci.mk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'require fs';

/*
Copyright 2021 Rafał Wabik - IceG - From eko.one.pl forum
Copyright 2021 Rafał Wabik - IceG - From eko.one.pl forum
*/

return view.extend({
Expand Down Expand Up @@ -80,22 +80,46 @@ return view.extend({

if (document.getElementById('rssi')) {
var view = document.getElementById("rssi");
var z = json.rssi;
if (z.includes('dBm')) {
view.textContent = json.rssi;
}
else {
view.textContent = json.rssi + ' dBm';
}
}

if (document.getElementById('rsrp')) {
var view = document.getElementById("rsrp");
var z = json.rsrp;
if (z.includes('dBm')) {
view.textContent = json.rsrp;
}
else {
view.textContent = json.rsrp + ' dBm';
}
}

if (document.getElementById('sinr')) {
var view = document.getElementById("sinr");
var z = json.sinr;
if (z.includes('dB')) {
view.textContent = json.sinr;
}
else {
view.textContent = json.sinr + ' dB';
}
}

if (document.getElementById('rsrq')) {
var view = document.getElementById("rsrq");
var z = json.rsrq;
if (z.includes('dB')) {
view.textContent = json.rsrq;
}
else {
view.textContent = json.rsrq + ' dB';
}
}

if (document.getElementById('mccmnc')) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# Quectel EC20
# Quectel EC20-E

O=$(sms_tool -d $DEVICE at "at+qtemp;+qnwinfo;+qeng=\"servingcell\";+qspn")
T=$(echo "$O" | awk -F[,:] '/^\+QNWINFO/ {print $2"/"$4}' | xargs)
if [ -n "$T" ]; then
case "$T" in
*"LTE BAND 1") MODE=$(band 1 "LTE ");;
*"LTE BAND 3") MODE=$(band 3 "LTE ");;
*"LTE BAND 5") MODE=$(band 5 "LTE ");;
*"LTE BAND 7") MODE=$(band 7 "LTE ");;
*"LTE BAND 8") MODE=$(band 8 "LTE ");;
*"LTE BAND 20") MODE=$(band 20 "LTE ");;
*"LTE BAND 28") MODE=$(band 28 "LTE ");;
*"LTE BAND 32") MODE=$(band 32 "LTE ");;
*"LTE BAND 38") MODE=$(band 38 "LTE ");;
*"LTE BAND 40") MODE=$(band 40 "LTE ");;
*"LTE BAND 41") MODE=$(band 41 "LTE ");;
*) MODE="$T";;
esac
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,32 @@ fi

T=$(echo "$O" | awk '/^RSSI/ {print $3}' | xargs)
if [ -n "$T" ]; then
RSSI='$T'
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"RSSI":"'$T' dBm"}'
fi
T=$(echo "$O" | awk '/^RSRP/ {print $3}' | xargs)
if [ -n "$T" ]; then
RSRP='$T'
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"RSRP":"'$T' dBm"}'
fi
T=$(echo "$O" | awk '/^RSRQ/ {print $3}' | xargs)
if [ -n "$T" ]; then
RSRQ='$T'
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"RSRQ":"'$T' dB"}'
fi
T=$(echo "$O" | awk '/^SINR/ {print $3}' | xargs)
if [ -n "$T" ]; then
SINR='$T'
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"SINR":"'$T' dB"}'
fi

T=$(echo "$O" | awk -F: '/Temperature:/ {print $3}' | xargs)
if [ -n "$T" ]; then
TEMP="$T °C"
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"Temperatura":"'$T' °C"}'
fi
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ fi

T=$(echo "$O" | awk -F[:] '/^\+CCPUTEMP/ {print $2}' | xargs)
if [ -n "$T" ]; then
TEMP="$T °C"
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"Temperatura":"'$T' °C"}'
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ if [ -n "$T" ]; then
fi
T=$(echo "$O" | awk -F[,:] '/^RSRP:/ {print $2}' | xargs)
if [ -n "$T" ]; then
RSRP='$T'
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"RSRP":"'$T' dBm"}'
fi
T=$(echo "$O" | awk -F[,:] '/^RSRQ:/ {print $2}' | xargs)
if [ -n "$T" ]; then
RSRQ='$T'
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"RSRQ":"'$T' dB"}'
fi
T=$(echo "$O" | awk -F[,:] '/^SINR:/ {print $2}' | xargs)
if [ -n "$T" ]; then
RINR='$T'
[ -n "$ADDON" ] && ADDON="$ADDON,"
ADDON="$ADDON"'{"SINR":"'$T' dB"}'
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if [ -n "$T" ]; then
case "$T" in
*"LTE BAND 1") MODE=$(band 1 "LTE ");;
*"LTE BAND 3") MODE=$(band 3 "LTE ");;
*"LTE BAND 5") MODE=$(band 5 "LTE ");;
*"LTE BAND 7") MODE=$(band 7 "LTE ");;
*"LTE BAND 8") MODE=$(band 8 "LTE ");;
*"LTE BAND 20") MODE=$(band 20 "LTE ");;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Quectel EP06
# Quectel EP06-E

. "$RES/3ginfo-addon/05c69215"

Expand All @@ -9,21 +9,33 @@ if [ -n "$T" ]; then
case $T in
*"LTE BAND 1") MODE=$(band 1 "LTE ");;
*"LTE BAND 3") MODE=$(band 3 "LTE ");;
*"LTE BAND 5") MODE=$(band 5 "LTE ");;
*"LTE BAND 7") MODE=$(band 7 "LTE ");;
*"LTE BAND 8") MODE=$(band 8 "LTE ");;
*"LTE BAND 20") MODE=$(band 20 "LTE ");;
*"LTE BAND 28") MODE=$(band 28 "LTE ");;
*"LTE BAND 32") MODE=$(band 32 "LTE ");;
*"LTE BAND 38") MODE=$(band 38 "LTE ");;
*"LTE BAND 40") MODE=$(band 40 "LTE ");;
*"LTE BAND 41") MODE=$(band 41 "LTE ");;
*) MODE=${T:-$MODE};;
esac

T=$(echo "$O" | awk -F[,] '/^\+QCAINFO: "sss"/{print $4}')
[ -z "$T" ] && T=$(echo "$O" | awk -F[,] '/^\+QCAINFO: "scc"/{print $4}')
if [ -n "$T" ]; then
case $T in
*"LTE BAND 1") MODE="$MODE / "$(band 1 "");;
*"LTE BAND 3") MODE="$MODE / "$(band 3 "");;
*"LTE BAND 7") MODE="$MODE / "$(band 7 "");;
*"LTE BAND 8") MODE="$MODE / "$(band 8 "");;
*"LTE BAND 20") MODE="$MODE / "$(band 20 "");;
*"LTE BAND 1") MODE=$(band 1 "LTE ");;
*"LTE BAND 3") MODE=$(band 3 "LTE ");;
*"LTE BAND 5") MODE=$(band 5 "LTE ");;
*"LTE BAND 7") MODE=$(band 7 "LTE ");;
*"LTE BAND 8") MODE=$(band 8 "LTE ");;
*"LTE BAND 20") MODE=$(band 20 "LTE ");;
*"LTE BAND 28") MODE=$(band 28 "LTE ");;
*"LTE BAND 32") MODE=$(band 32 "LTE ");;
*"LTE BAND 38") MODE=$(band 38 "LTE ");;
*"LTE BAND 40") MODE=$(band 40 "LTE ");;
*"LTE BAND 41") MODE=$(band 41 "LTE ");;
*) MODE="$MODE / "${T:-$MODE};;
esac
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ T=$(echo "$O" | awk -F[,:] '/^\+CESQ/ {print $4}' | xargs)
if [ -n "$T" ]; then
if [ "$T" != "255" ]; then
[ -n "$ADDON" ] && ADDON="$ADDON,"
RSCP="-'$T'"
ADDON="$ADDON"'{"RSCP":"-'$T' dBm"}'
fi
fi
Expand All @@ -38,13 +39,15 @@ T=$(echo "$O" | awk -F[,:] '/^\+CESQ/ {print $6}' | xargs)
if [ -n "$T" ]; then
if [ "$T" != "255" ]; then
[ -n "$ADDON" ] && ADDON="$ADDON,"
RSRQ="-'$T'"
ADDON="$ADDON"'{"RSRQ":"-'$T' dB"}'
fi
fi
T=$(echo "$O" | awk -F[,:] '/^\+CESQ/ {print $7}' | xargs)
if [ -n "$T" ]; then
if [ "$T" != "255" ]; then
[ -n "$ADDON" ] && ADDON="$ADDON,"
RSRP="-'$T'"
ADDON="$ADDON"'{"RSRP":"-'$T' dBm"}'
fi
fi

0 comments on commit 1e795bf

Please sign in to comment.