From 8049fd52568778af3a936a24242f505b906b2b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Wabik?= <4rafal@gmail.com> Date: Sun, 21 Apr 2024 15:39:59 +0200 Subject: [PATCH] Up to 1.0.67-20240421 - Fix for reading interface settings - Fix for missing TAC HEX value for RM520N-GL --- luci-app-3ginfo-lite/Makefile | 2 +- .../root/usr/share/3ginfo-lite/3ginfo.sh | 27 ++-- .../usr/share/3ginfo-lite/modem/usb/1e2d00b3 | 2 +- .../usr/share/3ginfo-lite/modem/usb/1e2d00b7 | 2 +- .../usr/share/3ginfo-lite/modem/usb/2c7c0800 | 4 +- .../usr/share/3ginfo-lite/modem/usb/2c7c0801 | 4 +- .../usr/share/3ginfo-lite/modem/usb/2c7c0900 | 146 ++++++------------ 7 files changed, 69 insertions(+), 118 deletions(-) diff --git a/luci-app-3ginfo-lite/Makefile b/luci-app-3ginfo-lite/Makefile index fc8ef726..6c2914fe 100644 --- a/luci-app-3ginfo-lite/Makefile +++ b/luci-app-3ginfo-lite/Makefile @@ -12,7 +12,7 @@ MAINTAINER:=RafaƂ Wabik <4Rafal@gmail.com> LUCI_DESCRIPTION:=LuCI JS interface for the 3ginfo-lite. The package allows you to view the parameters of the mobile internet connection. LUCI_DEPENDS:=+sms-tool +comgt +kmod-usb-serial-option LUCI_PKGARCH:=all -PKG_VERSION:=1.0.66-20240421 +PKG_VERSION:=1.0.67-20240421 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh index b279ba3e..609870a3 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh @@ -193,21 +193,6 @@ else O=$(gcom -d $DEVICE -s $RES/info.gcom 2>/dev/null) fi - -CONFIG=modemdefine -MODEMZ=$(uci show $CONFIG | grep -o "@modemdefine\[[0-9]*\]\.modem" | wc -l | xargs) -if [ -z "$MODEMZ" ]; then - if [[ $MODEMZ > 1 ]]; then - SEC=$(uci -q get modemdefine.@general[0].main_network) - fi - if [[ $MODEMZ = "0" ]]; then - SEC=$(uci -q get 3ginfo.@3ginfo[0].network) - fi - if [[ $MODEMZ = 1 ]]; then - SEC=$(uci -q get modemdefine.@modemdefine[0].network) - fi -fi - getpath() { devname="$(basename $1)" case "$devname" in @@ -230,6 +215,18 @@ getpath() { esac } +CONFIG=modemdefine +MODEMZ=$(uci show $CONFIG | grep -o "@modemdefine\[[0-9]*\]\.modem" | wc -l | xargs) +if [[ $MODEMZ > 1 ]]; then + SEC=$(uci -q get modemdefine.@general[0].main_network) + fi + if [[ $MODEMZ = "0" ]]; then + SEC=$(uci -q get 3ginfo.@3ginfo[0].network) + fi + if [[ $MODEMZ = 1 ]]; then + SEC=$(uci -q get modemdefine.@modemdefine[0].network) +fi + if [ -z "$SEC" ]; then getpath $DEVICE PORIG=$P diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/1e2d00b3 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/1e2d00b3 index 50da7001..fd24a6b0 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/1e2d00b3 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/1e2d00b3 @@ -1,6 +1,6 @@ # Dell DW5930e # Foxconn T99W175 -# Thales's Cinterion MV31-W +# Thales Cinterion MV31-W O=$(sms_tool -d $DEVICE at "AT^TEMP?") diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/1e2d00b7 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/1e2d00b7 index 90bd4331..a3202c68 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/1e2d00b7 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/1e2d00b7 @@ -1,6 +1,6 @@ # Dell DW5930e # Foxconn T99W175 -# Thales's Cinterion MV31-W +# Thales Cinterion MV31-W O=$(sms_tool -d $DEVICE at "AT^TEMP?") diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0800 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0800 index 1932e087..8f29be75 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0800 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0800 @@ -229,9 +229,9 @@ if [ "x$MODE_NUM" = "x13" ]; then if [ "x${MODE:0:3}" = "xLTE" ]; then T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $14}') T_DEC=$(printf "%d" "0x$T") - addon 23 "TAC" "${T_DEC} ($T)" + T_HEX="$T" T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $18}' | awk '{printf "%.1f\n", 0.2*$1*10 - 20}') - addon 38 "SINR" "$T dB" + SINR="$T" T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $12}') case $T in 0*) T1="1.4";; diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0801 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0801 index 1206eced..22b02029 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0801 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0801 @@ -226,9 +226,9 @@ if [ "x$MODE_NUM" = "x13" ]; then if [ "x${MODE:0:3}" = "xLTE" ]; then T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $14}') T_DEC=$(printf "%d" "0x$T") - addon 23 "TAC" "${T_DEC} ($T)" + T_HEX="$T" T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $18}' | awk '{printf "%.1f\n", 0.2*$1*10 - 20}') - addon 38 "SINR" "$T dB" + SINR="$T" T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $12}') case $T in 0*) T1="1.4";; diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0900 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0900 index e8e20b5d..380a733e 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0900 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0900 @@ -78,10 +78,6 @@ if [ -n "$T" ]; then B=$(echo $T | sed 's/"LTE BAND \(.*\)"/\1/') MODE="$MODE $(band4g ${B})" ;; - *"NR N"*) - B=$(echo $T | sed 's/NR N\(.*\)/\1/') - MODE="$MODE $(band5g ${B})" - ;; *"NR5G BAND"*) B=$(echo $T | sed 's/"NR5G BAND \(.*\)"/\1/') MODE="$MODE $(band5g ${B})" @@ -96,10 +92,6 @@ if [ -n "$T" ]; then B=$(echo $T | sed 's/"LTE-BAND-\(.*\)"/\1/') MODE="$MODE / $(band4g ${B})" ;; - *"NR-N"*) - B=$(echo $T | sed 's/NR-N\(.*\)/\1/') - MODE="$MODE / $(band5g ${B})" - ;; *"NR5G-BAND"*) B=$(echo $T | sed 's/"NR5G-BAND-\(.*\)"/\1/') MODE="$MODE / $(band5g ${B})" @@ -206,7 +198,7 @@ if [ "x$MODE_NUM" = "x13" ]; then TAC_DEC=$(printf "%d" "0x$T") TAC_HEX=$T - T=$(echo "$LINE" | awk -F[,:] '/^\+QENG:/ {print $16}' | awk '{printf "%.1f\n", 0.2*$1*10 - 20}') + T=$(echo "$LINE" | awk -F[,:] '/^\+QENG:/ {print $16}' | awk '{printf "%.0f\n", 0.2*$1*10 - 20}') SINR="$T" T=$(echo "$LINE" | awk -F[,:] '/^\+QENG:/ {print $10}') case $T in @@ -230,6 +222,36 @@ if [ "x$MODE_NUM" = "x13" ]; then *) T1="";; esac [ -n "$T1" ] && DLBW="DL: @$T1 MHz" + elif [ "x$T" = "xservingcell" ]; then + if [ "x${MODE:0:3}" = "xLTE" ]; then + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $14}') + T_DEC=$(printf "%d" "0x$T") + T_HEX="$T" + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $18}' | awk '{printf "%.1f\n", 0.2*$1*10 - 20}') + SINR="$T" + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $12}') + case $T in + 0*) T1="1.4";; + 1*) T1="3";; + 2*) T1="5";; + 3*) T1="10";; + 4*) T1="15";; + 5*) T1="20";; + *) T1="";; + esac + [ -n "$T1" ] && ULBW="UL: @$T1 MHz" + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $13}') + case $T in + 0*) T1="1.4";; + 1*) T1="3";; + 2*) T1="5";; + 3*) T1="10";; + 4*) T1="15";; + 5*) T1="20";; + *) T1="";; + esac + [ -n "$T1" ] && DLBW="DL: @$T1 MHz" + fi fi done fi @@ -241,10 +263,6 @@ if [ -n "$T" ]; then B=$(echo $T | sed 's/"LTE BAND \(.*\)"/\1/') T2=$(band4g ${B}) ;; - *"NR N"*) - B=$(echo $T | sed 's/NR N\(.*\)/\1/') - T2=$(band5g ${B}) - ;; *"NR5G BAND"*) B=$(echo $T | sed 's/"NR5G BAND \(.*\)"/\1/') T2=$(band5g ${B}) @@ -260,16 +278,14 @@ if [ -n "$T" ]; then 100*) T4="20";; *) T4="";; esac - if [ -z "$T4" ]; then PBAND="$T2" if [ -n "$DBW" ]; then PBAND="$T2 $DBW" fi else - PBAND="${T2} @${T4} MHz" + PBAND="$T2 @$T4 MHz" fi - if [ "x$MODE_NUM" = "x11" ]; then T=$(echo "$O" | awk -F[,:] '/^\+QCAINFO: "(pcc|PCC)"/{print $3}') [ -n "$T" ] && EARFCN="$T" @@ -308,7 +324,7 @@ if [ -n "$T" ]; then 100*) T4="20";; *) T4="";; esac - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $3}') + T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $3}' | xargs) if [ -n "$T5" ]; then case $IDX in 1) S1EARFCN="$T5";; @@ -318,6 +334,7 @@ if [ -n "$T" ]; then *) ;; esac fi + T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $7}' | xargs) if [ -n "$T5" ]; then case $IDX in @@ -329,79 +346,15 @@ if [ -n "$T" ]; then esac fi - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $10}') + T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $10}' | xargs) # [ -n "$T5" ] && addon $((POS + 5)) "(S${IDX}) RSSI" "$T5 dBm" - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $8}') + T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $8}' | xargs) # [ -n "$T5" ] && addon $((POS + 6)) "(S${IDX}) RSRP" "$T5 dBm" - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $9}') + T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $9}' | xargs) # [ -n "$T5" ] && addon $((POS + 7)) "(S${IDX}) RSRQ" "$T5 dB" ;; - *"NR N"*) - B=$(echo $T | sed 's/NR N\(.*\)/\1/') - T2=$(band5g ${B}) - case $T3 in - 0) T4="5";; - 1) T4="10";; - 2) T4="15";; - 3) T4="20";; - 4) T4="25";; - 5) T4="30";; - 6) T4="40";; - 7) T4="50";; - 8) T4="60";; - 9) T4="70";; - 10) T4="80";; - 11) T4="90";; - 12) T4="100";; - 13) T4="200";; - 14) T4="400";; - *) T4="";; - esac - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $3}') - if [ -n "$T5" ]; then - case $IDX in - 1) S1EARFCN="$T5";; - 2) S2EARFCN="$T5";; - 3) S3EARFCN="$T5";; - 4) S4EARFCN="$T5";; - *) ;; - esac - fi - - if [ "x$MODE_NUM" = "x11" ]; then - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $7}') - if [ -n "$T5" ] && [ "$T5" != "-" ]; then - case $IDX in - 1) S1PCI="$T5";; - 2) S2PCI="$T5";; - 3) S3PCI="$T5";; - 4) S4PCI="$T5";; - *) ;; - esac - fi - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $8}') -# [ -n "$T5" ] && [ "$T5" != "-" ] && addon $((POS + 6)) "(S${IDX}) RSRP" "$T5 dBm" - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $9}') -# [ -n "$T5" ] && [ "$T5" != "-" ] && addon $((POS + 7)) "(S${IDX}) RSRQ" "$T5 dB" - else - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $6}') - if [ -n "$T5" ] && [ "$T5" != "-" ]; then - case $IDX in - 1) S1PCI="$T5";; - 2) S2PCI="$T5";; - 3) S3PCI="$T5";; - 4) S4PCI="$T5";; - *) ;; - esac - fi - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $7}') -# [ -n "$T5" ] && [ "$T5" != "-" ] && addon $((POS + 6)) "(S${IDX}) RSRP" "$T5 dBm" - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $8}') -# [ -n "$T5" ] && [ "$T5" != "-" ] && addon $((POS + 7)) "(S${IDX}) RSRQ" "$T5 dB" - fi - ;; *"NR5G BAND"*) B=$(echo $T | sed 's/"NR5G BAND \(.*\)"/\1/') T2=$(band5g ${B}) @@ -436,7 +389,7 @@ if [ -n "$T" ]; then fi if [ "x$MODE_NUM" = "x11" ]; then - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $7}') + T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $7}' | xargs) if [ -n "$T5" ] && [ "$T5" != "-" ]; then case $IDX in 1) S1PCI="$T5";; @@ -446,21 +399,22 @@ if [ -n "$T" ]; then *) ;; esac fi + T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $8}') # [ -n "$T5" ] && [ "$T5" != "-" ] && addon $((POS + 6)) "(S${IDX}) RSRP" "$T5 dBm" T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $9}') # [ -n "$T5" ] && [ "$T5" != "-" ] && addon $((POS + 7)) "(S${IDX}) RSRQ" "$T5 dB" else - T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $6}') - if [ -n "$T5" ] && [ "$T5" != "-" ]; then - case $IDX in - 1) S1PCI="$T5";; - 2) S2PCI="$T5";; - 3) S3PCI="$T5";; - 4) S4PCI="$T5";; - *) ;; - esac - fi + T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $6}' | xargs) + if [ -n "$T5" ]; then + case $IDX in + 1) S1PCI="$T5";; + 2) S2PCI="$T5";; + 3) S3PCI="$T5";; + 4) S4PCI="$T5";; + *) ;; + esac + fi T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $7}') # [ -n "$T5" ] && [ "$T5" != "-" ] && addon $((POS + 6)) "(S${IDX}) RSRP" "$T5 dBm" T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $8}') @@ -497,7 +451,7 @@ MODE=$(echo $MODE | sed 's,/,+,'| sed 's,LTE B,LTE | B,') if [ "${LAC_DEC}" = "0" ]; then LAC_DEC="-" LAC_HEX="-" -fi +fi # Modem FWA=$(sms_tool -d $DEVICE at "AT+GMR" | tr -s "\n" | xargs)