From 1e795bf386aaca425ec0a50209a913d5b1338410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Wabik?= <4rafal@gmail.com> Date: Sun, 18 Jul 2021 00:04:03 -0700 Subject: [PATCH] Updated scripts for modems. --- luci-app-3ginfo-lite/Makefile | 2 +- .../resources/view/modem/3gdetail.js | 26 ++++++++++++++++++- .../share/3ginfo-lite/3ginfo-addon/05c69215 | 8 +++++- .../share/3ginfo-lite/3ginfo-addon/119968a2 | 5 ++++ .../share/3ginfo-lite/3ginfo-addon/16907588 | 1 + .../share/3ginfo-lite/3ginfo-addon/20202033 | 3 +++ .../share/3ginfo-lite/3ginfo-addon/2c7c0125 | 1 + .../share/3ginfo-lite/3ginfo-addon/2c7c0306 | 24 ++++++++++++----- .../share/3ginfo-lite/3ginfo-addon/2cd20001 | 3 +++ 9 files changed, 64 insertions(+), 9 deletions(-) diff --git a/luci-app-3ginfo-lite/Makefile b/luci-app-3ginfo-lite/Makefile index 818ba831..aff50e5a 100644 --- a/luci-app-3ginfo-lite/Makefile +++ b/luci-app-3ginfo-lite/Makefile @@ -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 diff --git a/luci-app-3ginfo-lite/htdocs/luci-static/resources/view/modem/3gdetail.js b/luci-app-3ginfo-lite/htdocs/luci-static/resources/view/modem/3gdetail.js index e798c1c1..a02fb33c 100644 --- a/luci-app-3ginfo-lite/htdocs/luci-static/resources/view/modem/3gdetail.js +++ b/luci-app-3ginfo-lite/htdocs/luci-static/resources/view/modem/3gdetail.js @@ -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({ @@ -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')) { diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/05c69215 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/05c69215 index 6f49fb64..507045c0 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/05c69215 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/05c69215 @@ -1,4 +1,4 @@ -# 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) @@ -6,9 +6,15 @@ 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 diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/119968a2 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/119968a2 index bfb28ac3..b318c935 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/119968a2 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/119968a2 @@ -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 diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/16907588 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/16907588 index 5efd01d5..c9d49519 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/16907588 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/16907588 @@ -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 diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/20202033 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/20202033 index ca1efea7..077d4f2c 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/20202033 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/20202033 @@ -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 diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2c7c0125 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2c7c0125 index a83fefd3..eea75f58 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2c7c0125 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2c7c0125 @@ -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 ");; diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2c7c0306 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2c7c0306 index 715303bd..dbd74463 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2c7c0306 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2c7c0306 @@ -1,4 +1,4 @@ -# Quectel EP06 +# Quectel EP06-E . "$RES/3ginfo-addon/05c69215" @@ -9,9 +9,15 @@ 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 @@ -19,11 +25,17 @@ if [ -n "$T" ]; then [ -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 diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2cd20001 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2cd20001 index ee0bb684..83795ec6 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2cd20001 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2cd20001 @@ -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 @@ -38,6 +39,7 @@ 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 @@ -45,6 +47,7 @@ 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