Skip to content

Commit

Permalink
Up to 1.0.67-20240421
Browse files Browse the repository at this point in the history
- Fix for reading interface settings
- Fix for missing TAC HEX value for RM520N-GL
  • Loading branch information
4IceG authored Apr 21, 2024
1 parent 3b20a7e commit 8049fd5
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 118 deletions.
2 changes: 1 addition & 1 deletion luci-app-3ginfo-lite/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MAINTAINER:=Rafał Wabik <[email protected]>
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

Expand Down
27 changes: 12 additions & 15 deletions luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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?")

Expand Down
Original file line number Diff line number Diff line change
@@ -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?")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";;
Expand Down
146 changes: 50 additions & 96 deletions luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0900
Original file line number Diff line number Diff line change
Expand Up @@ -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})"
Expand All @@ -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})"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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})
Expand All @@ -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"
Expand Down Expand Up @@ -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";;
Expand All @@ -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
Expand All @@ -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})
Expand Down Expand Up @@ -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";;
Expand All @@ -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}')
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8049fd5

Please sign in to comment.