mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 10:31:51 +00:00
Set 4G/5G modems on z8102
This commit is contained in:
parent
fafeaf7502
commit
f8e47a9fc5
1 changed files with 31 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2013 OpenWrt.org
|
||||
# Copyright (C) 2023 Yannick Chabanois (Ycarus) for OpenMPTCProuter
|
||||
# Copyright (C) 2023-2025 Yannick Chabanois (Ycarus) for OpenMPTCProuter
|
||||
|
||||
START=00
|
||||
USE_PROCD=1
|
||||
|
@ -48,7 +48,22 @@ modem1()
|
|||
else
|
||||
gpioset -t0 modem1=1
|
||||
fi
|
||||
if [ -n "$(uci -q get network.modem1)" ] && [ -z "$(uci -q get network.modem1.device)" ]; then
|
||||
sleep 20
|
||||
if [ -e /sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1 ]; then
|
||||
uci -q batch <<-EOF
|
||||
set network.modem1.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1'
|
||||
commit network
|
||||
EOF
|
||||
elif [ -e /sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.1 ]; then
|
||||
uci -q batch <<-EOF
|
||||
set network.modem1.device='/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.1'
|
||||
commit network
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
modem2()
|
||||
{
|
||||
# sim 2
|
||||
|
@ -88,7 +103,22 @@ modem2()
|
|||
else
|
||||
gpioset -t0 modem2=1
|
||||
fi
|
||||
if [ -n "$(uci -q get network.modem2)" ] && [ -z "$(uci -q get network.modem2.device)" ]; then
|
||||
sleep 20
|
||||
if [ -e /sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.2 ]; then
|
||||
uci -q batch <<-EOF
|
||||
set network.modem2.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.2'
|
||||
commit network
|
||||
EOF
|
||||
elif [ -e /sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.2 ]; then
|
||||
uci -q batch <<-EOF
|
||||
set network.modem2.device='/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.2'
|
||||
commit network
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
start_service()
|
||||
{
|
||||
modem="$1"
|
||||
|
|
Loading…
Reference in a new issue