From 287e10fb9664d751e47e724c9e38f245f774ef51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Wabik?= <4rafal@gmail.com> Date: Sat, 22 Jun 2024 18:52:29 +0200 Subject: [PATCH] Up to 1.0.73-20240622 --- luci-app-3ginfo-lite/Makefile | 2 +- .../usr/share/3ginfo-lite/modem/usb/05c69025 | 223 ++++++++ .../usr/share/3ginfo-lite/modem/usb/05c690d5 | 223 ++++++++ .../usr/share/3ginfo-lite/modem/usb/05c69625 | 85 +++ .../usr/share/3ginfo-lite/modem/usb/2c7c0133 | 502 ++++++++++++++++++ .../usr/share/3ginfo-lite/modem/usb/2c7c0800 | 32 +- .../usr/share/3ginfo-lite/modem/usb/2c7c0801 | 55 +- .../usr/share/3ginfo-lite/modem/usb/2cb70007 | 293 ++++++++++ .../usr/share/3ginfo-lite/modem/usb/808707f9 | 10 +- .../usr/share/3ginfo-lite/modem/usb/8087095a | 10 +- .../rpcd/acl.d/luci-app-3ginfo-lite.json | 4 +- 11 files changed, 1415 insertions(+), 24 deletions(-) create mode 100644 luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/05c69025 create mode 100644 luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/05c690d5 create mode 100644 luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/05c69625 create mode 100644 luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0133 create mode 100644 luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2cb70007 diff --git a/luci-app-3ginfo-lite/Makefile b/luci-app-3ginfo-lite/Makefile index f30900db..e2678449 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.72-20240519 +PKG_VERSION:=1.0.73-20240622 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/05c69025 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/05c69025 new file mode 100644 index 00000000..2f7c5c83 --- /dev/null +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/05c69025 @@ -0,0 +1,223 @@ +# Foxconn T99W175 (FW 6.0.0.6) + +O=$(sms_tool -d $DEVICE at "AT^TEMP?") + +T=$(echo "$O" | awk '/^TSENS: / {gsub("C","",$2); print $2}') +T1=$(echo "$O" | awk '/^PA: / {gsub("C","",$2); print $2}') +if [ -n "$T" ] && [ -n "$T1" ]; then + if [[ "$T1" =~ ^[0-9]+$ && "$T" =~ ^[0-9]+$ ]]; then + if [ "$T1" -gt "$T" ]; then + T="$T1" + fi + fi +fi + +T1=$(echo "$O" | awk '/^Skin Sensor: / {gsub("C","",$2); print $2}') +if [ -n "$T" ] && [ -n "$T1" ]; then + if [[ "$T1" =~ ^[0-9]+$ && "$T" =~ ^[0-9]+$ ]]; then + if [ "$T1" -gt "$T" ]; then + T="$T1" + fi + fi +fi +[ -n "$T" ] && TEMP="$T °C" + +if [ "$REGOK" = "1" ]; then + +O=$(sms_tool -d $DEVICE at "at^debug?") + +case "$MODE_NUM" in + "7") + MODE="LTE |" + echo "$O" | grep -q "scell:" && MODE="LTE-A |" + ;; + "11") + MODE="5G SA |" + ;; + "13") + MODE="5G NSA |" + ;; +esac + +T=$(echo "$O" | awk -F: '/^lte_tac:/ {print $2}' | xargs) +if [ -n "$T" ]; then +# TAC_HEX=$(printf "%X" $T) +# TAC_DEC=$(printf "%d" "0x$T") + + TAC_HEX=$(printf "%X" $T) + TAC_DEC="$T" +fi + +O1=$(echo "$O" | grep -A 3 pcell) +T=$(echo "$O1" | awk -F: '/^pcell:/ {print $3}' | cut -f1 -d" ") +if [ -n "$T" ]; then + MODE="$MODE $(band4g $T)" + T1=$(echo "$O1" | awk -F: '/^pcell:/ {print $4}' | xargs) + PBAND="$(band4g $T) @${T1/MHz/} MHz" + + T=$(echo "$O1" | awk -F: '/pci:/ {print $3}' | xargs) + [ -n "$T" ] && PCI=$T + T=$(echo "$O1" | awk -F: '/^channel:/ {print $2}' | cut -f1 -d" " | xargs) + [ -n "$T" ] && EARFCN=$T + T=$(echo "$O1" | awk -F[:,] '/^lte_rsrp:/ {print $2}') + [ -n "$T" ] && RSRP="${T/dBm/}" + T=$(echo "$O1" | awk -F[:,] '/rsrq:/ {print $4}' | xargs) + [ -n "$T" ] && RSRQ="${T/dB/}" + T=$(echo "$O1" | awk -F[:,] '/^lte_rssi:/ {print $2}') + [ -n "$T" ] && RSSI="${T/dBm/}" + T=$(echo "$O1" | awk -F[:,] '/lte_snr:/ {print $4}' | xargs) + [ -n "$T" ] && [ "$T" != "NA" ] && SINR="${T/dB/}" +fi + +O1=$(echo "$O" | grep -A 3 scell) +IDX=0; +while true; do + O2=$(echo "$O1" | head -n4) + if [ -z "$O2" ]; then + break + fi + IDX=$((IDX + 1)) + + T=$(echo "$O2" | awk -F: '/^scell:/ {print $3}' | cut -f1 -d" ") + MODE="$MODE / $(band4g $T)" + T1=$(echo "$O2" | awk -F: '/^scell:/ {print $4}' | xargs) + if [ -n "$T1" ]; then + case $IDX in + 1) S1BAND="$(band4g $T) @${T1/MHz/} MHz";; + 2) S2BAND="$(band4g $T) @${T1/MHz/} MHz";; + 3) S3BAND="$(band4g $T) @${T1/MHz/} MHz";; + 4) S4BAND="$(band4g $T) @${T1/MHz/} MHz";; + *) ;; + esac + fi + + T=$(echo "$O2" | awk -F: '/pci:/ {print $3}' | xargs) + if [ -n "$T" ]; then + case $IDX in + 1) S1PCI="$T";; + 2) S2PCI="$T";; + 3) S3PCI="$T";; + 4) S4PCI="$T";; + *) ;; + esac + fi + + T=$(echo "$O2" | awk -F: '/^channel:/ {print $2}' | cut -f1 -d" " | xargs) + if [ -n "$T" ]; then + case $IDX in + 1) S1EARFCN="$T";; + 2) S2EARFCN="$T";; + 3) S3EARFCN="$T";; + 4) S4EARFCN="$T";; + *) ;; + esac + fi + + T=$(echo "$O2" | awk -F[:,] '/^lte_rsrp:/ {print $2}') +# [ -n "$T" ] && addon $((POS + 6)) "(S${IDX}) RSRP" "${T/dBm/} dBm" + T=$(echo "$O2" | awk -F[:,] '/rsrq:/ {print $4}' | xargs) +# [ -n "$T" ] && addon $((POS + 7)) "(S${IDX}) RSRQ" "${T/dB/} dB" + T=$(echo "$O2" | awk -F[:,] '/^lte_rssi:/ {print $2}') +# [ -n "$T" ] && addon $((POS + 5)) "(S${IDX}) RSSI" "${T/dBm/} dBm" + T=$(echo "$O2" | awk -F[:,] '/lte_snr:/ {print $4}' | xargs) +# [ -n "$T" ] && [ "$T" != "NA" ] && addon $((POS + 8)) "(S${IDX}) SNR" "${T/dB/} dB" + + O1=$(echo "$O1" | sed '1,4d') +done + +T=$(echo "$O" | awk -F: '/^nr_band:/ {print $2}' | xargs) +if [ -n "$T" ]; then + MODE="$MODE / $(band5g ${T/n/})" + IDX=$((IDX + 1)) + + T1=$(echo "$O" | awk -F: '/^nr_band_width:/ {print $2}' | xargs) + if [ -n "$T1" ]; then + case $IDX in + 1) S1BAND="$(band5g ${T/n/}) @${T1/MHz/} MHz";; + 2) S2BAND="$(band5g ${T/n/}) @${T1/MHz/} MHz";; + 3) S3BAND="$(band5g ${T/n/}) @${T1/MHz/} MHz";; + 4) S4BAND="$(band5g ${T/n/}) @${T1/MHz/} MHz";; + *) ;; + esac + fi + + T=$(echo "$O" | awk -F: '/^nr_pci:/ {print $2}' | xargs) + if [ -n "$T" ]; then + case $IDX in + 1) S1PCI="$T";; + 2) S2PCI="$T";; + 3) S3PCI="$T";; + 4) S4PCI="$T";; + *) ;; + esac + fi + T=$(echo "$O" | awk -F: '/^nr_channel:/ {print $2}' | xargs) + if [ -n "$T" ]; then + case $IDX in + 1) S1EARFCN="$T";; + 2) S2EARFCN="$T";; + 3) S3EARFCN="$T";; + 4) S4EARFCN="$T";; + *) ;; + esac + fi + T=$(echo "$O" | awk -F: '/^nr_rsrp:/ {print $2}' | cut -f1 -d" ") +# [ -n "$T" ] && addon $((POS + 6)) "(S${IDX}) RSRP" "${T/dBm/} dBm" + T=$(echo "$O" | awk -F: '/^nr_rsrq:/ {print $2}' | xargs) +# [ -n "$T" ] && addon $((POS + 7)) "(S${IDX}) RSRQ" "${T/dB/} dB" + T=$(echo "$O" | awk -F: '/^nr_snr:/ {print $2}' | xargs) +# [ -n "$T" ] && [ "$T" != "NA" ] && addon $((POS + 8)) "(S${IDX}) SNR" "${T/dB/} dB" +fi + +fi + +MODE=$(echo $MODE | sed 's,/,+,'| sed 's,LTE B,LTE | B,') + + +# Modem + +MODELA=$(sms_tool -d $DEVICE at "AT+CGMM" | tr -s "\n" | xargs) +MODELB=$(sms_tool -d $DEVICE at "AT+CGMI" | tr -s "\n" | xargs) +MODELACUT=$(echo $MODELA | sed s/"AT+CGMM "//) +MODELBCUT=$(echo $MODELB | sed s/"AT+CGMI "//) +MODEL="$MODELBCUT "$MODELACUT + +FWA=$(sms_tool -d $DEVICE at "AT+CGMR" | tr -s "\n" | xargs) +FW=$(echo $FWA | sed s/"AT+CGMR "//) + +# International Mobile Equipment Identity (IMEI) +O=$(sms_tool -d $DEVICE at "AT+CGSN" | xargs) +NR_I=$(echo "$O" | sed s/"AT+CGSN "//) +if [ -n "$NR_I" ]; then + NR_IMEI="$NR_I" +fi + +# International Mobile Subscriber Identity (IMSI) +O=$(sms_tool -d $DEVICE at "AT+CIMI" | xargs) +NR_C=$(echo "$O" | sed s/"AT+CIMI "//) +if [ -n "$NR_C" ]; then + NR_IMSI="$NR_C" +fi + +# Integrated Circuit Card Identifier (ICCID) +O=$(sms_tool -d $DEVICE at "AT+ICCID") +NR_D=$(echo "$O" | awk -F [:] '/^\ICCID:/{print $2}' | xargs) +if [ -n "$NR_D" ]; then + NR_ICCID="$NR_D" +fi + +# Protocol +# DRIVER=QMI_WWAN & DRIVER=CDC_MBIM & DRIVER=CDC_ETHER + +PV=$(cat /sys/kernel/debug/usb/devices 2>/dev/null) +PVCUT=$(echo $PV | awk -F 'Vendor=05c6 ProdID=9025' '{print $2}' | cut -c-1290) +if echo "$PVCUT" | grep -q "Driver=qmi_wwan" +then + PROTO="qmi" +elif echo "$PVCUT" | grep -q "Driver=cdc_mbim" +then + PROTO="mbim" +elif echo "$PVCUT" | grep -q "Driver=cdc_ether" +then + PROTO="ecm" +fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/05c690d5 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/05c690d5 new file mode 100644 index 00000000..46221406 --- /dev/null +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/05c690d5 @@ -0,0 +1,223 @@ +# Foxconn T99W175 (FW 6.0.0.6) + +O=$(sms_tool -d $DEVICE at "AT^TEMP?") + +T=$(echo "$O" | awk '/^TSENS: / {gsub("C","",$2); print $2}') +T1=$(echo "$O" | awk '/^PA: / {gsub("C","",$2); print $2}') +if [ -n "$T" ] && [ -n "$T1" ]; then + if [[ "$T1" =~ ^[0-9]+$ && "$T" =~ ^[0-9]+$ ]]; then + if [ "$T1" -gt "$T" ]; then + T="$T1" + fi + fi +fi + +T1=$(echo "$O" | awk '/^Skin Sensor: / {gsub("C","",$2); print $2}') +if [ -n "$T" ] && [ -n "$T1" ]; then + if [[ "$T1" =~ ^[0-9]+$ && "$T" =~ ^[0-9]+$ ]]; then + if [ "$T1" -gt "$T" ]; then + T="$T1" + fi + fi +fi +[ -n "$T" ] && TEMP="$T °C" + +if [ "$REGOK" = "1" ]; then + +O=$(sms_tool -d $DEVICE at "at^debug?") + +case "$MODE_NUM" in + "7") + MODE="LTE |" + echo "$O" | grep -q "scell:" && MODE="LTE-A |" + ;; + "11") + MODE="5G SA |" + ;; + "13") + MODE="5G NSA |" + ;; +esac + +T=$(echo "$O" | awk -F: '/^lte_tac:/ {print $2}' | xargs) +if [ -n "$T" ]; then +# TAC_HEX=$(printf "%X" $T) +# TAC_DEC=$(printf "%d" "0x$T") + + TAC_HEX=$(printf "%X" $T) + TAC_DEC="$T" +fi + +O1=$(echo "$O" | grep -A 3 pcell) +T=$(echo "$O1" | awk -F: '/^pcell:/ {print $3}' | cut -f1 -d" ") +if [ -n "$T" ]; then + MODE="$MODE $(band4g $T)" + T1=$(echo "$O1" | awk -F: '/^pcell:/ {print $4}' | xargs) + PBAND="$(band4g $T) @${T1/MHz/} MHz" + + T=$(echo "$O1" | awk -F: '/pci:/ {print $3}' | xargs) + [ -n "$T" ] && PCI=$T + T=$(echo "$O1" | awk -F: '/^channel:/ {print $2}' | cut -f1 -d" " | xargs) + [ -n "$T" ] && EARFCN=$T + T=$(echo "$O1" | awk -F[:,] '/^lte_rsrp:/ {print $2}') + [ -n "$T" ] && RSRP="${T/dBm/}" + T=$(echo "$O1" | awk -F[:,] '/rsrq:/ {print $4}' | xargs) + [ -n "$T" ] && RSRQ="${T/dB/}" + T=$(echo "$O1" | awk -F[:,] '/^lte_rssi:/ {print $2}') + [ -n "$T" ] && RSSI="${T/dBm/}" + T=$(echo "$O1" | awk -F[:,] '/lte_snr:/ {print $4}' | xargs) + [ -n "$T" ] && [ "$T" != "NA" ] && SINR="${T/dB/}" +fi + +O1=$(echo "$O" | grep -A 3 scell) +IDX=0; +while true; do + O2=$(echo "$O1" | head -n4) + if [ -z "$O2" ]; then + break + fi + IDX=$((IDX + 1)) + + T=$(echo "$O2" | awk -F: '/^scell:/ {print $3}' | cut -f1 -d" ") + MODE="$MODE / $(band4g $T)" + T1=$(echo "$O2" | awk -F: '/^scell:/ {print $4}' | xargs) + if [ -n "$T1" ]; then + case $IDX in + 1) S1BAND="$(band4g $T) @${T1/MHz/} MHz";; + 2) S2BAND="$(band4g $T) @${T1/MHz/} MHz";; + 3) S3BAND="$(band4g $T) @${T1/MHz/} MHz";; + 4) S4BAND="$(band4g $T) @${T1/MHz/} MHz";; + *) ;; + esac + fi + + T=$(echo "$O2" | awk -F: '/pci:/ {print $3}' | xargs) + if [ -n "$T" ]; then + case $IDX in + 1) S1PCI="$T";; + 2) S2PCI="$T";; + 3) S3PCI="$T";; + 4) S4PCI="$T";; + *) ;; + esac + fi + + T=$(echo "$O2" | awk -F: '/^channel:/ {print $2}' | cut -f1 -d" " | xargs) + if [ -n "$T" ]; then + case $IDX in + 1) S1EARFCN="$T";; + 2) S2EARFCN="$T";; + 3) S3EARFCN="$T";; + 4) S4EARFCN="$T";; + *) ;; + esac + fi + + T=$(echo "$O2" | awk -F[:,] '/^lte_rsrp:/ {print $2}') +# [ -n "$T" ] && addon $((POS + 6)) "(S${IDX}) RSRP" "${T/dBm/} dBm" + T=$(echo "$O2" | awk -F[:,] '/rsrq:/ {print $4}' | xargs) +# [ -n "$T" ] && addon $((POS + 7)) "(S${IDX}) RSRQ" "${T/dB/} dB" + T=$(echo "$O2" | awk -F[:,] '/^lte_rssi:/ {print $2}') +# [ -n "$T" ] && addon $((POS + 5)) "(S${IDX}) RSSI" "${T/dBm/} dBm" + T=$(echo "$O2" | awk -F[:,] '/lte_snr:/ {print $4}' | xargs) +# [ -n "$T" ] && [ "$T" != "NA" ] && addon $((POS + 8)) "(S${IDX}) SNR" "${T/dB/} dB" + + O1=$(echo "$O1" | sed '1,4d') +done + +T=$(echo "$O" | awk -F: '/^nr_band:/ {print $2}' | xargs) +if [ -n "$T" ]; then + MODE="$MODE / $(band5g ${T/n/})" + IDX=$((IDX + 1)) + + T1=$(echo "$O" | awk -F: '/^nr_band_width:/ {print $2}' | xargs) + if [ -n "$T1" ]; then + case $IDX in + 1) S1BAND="$(band5g ${T/n/}) @${T1/MHz/} MHz";; + 2) S2BAND="$(band5g ${T/n/}) @${T1/MHz/} MHz";; + 3) S3BAND="$(band5g ${T/n/}) @${T1/MHz/} MHz";; + 4) S4BAND="$(band5g ${T/n/}) @${T1/MHz/} MHz";; + *) ;; + esac + fi + + T=$(echo "$O" | awk -F: '/^nr_pci:/ {print $2}' | xargs) + if [ -n "$T" ]; then + case $IDX in + 1) S1PCI="$T";; + 2) S2PCI="$T";; + 3) S3PCI="$T";; + 4) S4PCI="$T";; + *) ;; + esac + fi + T=$(echo "$O" | awk -F: '/^nr_channel:/ {print $2}' | xargs) + if [ -n "$T" ]; then + case $IDX in + 1) S1EARFCN="$T";; + 2) S2EARFCN="$T";; + 3) S3EARFCN="$T";; + 4) S4EARFCN="$T";; + *) ;; + esac + fi + T=$(echo "$O" | awk -F: '/^nr_rsrp:/ {print $2}' | cut -f1 -d" ") +# [ -n "$T" ] && addon $((POS + 6)) "(S${IDX}) RSRP" "${T/dBm/} dBm" + T=$(echo "$O" | awk -F: '/^nr_rsrq:/ {print $2}' | xargs) +# [ -n "$T" ] && addon $((POS + 7)) "(S${IDX}) RSRQ" "${T/dB/} dB" + T=$(echo "$O" | awk -F: '/^nr_snr:/ {print $2}' | xargs) +# [ -n "$T" ] && [ "$T" != "NA" ] && addon $((POS + 8)) "(S${IDX}) SNR" "${T/dB/} dB" +fi + +fi + +MODE=$(echo $MODE | sed 's,/,+,'| sed 's,LTE B,LTE | B,') + + +# Modem + +MODELA=$(sms_tool -d $DEVICE at "AT+CGMM" | tr -s "\n" | xargs) +MODELB=$(sms_tool -d $DEVICE at "AT+CGMI" | tr -s "\n" | xargs) +MODELACUT=$(echo $MODELA | sed s/"AT+CGMM "//) +MODELBCUT=$(echo $MODELB | sed s/"AT+CGMI "//) +MODEL="$MODELBCUT "$MODELACUT + +FWA=$(sms_tool -d $DEVICE at "AT+CGMR" | tr -s "\n" | xargs) +FW=$(echo $FWA | sed s/"AT+CGMR "//) + +# International Mobile Equipment Identity (IMEI) +O=$(sms_tool -d $DEVICE at "AT+CGSN" | xargs) +NR_I=$(echo "$O" | sed s/"AT+CGSN "//) +if [ -n "$NR_I" ]; then + NR_IMEI="$NR_I" +fi + +# International Mobile Subscriber Identity (IMSI) +O=$(sms_tool -d $DEVICE at "AT+CIMI" | xargs) +NR_C=$(echo "$O" | sed s/"AT+CIMI "//) +if [ -n "$NR_C" ]; then + NR_IMSI="$NR_C" +fi + +# Integrated Circuit Card Identifier (ICCID) +O=$(sms_tool -d $DEVICE at "AT+ICCID") +NR_D=$(echo "$O" | awk -F [:] '/^\ICCID:/{print $2}' | xargs) +if [ -n "$NR_D" ]; then + NR_ICCID="$NR_D" +fi + +# Protocol +# DRIVER=QMI_WWAN & DRIVER=CDC_MBIM & DRIVER=CDC_ETHER + +PV=$(cat /sys/kernel/debug/usb/devices 2>/dev/null) +PVCUT=$(echo $PV | awk -F 'Vendor=05c6 ProdID=90d5' '{print $2}' | cut -c-1290) +if echo "$PVCUT" | grep -q "Driver=qmi_wwan" +then + PROTO="qmi" +elif echo "$PVCUT" | grep -q "Driver=cdc_mbim" +then + PROTO="mbim" +elif echo "$PVCUT" | grep -q "Driver=cdc_ether" +then + PROTO="ecm" +fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/05c69625 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/05c69625 new file mode 100644 index 00000000..e4e3e66f --- /dev/null +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/05c69625 @@ -0,0 +1,85 @@ +# YUGA CLM920-NC5 + +O=$(sms_tool -d $DEVICE at "at+temp") + +T=$(echo "$O" | awk -F[,:] '/^temp:/ {print $2}') +[ -n "$T" ] && TEMP="$T °C" + +if [ "$REGOK" = "1" ]; then + +O=$(sms_tool -d $DEVICE at "at+qnwinfo") + +if [ "x$MODE_NUM" = "x7" ]; then + T=$(echo "$O" | awk -F[,:] '/^\+QNWINFO/ {print $4}') + if [ -n "$T" ]; then + B=$(echo $T | sed 's/.*LTE_EUTRAN_BAND\(.*\)"/\1/') + MODE="LTE $(band4g ${B})" + PBAND="$(band4g ${B})" + T=$(echo "$O" | awk -F[,:] '/^\+QNWINFO/ {print $5}') + EARFCN="$T" + fi + O=$(sms_tool -d $DEVICE at "at+qnwinfo") + T=$(echo "$O" | awk -F[,:] '/^\+LTEINFO/ {print $3}') + if [ -n "$T" ]; then + T_HEX=$(printf "%X" "$T") + T_DEC=$(printf "%d" "$T") + fi + T=$(echo "$O" | awk -F[,:] '/^\+LTEINFO/ {print $5}') + [ -n "$T" ] && PCI="$T" + T=$(echo "$O" | awk -F[,:] '/^\+LTEINFO/ {print $12}') + [ -n "$T" ] && RSSI="$T" + T=$(echo "$O" | awk -F[,:] '/^\+LTEINFO/ {print $11}') + [ -n "$T" ] && RSRP="$T" + T=$(echo "$O" | awk -F[,:] '/^\+LTEINFO/ {print $10}') + [ -n "$T" ] && RSRQ="$T" + T=$(echo "$O" | awk -F[,:] '/^\+LTEINFO/ {print $13}' | xargs) + [ -n "$T" ] && SINR="$T" +fi + +fi + +# Modem +FWA=$(sms_tool -d $DEVICE at "AT+CGMR" | tr -s "\n" | xargs) +FW=$(echo $FWA | sed s/"AT+CGMR"//) + +MODELA=$(sms_tool -d $DEVICE at "AT+CGMM" | tr -s "\n" | xargs) +MODELB=$(sms_tool -d $DEVICE at "AT+CGMI" | tr -s "\n" | xargs) +MODELACUT=$(echo $MODELA | sed s/"AT+CGMM "//) +MODELBCUT=$(echo $MODELB | sed s/"AT+CGMI "// | sed s/"Co.,Ltd."//) +MODEL="$MODELBCUT "$MODELACUT + +# International Mobile Equipment Identity (IMEI) +O=$(sms_tool -d $DEVICE at "AT^IMEI?" | xargs) +NR_I=$(echo "$O" | awk -F': ' '/\^IMEI:/ {print $2}') +if [ -n "$NR_I" ]; then + NR_IMEI="$NR_I" +fi + +# International Mobile Subscriber Identity (IMSI) +O=$(sms_tool -d $DEVICE at "AT+QCIMI" | xargs) +NR_C=$(echo "$O" | sed s/"AT+QCIMI "//) +if [ -n "$NR_C" ]; then + NR_IMSI="$NR_C" +fi + +# Integrated Circuit Card Identifier (ICCID) +O=$(sms_tool -d $DEVICE at "AT+ICCID") +NR_D=$(echo "$O" | awk -F [:] '/^\+ICCID:/{print $2}' | xargs) +if [ -n "$NR_D" ]; then + NR_ICCID="$NR_D" +fi + +# Protocol +# DRIVER=QMI_WWAN & DRIVER=CDC_MBIM & DRIVER=CDC_ETHER +PV=$(cat /sys/kernel/debug/usb/devices 2>/dev/null) +PVCUT=$(echo $PV | awk -F 'Vendor=05c6 ProdID=9625' '{print $2}' | cut -c-1220) +if echo "$PVCUT" | grep -q "Driver=qmi_wwan" +then + PROTO="qmi" +elif echo "$PVCUT" | grep -q "Driver=cdc_mbim" +then + PROTO="mbim" +elif echo "$PVCUT" | grep -q "Driver=cdc_ether" +then + PROTO="ecm" +fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0133 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0133 new file mode 100644 index 00000000..ac421a72 --- /dev/null +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2c7c0133 @@ -0,0 +1,502 @@ +# Quectel RM551E-GL + +O=$(sms_tool -d $DEVICE at "at+qtemp") + +T=$(echo "$O" | awk -F[,:] '/^\+QTEMP/ {print $3}' | sort -r | head -n1 | xargs) +[ -n "$T" ] && TEMP="$T °C" + +if [ -z "$REG" ] || [ "x$MODE_NUM" = "x11" ]; then + O=$(sms_tool -d $DEVICE at "at+c5greg=2;+c5greg?") + + # C5GREG + eval $(echo "$O" | awk -F[,] '/^\+C5GREG/ {gsub(/[[:space:]"]+/,"");printf "T=\"%d\";TAC_HEX=\"%X\";CID_HEX=\"%s\";TAC_DEC=\"%d\";MODE_NUM=\"%d\"", $2, "0x"$3, $4, "0x"$3, $5}') + case "$T" in + 0*) REG="0";; + 1*) REG="1";; + 2*) REG="2";; + 3*) REG="3";; + 5*) REG="5";; + *) REG="";; + esac + [ "x$REG" = "x1" ] || [ "x$REG" = "x5" ] && REGOK=1 + + [ "$TAC_DEC" != "0" ] + [ -n "$CID_HEX" ] && CID_DEC=$(printf "%d" "0x${CID_HEX}") +fi + +if [ "$REGOK" = "1" ]; then + +O=$(sms_tool -d $DEVICE at "at+qnwinfo;+qcainfo;+qeng=\"servingcell\";+qspn") + +T=$(echo "$O" | awk -F[,:] '/^\+QSPN/ {print $2}' | xargs) +if [ -n "$T" ] && [ -z "$FORCE_PLMN" ]; then + COPS="$T" +fi + +case "$MODE_NUM" in + 7*) + if echo "$O" | grep -q -i "+QCAINFO.*SCC"; then + MODE="LTE-A |" + fi + ;; + 11*) + MODE="5G SA |" + ;; + 13*) + if echo "$O" | grep -q -i "+QCAINFO.*NR5G"; then + MODE="5G NSA |" + else + if echo "$O" | grep -q -i "+QCAINFO.*PCC.*LTE"; then + MODE="LTE |" + + OTS=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $18}' | awk '{printf "%.0f\n", 0.2*$1*10 - 20}') + SINR=$OTS + + TDX=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $14}') + TAC_DEC=$(printf "%d" "0x$TDX") + TAC_HEX=$TDX + + if echo "$O" | grep -q -i "+QCAINFO.*SCC"; then + MODE="LTE-A |" + + OTS=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $18}' | awk '{printf "%.0f\n", 0.2*$1*10 - 20}') + SINR=$OTS + + TDX=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $14}') + TAC_DEC=$(printf "%d" "0x$TDX") + TAC_HEX=$TDX + fi + fi + fi + ;; +esac + +T=$(echo "$O" | awk -F[,:] '/^\+QCAINFO: "(pcc|PCC)"/{print $5}') +if [ -n "$T" ]; then + case $T in + *"LTE BAND"*) + B=$(echo $T | sed 's/"LTE BAND \(.*\)"/\1/') + MODE="$MODE $(band4g ${B})" + ;; + *"NR5G BAND"*) + B=$(echo $T | sed 's/"NR5G BAND \(.*\)"/\1/') + MODE="$MODE $(band5g ${B})" + ;; + esac + + T1=$(echo "$O" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{gsub(" ", "-");print $5}') + if [ -n "$T1" ]; then + for T in $T1; do + case $T in + *"LTE-BAND"*) + B=$(echo $T | sed 's/"LTE-BAND-\(.*\)"/\1/') + MODE="$MODE / $(band4g ${B})" + ;; + *"NR5G-BAND"*) + B=$(echo $T | sed 's/"NR5G-BAND-\(.*\)"/\1/') + MODE="$MODE / $(band5g ${B})" + ;; + esac + done + fi +fi + +if [ "x$MODE_NUM" = "x7" ]; then + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $4}' | xargs) + if [ "x$T" = "xLTE" ]; then + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $14}') + TAC_DEC=$(printf "%d" "0x$T") + TAC_HEX="$T" + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $18}' | awk '{printf "%.0f\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 + +if [ "x$MODE_NUM" = "x11" ]; then + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $4}' | xargs) + if [ "x$T" = "xNR5G-SA" ]; then + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $8}') + if [ -n "$T" ]; then + CID_HEX=$T + CID_DEC=$(printf "%d" "0x${CID_HEX}") + fi +# T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $9}') +# [ -n "$T" ] && PCI="$T" + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $13}') + case $T in + 0) BW="5";; + 1) BW="10";; + 2) BW="15";; + 3) BW="20";; + 4) BW="25";; + 5) BW="30";; + 6) BW="40";; + 7) BW="50";; + 8) BW="60";; + 9) BW="70";; + 10) BW="80";; + 11) BW="90";; + 12) BW="100";; + 13) BW="200";; + 14) BW="400";; + *) BW="";; + esac + [ -n "$BW" ] && DBW="@$BW MHz" + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $14}') + if [ -n "$T" ]; then + RSRP="$T" + if [ -n "$BW" ]; then + N=$((BW * 5)) + RSSI=$(echo "$T $N" | awk '{printf "%d\n", $1 + 10*log(12*$2)/log(10)}') + if [ -n "$RSSI" ]; then + [ $RSSI -lt -113 ] && RSSI="-113" + [ $RSSI -gt -51 ] && RSSI="-51" + RSSI="$RSSI" + [ -z "$CSQ_PER" ] && CSQ_PER=$(((RSSI + 113) * 100 / 62 )) + [ -z "$CSQ" ] && CSQ=$(((31 * CSQ_PER) / 100)) + fi + fi + fi + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $15}') + [ -n "$T" ] && RSRQ="$T" + T=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $16}') + [ -n "$T" ] && SINR="$T" + fi +fi + +IFS=" +" + +if [ "x$MODE_NUM" = "x13" ]; then + LINES=$(echo "$O" | grep "+QENG") + for LINE in $LINES; do + T=$(echo "$LINE" | awk -F[,:] '/^\+QENG:/{print $2}' | xargs) + if [ "x$T" = "xLTE" ]; then + T=$(echo "$LINE" | awk -F[,:] '/^\+QENG:/ {print $12}') + TAC_DEC=$(printf "%d" "0x$T") + TAC_HEX=$T + + 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 + 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 "$LINE" | awk -F[,:] '/^\+QENG:/ {print $11}') + 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" + 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 + +T=$(echo "$O" | awk -F[,:] '/^\+QCAINFO: "(pcc|PCC)"/{print $5}') +if [ -n "$T" ]; then + case $T in + *"LTE BAND"*) + B=$(echo $T | sed 's/"LTE BAND \(.*\)"/\1/') + T2=$(band4g ${B}) + ;; + *"NR5G BAND"*) + B=$(echo $T | sed 's/"NR5G BAND \(.*\)"/\1/') + T2=$(band5g ${B}) + ;; + esac + T3=$(echo "$O" | awk -F[,:] '/^\+QCAINFO: "(pcc|PCC)"/{print $4}') + case $T3 in + 6*) T4="1.4";; + 15*) T4="3";; + 25*) T4="5";; + 50*) T4="10";; + 75*) T4="15";; + 100*) T4="20";; + *) T4="";; + esac + if [ -z "$T4" ]; then + PBAND="$T2" + if [ -n "$DBW" ]; then + PBAND="$T2 $DBW" + fi + else + 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" + T=$(echo "$O" | awk -F[,:] '/^\+QCAINFO: "(pcc|PCC)"/{print $6}' | xargs) + [ -n "$T" ] && PCI="$T" + else + T=$(echo "$O" | awk -F[,:] '/^\+QCAINFO: "(pcc|PCC)"/{print $3}') + [ -n "$T" ] && EARFCN="$T" + T=$(echo "$O" | awk -F[,:] '/^\+QCAINFO: "(pcc|PCC)"/{print $7}') + [ -n "$T" ] && PCI="$T" + T=$(echo "$O" | awk -F[,:] '/^\+QCAINFO: "(pcc|PCC)"/{print $10}') + [ -n "$T" ] && RSSI="$T" + T=$(echo "$O" | awk -F[,:] '/^\+QCAINFO: "(pcc|PCC)"/{print $8}') + [ -n "$T" ] && RSRP="$T" + T=$(echo "$O" | awk -F[,:] '/^\+QCAINFO: "(pcc|PCC)"/{print $9}') + [ -n "$T" ] && RSRQ="$T" + fi + + IDX=1 + LINES=$(echo "$O" | grep -E "^\+QCAINFO: \"(scc|SCC)\"") + for LINE in $LINES; do + + T=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $5}') + T3=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $4}') + T4="" + case $T in + *"LTE BAND"*) + B=$(echo $T | sed 's/"LTE BAND \(.*\)"/\1/') + T2=$(band4g ${B}) + case $T3 in + 6*) T4="1.4";; + 15*) T4="3";; + 25*) T4="5";; + 50*) T4="10";; + 75*) T4="15";; + 100*) T4="20";; + *) T4="";; + esac + T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $3}' | xargs) + if [ -n "$T5" ]; then + case $IDX in + 1) S1EARFCN="$T5";; + 2) S2EARFCN="$T5";; + 3) S3EARFCN="$T5";; + 4) S4EARFCN="$T5";; + *) ;; + esac + fi + + T5=$(echo "$LINE" | awk -F[,:] '/^\+QCAINFO: "(scc|SCC)"/{print $7}' | 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 $10}' | xargs) +# [ -n "$T5" ] && addon $((POS + 5)) "(S${IDX}) RSSI" "$T5 dBm" + + 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}' | xargs) +# [ -n "$T5" ] && addon $((POS + 7)) "(S${IDX}) RSRQ" "$T5 dB" + ;; + *"NR5G BAND"*) + B=$(echo $T | sed 's/"NR5G BAND \(.*\)"/\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}') + [ -n "$T5" ] + 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}' | xargs) + 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}' | 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}') +# [ -n "$T5" ] && [ "$T5" != "-" ] && addon $((POS + 7)) "(S${IDX}) RSRQ" "$T5 dB" + fi + ;; + esac + if [ -z "$T4" ]; then + case $IDX in + 1) S1BAND="$T2";; + 2) S2BAND="$T2";; + 3) S3BAND="$T2";; + 4) S4BAND="$T2";; + *) ;; + esac + else + case $IDX in + 1) S1BAND="$T2 @$T4 MHz";; + 2) S2BAND="$T2 @$T4 MHz";; + 3) S3BAND="$T2 @$T4 MHz";; + 4) S4BAND="$T2 @$T4 MHz";; + *) ;; + esac + fi + + IDX=$((IDX + 1)) + done +fi + +fi + +MODE=$(echo $MODE | sed 's,/,+,'| sed 's,LTE B,LTE | B,') + +if [ "${LAC_DEC}" = "0" ]; then + LAC_DEC="-" + LAC_HEX="-" +fi + +# Modem +GETNFO=$(gcom -d $DEVICE -s /usr/share/3ginfo-lite/vendorproduct.gcom) +FW=$(echo "$GETNFO" | awk -F [:] '/^\+CGMR:/{print $2}' | xargs) + +MVENDOR=$(echo "$GETNFO" | awk -F [:] '/^\+CGMI:/{print $2}' | xargs) +MPRODUCT=$(echo "$GETNFO" | awk -F [:] '/^\+CGMM:/{print $2}' | xargs) +MODEL="$MVENDOR "$MPRODUCT + +# Slot SIM +O=$(sms_tool -d $DEVICE at "AT+QUIMSLOT?") +T=$(echo "$O" | awk -F [:] '/^\+QUIMSLOT/{print $2}' | xargs) +if [ -n "$T" ]; then + SSIM="$T" +fi + +# International Mobile Equipment Identity (IMEI) +NR_I=$(echo "$GETNFO" | awk -F [:] '/^\+CGSN:/{print $2}' | xargs) +if [ -n "$NR_I" ]; then + NR_IMEI="$NR_I" +fi + +# International Mobile Subscriber Identity (IMSI) +NR_C=$(echo "$GETNFO" | awk -F [:] '/^\+CIMI:/{print $2}' | xargs) +if [ -n "$NR_C" ]; then + NR_IMSI="$NR_C" +fi + +# Integrated Circuit Card Identifier (ICCID) +NR_D=$(echo "$GETNFO" | awk -F [:] '/^\+ICCID: /{print $2}' | xargs) +if [ -n "$NR_D" ]; then + NR_ICCID="$NR_D" +fi + +# Protocol +# DRIVER=QMI_WWAN & DRIVER=CDC_MBIM & DRIVER=CDC_ETHER +PV=$(cat /sys/kernel/debug/usb/devices 2>/dev/null) +PVCUT=$(echo $PV | awk -F 'Vendor=2c7c ProdID=0801' '{print $2}' | cut -c-1290) +if echo "$PVCUT" | grep -q "Driver=qmi_wwan" +then + PROTO="qmi" +elif echo "$PVCUT" | grep -q "Driver=cdc_mbim" +then + PROTO="mbim" +elif echo "$PVCUT" | grep -q "Driver=cdc_ether" +then + PROTO="ecm" +fi 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 c92f8b92..59ee1a30 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 @@ -38,19 +38,18 @@ fi case "$MODE_NUM" in 7*) - if echo "$O" | grep -q -i "+QCAINFO.*SCC"; then - MODE="LTE-A |" - fi + MODE="LTE |" + echo "$O" | grep -q -i "+QCAINFO.*SCC" && MODE="LTE_A" ;; 11*) MODE="5G SA |" ;; 13*) + MODE="LTE |" if echo "$O" | grep -q -i "+QCAINFO.*NR5G"; then MODE="5G NSA |" else if echo "$O" | grep -q -i "+QCAINFO.*PCC.*LTE"; then - MODE="LTE |" OTS=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $18}' | awk '{printf "%.0f\n", 0.2*$1*10 - 20}') SINR=$OTS @@ -81,6 +80,10 @@ 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})" @@ -95,6 +98,10 @@ 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})" @@ -102,6 +109,23 @@ if [ -n "$T" ]; then esac done fi +else + case "$MODE_NUM" in + 7 | 13) + T=$(echo "$O" | awk -F[,:] '/^\+QNWINFO:.*LTE.*/{print $4}') + if [ -n "$T" ]; then + B=$(echo $T | sed 's/"LTE BAND \(.*\)"/\1/') + MODE="$MODE $(band4g ${B})" + fi + ;; + 11*) + T=$(echo "$O" | awk -F[,:] '/^\+QNWINFO:.*NR5G.*/{print $4}') + if [ -n "$T" ]; then + B=$(echo $T | sed 's/"NR5G BAND \(.*\)"/\1/') + MODE="$MODE $(band5g ${B})" + fi + ;; + esac fi if [ "x$MODE_NUM" = "x7" ]; then 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 089be1cb..dc4e2161 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 @@ -36,19 +36,18 @@ fi case "$MODE_NUM" in 7*) - if echo "$O" | grep -q -i "+QCAINFO.*SCC"; then - MODE="LTE-A |" - fi + MODE="LTE |" + echo "$O" | grep -q -i "+QCAINFO.*SCC" && MODE="LTE_A" ;; 11*) MODE="5G SA |" ;; 13*) + MODE="LTE |" if echo "$O" | grep -q -i "+QCAINFO.*NR5G"; then MODE="5G NSA |" else if echo "$O" | grep -q -i "+QCAINFO.*PCC.*LTE"; then - MODE="LTE |" OTS=$(echo "$O" | awk -F[,:] '/^\+QENG:/ {print $18}' | awk '{printf "%.0f\n", 0.2*$1*10 - 20}') SINR=$OTS @@ -79,6 +78,10 @@ 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})" @@ -93,6 +96,10 @@ 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})" @@ -100,6 +107,23 @@ if [ -n "$T" ]; then esac done fi +else + case "$MODE_NUM" in + 7 | 13) + T=$(echo "$O" | awk -F[,:] '/^\+QNWINFO:.*LTE.*/{print $4}') + if [ -n "$T" ]; then + B=$(echo $T | sed 's/"LTE BAND \(.*\)"/\1/') + MODE="$MODE $(band4g ${B})" + fi + ;; + 11*) + T=$(echo "$O" | awk -F[,:] '/^\+QNWINFO:.*NR5G.*/{print $4}') + if [ -n "$T" ]; then + B=$(echo $T | sed 's/"NR5G BAND \(.*\)"/\1/') + MODE="$MODE $(band5g ${B})" + fi + ;; + esac fi if [ "x$MODE_NUM" = "x7" ]; then @@ -452,15 +476,17 @@ MODE=$(echo $MODE | sed 's,/,+,'| sed 's,LTE B,LTE | B,') if [ "${LAC_DEC}" = "0" ]; then LAC_DEC="-" LAC_HEX="-" -fi +fi # Modem -GETNFO=$(gcom -d $DEVICE -s /usr/share/3ginfo-lite/vendorproduct.gcom) -FW=$(echo "$GETNFO" | awk -F [:] '/^\+CGMR:/{print $2}' | xargs) +FWA=$(sms_tool -d $DEVICE at "AT+GMR" | tr -s "\n" | xargs) +FW=$(echo $FWA | sed s/"AT+GMR "//) -MVENDOR=$(echo "$GETNFO" | awk -F [:] '/^\+CGMI:/{print $2}' | xargs) -MPRODUCT=$(echo "$GETNFO" | awk -F [:] '/^\+CGMM:/{print $2}' | xargs) -MODEL="$MVENDOR "$MPRODUCT +MODELA=$(sms_tool -d $DEVICE at "AT+CGMM" | tr -s "\n" | xargs) +MODELB=$(sms_tool -d $DEVICE at "AT+CGMI" | tr -s "\n" | xargs) +MODELACUT=$(echo $MODELA | sed s/"AT+CGMM "//) +MODELBCUT=$(echo $MODELB | sed s/"AT+CGMI "//) +MODEL="$MODELBCUT "$MODELACUT # Slot SIM O=$(sms_tool -d $DEVICE at "AT+QUIMSLOT?") @@ -470,19 +496,22 @@ if [ -n "$T" ]; then fi # International Mobile Equipment Identity (IMEI) -NR_I=$(echo "$GETNFO" | awk -F [:] '/^\+CGSN:/{print $2}' | xargs) +O=$(sms_tool -d $DEVICE at "AT+GSN" | xargs) +NR_I=$(echo "$O" | sed s/"AT+GSN "//) if [ -n "$NR_I" ]; then NR_IMEI="$NR_I" fi # International Mobile Subscriber Identity (IMSI) -NR_C=$(echo "$GETNFO" | awk -F [:] '/^\+CIMI:/{print $2}' | xargs) +O=$(sms_tool -d $DEVICE at "AT+CIMI" | xargs) +NR_C=$(echo "$O" | sed s/"AT+CIMI "//) if [ -n "$NR_C" ]; then NR_IMSI="$NR_C" fi # Integrated Circuit Card Identifier (ICCID) -NR_D=$(echo "$GETNFO" | awk -F [:] '/^\+ICCID: /{print $2}' | xargs) +O=$(sms_tool -d $DEVICE at "AT+QCCID") +NR_D=$(echo "$O" | awk -F [:] '/^\+QCCID/{print $2}' | xargs) if [ -n "$NR_D" ]; then NR_ICCID="$NR_D" fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2cb70007 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2cb70007 new file mode 100644 index 00000000..9fed40d9 --- /dev/null +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/2cb70007 @@ -0,0 +1,293 @@ +# Fibocom L850-GL + +convertchannel() { + if [ $1 -ge 0 ] && [ $1 -le 599 ]; then + newband=1 + elif [ $1 -ge 600 ] && [ $1 -le 1199 ]; then + newband=2 + elif [ $1 -ge 1200 ] && [ $1 -le 1949 ]; then + newband=3 + elif [ $1 -ge 1950] && [ $1 -le 2399 ]; then + newband=4 + elif [ $1 -ge 2400] && [ $1 -le 2469 ]; then + newband=5 + elif [ $1 -ge 2750 ] && [ $1 -le 3449 ]; then + newband=7 + elif [ $1 -ge 3450 ] && [ $1 -le 3799 ]; then + newband=8 + elif [ $1 -ge 6150 ] && [ $1 -le 6449 ]; then + newband=20 + elif [ $1 -ge 9210 ] && [ $1 -le 9659 ]; then + newband=28 + elif [ $1 -ge 9870 ] && [ $1 -le 9919 ]; then + newband=31 + elif [ $1 -ge 37750 ] && [ $1 -le 38249 ]; then + newband=38 + elif [ $1 -ge 38650 ] && [ $1 -le 39649 ]; then + newband=40 + else + newband=0 + fi +} + +O=$(sms_tool -d $DEVICE at "at+xlec?;+rsrp?;+rsrq?;+xmci=1") + +T=$(echo "$O" | awk -F [:_] '/\+XLEC:/{gsub("\r",""); print $4}' | awk -F [:,] '{print $1}') +if [ -n "$T" ]; then + case $T in + *"1"*) MODE="${MODE} "$(band4g 1 "");; + *"2"*) MODE="${MODE} "$(band4g 2 "");; + *"3"*) MODE="${MODE} "$(band4g 3 "");; + *"4"*) MODE="${MODE} "$(band4g 4 "");; + *"5"*) MODE="${MODE} "$(band4g 5 "");; + *"7"*) MODE="${MODE} "$(band4g 7 "");; + *"8"*) MODE="${MODE} "$(band4g 8 "");; + *"12"*) MODE="${MODE} "$(band4g 12 "");; + *"13"*) MODE="${MODE} "$(band4g 13 "");; + *"14"*) MODE="${MODE} "$(band4g 14 "");; + *"17"*) MODE="${MODE} "$(band4g 17 "");; + *"18"*) MODE="${MODE} "$(band4g 18 "");; + *"19"*) MODE="${MODE} "$(band4g 19 "");; + *"20"*) MODE="${MODE} "$(band4g 20 "");; + *"21"*) MODE="${MODE} "$(band4g 21 "");; + *"25"*) MODE="${MODE} "$(band4g 25 "");; + *"26"*) MODE="${MODE} "$(band4g 26 "");; + *"28"*) MODE="${MODE} "$(band4g 28 "");; + *"29"*) MODE="${MODE} "$(band4g 29 "");; + *"30"*) MODE="${MODE} "$(band4g 30 "");; + *"32"*) MODE="${MODE} "$(band4g 32 "");; + *"34"*) MODE="${MODE} "$(band4g 34 "");; + *"38"*) MODE="${MODE} "$(band4g 38 "");; + *"39"*) MODE="${MODE} "$(band4g 39 "");; + *"40"*) MODE="${MODE} "$(band4g 40 "");; + *"41"*) MODE="${MODE} "$(band4g 41 "");; + *"42"*) MODE="${MODE} "$(band4g 42 "");; + *"43"*) MODE="${MODE} "$(band4g 43 "");; + *"46"*) MODE="${MODE} "$(band4g 46 "");; + *"48"*) MODE="${MODE} "$(band4g 48 "");; + *"66"*) MODE="${MODE} "$(band4g 66 "");; + *"71"*) MODE="${MODE} "$(band4g 71 "");; + *) MODE="${MODE} ${T}";; + esac +fi + +RSRP=$(echo "$O" | awk -F [:,] '/\+RSRP:/{printf "%.0f\n", $4}') + +BWDL=$(echo "$O" | awk -F [:,] '/\+XLEC:/{gsub("\r","",$4); print $4}') + case $BWDL in + 1) NP=15 ;; + 2) NP=25 ;; + 3) NP=50 ;; + 4) NP=75 ;; + 5) NP=100 ;; + *) NP=0 ;; + esac + +CSQ=$(echo $RSRP $NP | awk '{printf "%.0f\n", (($1+10*log(12*$2)/log(10))+113)/2}') +[ "x$CSQ" = "x" ] && CSQ=-1 +if [ $CSQ -ge 0 -a $CSQ -le 31 ]; then + CSQ_PER=$(($CSQ * 100/31)) + RSSI=$((2 * CSQ - 113)) + # Fibocom RSSI up -51dBm. Thanks to TSA74 at 4pda.to +elif [ $CSQ -ge 32 -a $CSQ -le 50 ]; then + RSSI=$((2 * CSQ - 113)) + CSQ_PER="100" + CSQ="31" +else + CSQ_PER="0" +fi + +RSRQ=$(echo "$O" | awk -F [:,] '/\+RSRQ:/{printf "%.0f\n", $4}') +SINR=$(echo "$O" | awk -F [:,] '/\+XMCI: 4/{gsub(/"/,""); printf "%.0f\n", $13/4+5}') + +LTE_Cx=$(echo "$O" | awk -F [:,] '/\+XLEC:/{print $3}') +LTE_CA=$(($LTE_Cx -1)) + +if [ -n "LTE_CA" ]; then + +case $LTE_CA in + 1*) + CAx=$(echo "$O" | awk -F [:,] '/\+RSRP:/{print $6}') + BWCx=$(echo "$O" | awk -F [:,] '/\+XLEC:/{gsub("\r",""); print $4" "$5}') + ;; + 2*) + CAx=$(echo "$O" | awk -F [:,] '/\+RSRP:/{print $6" "$9}') + BWCx=$(echo "$O" | awk -F [:,] '/\+XLEC:/{gsub("\r",""); print $4" "$5" "$6}');; + 3*) + CAx=$(echo "$O" | awk -F [:,] '/\+RSRP:/{print $6" "$9" "$12}') + BWCx=$(echo "$O" | awk -F [:,] '/\+XLEC:/{gsub("\r",""); print $4" "$5" "$6" "$7}') + ;; + 4*) + CAx=$(echo "$O" | awk -F [:,] '/\+RSRP:/{print $6" "$9" "$12" "$15}') + BWCx=$(echo "$O" | awk -F [:,] '/\+XLEC:/{gsub("\r",""); print $4" "$5" "$6" "$7" "$8}') + ;; +esac + +CA_BAND="" +for sca in $CAx; do + convertchannel $sca 2> /dev/null + BAND="$(band4g $newband "")" + CA_BAND=$CA_BAND' / '$BAND + CABANDx=$CABANDx','$newband +done +MODE="LTE-A | $(band4g $T "")${CA_BAND}" + +S1=$(echo "$CABANDx" | awk -F [,] '/\,/{print $2" "}' | sed 's/ //g') +S2=$(echo "$CABANDx" | awk -F [,] '/\,/{print $3" "}' | sed 's/ //g') +S3=$(echo "$CABANDx" | awk -F [,] '/\,/{print $4" "}' | sed 's/ //g') +S4=$(echo "$CABANDx" | awk -F [,] '/\,/{print $5" "}' | sed 's/ //g') + +BWCA=0 +BWCA_INFO="" +for T3 in $BWCx; do + case $T3 in + 1*) T5="3";; + 2*) T5="5";; + 3*) T5="10";; + 4*) T5="15";; + 5*) T5="20";; + *) T5="0";; + esac +BWCA=$(($BWCA+$T5)) +[[ -z ${BWCA_INFO} ]] && BWCA_INFO="${T5}" || BWCA_INFO="${BWCA_INFO},${T5}" +done + +BW1=$(echo "$BWCA_INFO" | awk -F [,] '/\,/{print $2" "}') +BW2=$(echo "$BWCA_INFO" | awk -F [,] '/\,/{print $3" "}') +BW3=$(echo "$BWCA_INFO" | awk -F [,] '/\,/{print $4" "}') +BW4=$(echo "$BWCA_INFO" | awk -F [,] '/\,/{print $5" "}') + +T2=$(echo "$O" | awk -F [:,] '/\+XLEC:/{gsub("\r",""); print $4" "}') + case $T2 in + 1*) T4="3";; + 2*) T4="5";; + 3*) T4="10";; + 4*) T4="15";; + 5*) T4="20";; + *) T4="0";; + esac + + if [ -n "$T4" ]; then + PBAND="$(band4g $T "") @$T4 MHz" + PCI=$(echo "$O" | awk -F[,:] '/^\+RSRP:/ {print $2}') + EARFCN=$(echo "$O" | awk -F[,:] '/^\+RSRP:/ {print $3}') + fi + +if [ -n "$S1" ]; then +S1BAND="$(band4g $S1 "") @$BW1 MHz" +S1PCI=$(echo "$O" | awk -F[,:] '/^\+RSRP:/ {print $5}') +S1EARFCN=$(echo "$O" | awk -F[,:] '/^\+RSRP:/ {print $6}') +fi +if [ -n "$S2" ]; then +S2BAND="$(band4g $S2 "") @$BW2 MHz" +S2PCI=$(echo "$O" | awk -F[,:] '/^\+RSRP:/ {print $8}') +S2EARFCN=$(echo "$O" | awk -F[,:] '/^\+RSRP:/ {print $9}') +fi +if [ -n "$S3" ]; then +S3BAND="$(band4g $S3 "") @$BW3 MHz" +S3PCI=$(echo "$O" | awk -F[,:] '/^\+RSRP:/ {print $11}') +S3EARFCN=$(echo "$O" | awk -F[,:] '/^\+RSRP:/ {print $12}') +fi +if [ -n "$S4" ]; then +S4BAND="$(band4g $S4 "") @$BW4 MHz" +S4PCI=$(echo "$O" | awk -F[,:] '/^\+RSRP:/ {print $14}') +S4EARFCN=$(echo "$O" | awk -F[,:] '/^\+RSRP:/ {print $15}') +fi + + +fi + +if [[ "$MODE" != *"LTE-A"* ]]; then + if [ -n "$T" ]; then + MODE="LTE | $(band4g $T "")" + + T2=$(echo "$O" | awk -F [:,] '/\+XLEC:/{gsub("\r",""); print $4" "}') + case $T2 in + 1*) T4="3";; + 2*) T4="5";; + 3*) T4="10";; + 4*) T4="15";; + 5*) T4="20";; + *) T4="0";; + esac + + if [ -n "$T4" ]; then + PBAND="$(band4g $T "") @$T4 MHz" + PCI=$(echo "$O" | awk -F[,:] '/^\+RSRP:/ {print $2}') + EARFCN=$(echo "$O" | awk -F[,:] '/^\+RSRP:/ {print $3}') + fi + fi +fi + +MODE=$(echo $MODE | sed 's,/,+,') + +OT=$(sms_tool -d $DEVICE at "AT+XCCINFO=1;+XCCINFO?") +if [ -n "$OT" ]; then + T=$(echo "$OT" | awk -F[,:] '/^\+XCCINFO:/{print $11}' | xargs) + if [ -n "$T" ]; then + T_DEC=$(printf "%d" "0x$T") + fi + if [ -z "$T_HEX" ]; then + [ -n "$T_DEC" ] && T_HEX=$(printf %0X $T_DEC) + fi +fi + +if [ "$REG" == "6" ]; then +REG="1" +fi + +# Modem +FWA=$(sms_tool -d $DEVICE at "AT+GTPKGVER?" | xargs) +FW=$(echo "$FWA" | cut -d ":" -f2 | xargs) + +MDL=$(sms_tool -d $DEVICE at "AT+GMM?" | xargs) +MODELM=$(echo $MDL | awk -F [:] '/^\+GMM: /{print $2}'| awk -F 'LTE Module' '{print $1}' | xargs) +MODELF=$(sms_tool -d $DEVICE at "AT+CGMI" | xargs) + +MODELMCUT=$(echo $MODELM) +MODELFCUT=$(echo $MODELF | awk -F [:] '/^\+CGMI:/{print $2}' | xargs) +MODEL="$MODELFCUT "$MODELMCUT + +# International Mobile Equipment Identity (IMEI) +O=$(sms_tool -d $DEVICE at "AT+CGSN" | xargs) +NR_I=$(echo "$O" | sed s/"AT+CGSN "//) +if [ -n "$NR_I" ]; then + NR_IMEI="$NR_I" +fi + +# International Mobile Subscriber Identity (IMSI) +O=$(sms_tool -d $DEVICE at "AT+CIMI" | xargs) +NR_C=$(echo "$O" | sed s/"AT+CIMI "//) +if [ -n "$NR_C" ]; then + NR_IMSI="$NR_C" +fi + +# Integrated Circuit Card Identifier (ICCID) +O=$(sms_tool -d $DEVICE at "AT+CCID") +NR_D=$(echo "$O" | awk -F [:] '/^\+CCID: /{print $2}' | xargs) +if [ -n "$NR_D" ]; then + NR_ICCID="$NR_D" +fi + +# Protocol +# DRIVER=QMI_WWAN & DRIVER=CDC_MBIM & DRIVER=CDC_ETHER +PV=$(cat /sys/kernel/debug/usb/devices 2>/dev/null) +PVCAX=$(echo $PV | awk -F"Vendor=2cb7 ProdID=0007" '{print $2}') +PVCA=$(echo "$PVCAX" | cut -c-2453) + +if [ -n "$PVCA" ]; then + case $PVCA in + *"Driver=qmi_wwan"*) + PROTO="qmi" + ;; + *"Driver=cdc_ncm"*) + PROTO="ncm" + ;; + *"Driver=cdc_mbim"*) + PROTO="mbim" + ;; + *"Driver=cdc_ether"*) + PROTO="ecm" + ;; + esac +fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/808707f9 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/808707f9 index 56533af3..b8d59deb 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/808707f9 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/808707f9 @@ -71,7 +71,9 @@ if [ "x$MODE_NUM" = "x7" ]; then BWS4="" CELLS=$(echo "$O" | awk -F[,:] '/^\+XLEC:/{print $3}') + [ -z "$CELLS" ] && CELLS=0 case $CELLS in + "1") T=$(echo "$O" | awk -F[,:] '/^\+XLEC:/{print $4}') BWP=$(bandwidth "$T") @@ -308,8 +310,11 @@ if [ "x$MODE_NUM" = "x7" ]; then fi T=$(echo "$O" | awk -F[,:] '/^\+XMCI: 4/{print $12}') [ "$T" != "255" ] && RSRQ="$((-20 + T/2))" + # SNR # T=$(echo "$O" | awk -F[,:] '/^\+XMCI: 4/{print $13}') -# [ "$T" != "255" ] && addon 38 "SNR" "$T dB" +# [ "$T" != "255" ] && SNR="$T" + # SINR + SINR=$(echo "$O" | awk -F [:,] '/\+XMCI: 4/{gsub(/"/,""); printf "%.0f\n", $13/4+5}') fi IFS=" @@ -397,7 +402,8 @@ IFS=" # T=$(echo "$LINE" | awk -F[,:] '/^\+XMCI: 4/{print $13}') # [ "$T" != "255" ] && addon $((POS + 8)) "(S${IDX}) SNR" "$T dB" IDX=$((IDX + 1)) - + [ $IDX -ge $CELLS ] && break + POS=$((POS + 10)) fi done fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/8087095a b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/8087095a index 56533af3..b8d59deb 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/8087095a +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/usb/8087095a @@ -71,7 +71,9 @@ if [ "x$MODE_NUM" = "x7" ]; then BWS4="" CELLS=$(echo "$O" | awk -F[,:] '/^\+XLEC:/{print $3}') + [ -z "$CELLS" ] && CELLS=0 case $CELLS in + "1") T=$(echo "$O" | awk -F[,:] '/^\+XLEC:/{print $4}') BWP=$(bandwidth "$T") @@ -308,8 +310,11 @@ if [ "x$MODE_NUM" = "x7" ]; then fi T=$(echo "$O" | awk -F[,:] '/^\+XMCI: 4/{print $12}') [ "$T" != "255" ] && RSRQ="$((-20 + T/2))" + # SNR # T=$(echo "$O" | awk -F[,:] '/^\+XMCI: 4/{print $13}') -# [ "$T" != "255" ] && addon 38 "SNR" "$T dB" +# [ "$T" != "255" ] && SNR="$T" + # SINR + SINR=$(echo "$O" | awk -F [:,] '/\+XMCI: 4/{gsub(/"/,""); printf "%.0f\n", $13/4+5}') fi IFS=" @@ -397,7 +402,8 @@ IFS=" # T=$(echo "$LINE" | awk -F[,:] '/^\+XMCI: 4/{print $13}') # [ "$T" != "255" ] && addon $((POS + 8)) "(S${IDX}) SNR" "$T dB" IDX=$((IDX + 1)) - + [ $IDX -ge $CELLS ] && break + POS=$((POS + 10)) fi done fi diff --git a/luci-app-3ginfo-lite/root/usr/share/rpcd/acl.d/luci-app-3ginfo-lite.json b/luci-app-3ginfo-lite/root/usr/share/rpcd/acl.d/luci-app-3ginfo-lite.json index 28ebbd37..2b1493de 100644 --- a/luci-app-3ginfo-lite/root/usr/share/rpcd/acl.d/luci-app-3ginfo-lite.json +++ b/luci-app-3ginfo-lite/root/usr/share/rpcd/acl.d/luci-app-3ginfo-lite.json @@ -12,7 +12,7 @@ "/etc/3ginfo": [ "read" ], "/sys/kernel/debug/usb/devices": [ "read" ] }, - "uci": [ "3ginfo", "luci-app-3ginfo-lite" ] + "uci": [ "3ginfo" ] }, "write": { "file": { @@ -23,7 +23,7 @@ "/tmp/debug_result.txt": [ "write" ], "/etc/3ginfo": [ "write" ] }, - "uci": [ "3ginfo", "luci-app-3ginfo-lite" ] + "uci": [ "3ginfo" ] } } }