Skip to content

Commit

Permalink
Add max_pin_retry option and add mbim-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed May 17, 2024
1 parent 277397f commit 0fc010d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions luci-app-openmptcprouter/root/etc/init.d/openmptcprouter
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ omr_intf_set() {
uci -q delete network.$1.modalias
uci -q delete network.$1.product
fi
uci -q delete network.$1.pin_retry
}

omr_set_settings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ if [ "$(uci -q get openmptcprouter.settings.tracebox)" = "" ]; then
EOF
fi

if [ -z "$(uci -q get openmptcprouter.settings.max_pin_retry)" ]; then
uci -q batch <<-EOF >/dev/null
set openmptcprouter.settings.max_pin_retry='2'
commit openmptcprouter
EOF
fi

_set_omr_ip() {
server=$1
serverip="$(uci -q get openmptcprouter.${server}.ip)"
Expand Down
8 changes: 6 additions & 2 deletions mptcp/files/usr/share/omr/post-tracking.d/001-post-tracking
Original file line number Diff line number Diff line change
Expand Up @@ -784,11 +784,15 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || ([ "$OMR_TRACKER_INTERFACE" != "omrvpn
sleep 30
elif [ "$mm_state" = "locked" ]; then
# Sometimes PIN is not correctly sent to modem
if [ -z "$(uci -q get network.$OMR_TRACKER_INTERFACE.pin_retry)" ]; then
if [ -z "$(uci -q get network.$OMR_TRACKER_INTERFACE.pin_retry)" ] || [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.pin_retry)" -lt "$(uci -q get openmptcprouter.settings.max_pin_retry || echo '2')" ]; then
_log "Interface $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) locked, set PIN"
mmcli -i $(timeout 2 mmcli -m $modem -K | awk '/modem.generic.sim / {print $3}') --pin=$(uci -q get network.$OMR_TRACKER_INTERFACE.pincode)
sleep 30
uci -q set network.$OMR_TRACKER_INTERFACE.pin_retry=1
if [ -z "$(uci -q get network.$OMR_TRACKER_INTERFACE.pin_retry)" ]; then
uci -q set network.$OMR_TRACKER_INTERFACE.pin_retry=1
else
uci -q set network.$OMR_TRACKER_INTERFACE.pin_retry=$(($(uci -q get network.$OMR_TRACKER_INTERFACE.pin_retry) + 1))
fi
fi
fi
fi
Expand Down
3 changes: 2 additions & 1 deletion openmptcprouter-full/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ MY_DEPENDS := \
xray-core LINUX_5_4:xray-config !LINUX_5_4:xray-config-nft (LINUX_5_4&&(TARGET_x86_64||aarch64)):kmod-tcp-bbr2 kmod-ovpn-dco-v2 \
shadowsocks-rust-sslocal shadowsocks-rust-ssservice LINUX_5_4:shadowsocks-rust-config !LINUX_5_4:shadowsocks-rust-config-nft luci-app-shadowsocks-rust \
luci-proto-external omr-schedule jq luci-app-ddns \
LINUX_6_6:mptcp-bpf-burst LINUX_6_6:mptcp-bpf-first LINUX_6_6:mptcp-bpf-red LINUX_6_6:mptcp-bpf-rr LINUX_6_6:bpftool-full
LINUX_6_6:mptcp-bpf-burst LINUX_6_6:mptcp-bpf-first LINUX_6_6:mptcp-bpf-red LINUX_6_6:mptcp-bpf-rr LINUX_6_6:bpftool-full \
mbim-utils

# !TARGET_ipq40xx:kmod-rt2800-usb (TARGET_x86||TARGET_x86_64):kmod-iwlwifi (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl1000 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl100 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl105 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl135 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl2000 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl2030 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl3160 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl3168 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl5000 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl5150 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl6000g2 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl6000g2a (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl6000g2b (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl6050 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl7260 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl7265 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl7265d (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl8260c (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl8265 \
# !TARGET_ipq40xx:kmod-rtl8xxxu !TARGET_ipq40xx:kmod-rtl8192cu !TARGET_ipq40xx:kmod-net-rtl8192su !LINUX_6_1:kmod-rtl8812au-ct (TARGET_x86||TARGET_x86_64):kmod-r8169 (TARGET_x86||TARGET_x86_64):kmod-8139too (TARGET_x86||TARGET_x86_64):kmod-r8125 !TARGET_ipq40xx:kmod-rtl8187 kmod-rtl8xxxu (TARGET_x86||TARGET_x86_64):rtl8192eu-firmware
Expand Down

0 comments on commit 0fc010d

Please sign in to comment.