Skip to content

Commit

Permalink
Up to 1.0.28-20221017
Browse files Browse the repository at this point in the history
Update for ZTE MF286R & Huawei E3372 / E3276
  • Loading branch information
4IceG authored Oct 17, 2022
1 parent 623c9fb commit 3575b94
Show file tree
Hide file tree
Showing 9 changed files with 247 additions and 41 deletions.
8 changes: 7 additions & 1 deletion luci-app-3ginfo-lite/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ PKG_NAME:=luci-app-3ginfo-lite
LUCI_TITLE:=LuCI panel for 3ginfo-lite
LUCI_PKGARCH:=all
LUCI_DEPENDS:=+sms-tool +comgt
PKG_VERSION:=1.0.27-20221008
PKG_VERSION:=1.0.28-20221017

include $(TOPDIR)/feeds/luci/luci.mk

define Package/luci-app-3ginfo-lite/description
LuCI panel for 3ginfo-lite
The package allows visualization of the parameters of a
mobile Internet connection.
endef

$(eval $(call BuildPackage,$(PKG_NAME)))

# call BuildPackage - OpenWrt buildroot signature
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ return view.extend({
if (json.registration == '0') {
view.textContent = _('Not registered');
}
if (json.registration == '1') {
if (json.registration == '1' || json.registration == '6') {
view.textContent = _('Registered');
}
if (json.registration == '2') {
Expand All @@ -325,6 +325,9 @@ return view.extend({
if (json.registration == '3') {
view.textContent = _('Registering denied');
}
if (json.registration == '5' || json.registration == '7') {
view.textContent = _('Registered (roaming)');
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions luci-app-3ginfo-lite/po/pl/3ginfo.po
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ msgstr "Nie zalogowana do sieci"
msgid "Registered"
msgstr "Zalogowana do sieci"

msgid "Registered (roaming)"
msgstr "Zalogowana do sieci (roaming)"

msgid "Searching.."
msgstr "Wyszukiwanie.."

Expand Down
32 changes: 31 additions & 1 deletion luci-app-3ginfo-lite/root/etc/uci-defaults/set_3ginfo_port.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# Copyright 2020-2021 Rafał Wabik (IceG) - From eko.one.pl forum
# Copyright 2020-2022 Rafał Wabik (IceG) - From eko.one.pl forum
# MIT License

chmod +x /usr/share/3ginfo-lite/3ginfo.sh
Expand Down Expand Up @@ -27,3 +27,33 @@ if [ $work != false ]; then
uci set 3ginfo.@3ginfo[0].device=$work
uci commit 3ginfo
fi

DEVICE=$(cat /tmp/sysinfo/board_name)

if [[ "$DEVICE" == *"mf289f"* ]]; then

uci set 3ginfo.@3ginfo[0].device="/dev/ttyUSB1"
uci commit 3ginfo

fi

if [[ "$DEVICE" == *"mf286r"* ]]; then

uci set 3ginfo.@3ginfo[0].device="/dev/ttyACM0"
uci commit 3ginfo

fi

if [[ "$DEVICE" == *"mf286d"* ]]; then

uci set 3ginfo.@3ginfo[0].device="/dev/ttyUSB1"
uci commit 3ginfo

fi

if [[ "$DEVICE" == *"mf286"* ]]; then

uci set 3ginfo.@3ginfo[0].device="/dev/ttyUSB1"
uci commit 3ginfo

fi
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,50 @@ then
PROTO="ncm"
fi

# International Mobile Equipment Identity (IMEI)
O=$(sms_tool -d $DEVICE at "AT+GSN" | xargs)
NR_I=$(echo "$O" | sed 's/AT+GSN//g' | xargs)
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//g' | xargs)
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

# DL / UL / Band
OTB=$(sms_tool -d $DEVICE at "AT^HFREQINFO?")
TBX=$(echo "$OTB" | awk -F [:] '/^\^HFREQINFO:/{print $2}' | xargs)
TB=$(echo "$TBX" | cut -d ',' -f3-3 )

TDL=$(echo "$TBX" | cut -d ',' -f6-6 )
DL=$(($TDL/1000))

TUL=$(echo "$TBX" | cut -d ',' -f9-9 )
UL=$(($TUL/1000))

ULBW="UL: @$UL MHz"
DLBW="DL: @$DL MHz"

PBAND="$(band $TB "") $DLBW $ULBW"
EARFCN=$(echo "$TBX" | cut -d ',' -f4-4 )
PCI="-"

# LAC & TAC
T_HEX=$LAC_HEX
T_DEC=$LAC_DEC

# Temperature
T=$(echo "$O" | awk -F[,:] '/^\^CHIPTEMP/ {gsub(/[ \r]/,"");t=0;for(i=2;i<=NF;i++)if($i!=65535){if($i>100){$i=$i/10};if($i>t){t=$i}};printf "%.1f", t}')
if [ "x$T" != "x0.0" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,50 @@ then
PROTO="ncm"
fi

# International Mobile Equipment Identity (IMEI)
O=$(sms_tool -d $DEVICE at "AT+GSN" | xargs)
NR_I=$(echo "$O" | sed 's/AT+GSN//g' | xargs)
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//g' | xargs)
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

# DL / UL / Band
OTB=$(sms_tool -d $DEVICE at "AT^HFREQINFO?")
TBX=$(echo "$OTB" | awk -F [:] '/^\^HFREQINFO:/{print $2}' | xargs)
TB=$(echo "$TBX" | cut -d ',' -f3-3 )

TDL=$(echo "$TBX" | cut -d ',' -f6-6 )
DL=$(($TDL/1000))

TUL=$(echo "$TBX" | cut -d ',' -f9-9 )
UL=$(($TUL/1000))

ULBW="UL: @$UL MHz"
DLBW="DL: @$DL MHz"

PBAND="$(band $TB "") $DLBW $ULBW"
EARFCN=$(echo "$TBX" | cut -d ',' -f4-4 )
PCI="-"

# LAC & TAC
T_HEX=$LAC_HEX
T_DEC=$LAC_DEC

# Temperature
T=$(echo "$O" | awk -F[,:] '/^\^CHIPTEMP/ {gsub(/[ \r]/,"");t=0;for(i=2;i<=NF;i++)if($i!=65535){if($i>100){$i=$i/10};if($i>t){t=$i}};printf "%.1f", t}')
if [ "x$T" != "x0.0" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,50 @@ then
PROTO="ncm"
fi

# International Mobile Equipment Identity (IMEI)
O=$(sms_tool -d $DEVICE at "AT+GSN" | xargs)
NR_I=$(echo "$O" | sed 's/AT+GSN//g' | xargs)
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//g' | xargs)
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

# DL / UL / Band
OTB=$(sms_tool -d $DEVICE at "AT^HFREQINFO?")
TBX=$(echo "$OTB" | awk -F [:] '/^\^HFREQINFO:/{print $2}' | xargs)
TB=$(echo "$TBX" | cut -d ',' -f3-3 )

TDL=$(echo "$TBX" | cut -d ',' -f6-6 )
DL=$(($TDL/1000))

TUL=$(echo "$TBX" | cut -d ',' -f9-9 )
UL=$(($TUL/1000))

ULBW="UL: @$UL MHz"
DLBW="DL: @$DL MHz"

PBAND="$(band $TB "") $DLBW $ULBW"
EARFCN=$(echo "$TBX" | cut -d ',' -f4-4 )
PCI="-"

# LAC & TAC
T_HEX=$LAC_HEX
T_DEC=$LAC_DEC

# Temperature
T=$(echo "$O" | awk -F[,:] '/^\^CHIPTEMP/ {gsub(/[ \r]/,"");t=0;for(i=2;i<=NF;i++)if($i!=65535){if($i>100){$i=$i/10};if($i>t){t=$i}};printf "%.1f", t}')
if [ "x$T" != "x0.0" ]; then
Expand Down
Loading

0 comments on commit 3575b94

Please sign in to comment.