4G模块luci的配置及重连脚本⼀、4G Luci配置
1、新建⼀个wwan接⼝;
2、上⽹⽅式为dhcp⾃动获取;
3、物理设置选择wwan0;
4、防⽕墙选择wan
⼆、重连脚本redial4g
LogFile=/root/4g_Log.log
mdate=`date +%R-%d-%m-%Y`
if [ -e /var/run/udhcpc-wwan0.pid ]; then
echo 4G pid is ok!
#echo $mdate 4G pid is ok! >> $LogFile
#exit 0
el
echo 4G pid is failed!
echo $mdate 4G pid is failed! >> $LogFile
#/etc/myLte/dial4g
#reboot
#exit 0
fi
if ping -c3 > /dev/null2>&1
then
报仇的意思>结婚贺卡祝福语echo ping baidu is ok!
#echo $mdate ping baidu is ok! >> $LogFile
echo0 > /tmp/
exit 0
el
echo ping baidu is failed!
echo $mdate ping baidu is failed! >> $LogFile
/etc/myLte/dial4g #must place here
#read pvar < /tmp/
#if [ -z "$pvar" ] ; then
# pvar=0
#fi
if [ ! -f "/tmp/" ] ; then
pvar=0
echo file not exist
el
read pvar < /tmp/
echo file exist
fi
pvar=`expr $pvar + 1`
echo $pvar > /tmp/
祝大家元宵节快乐if [ $pvar -ge 5 ] ; then
研究生毕业echo failed 5 times!
echo $mdate failed 5 times! >> $LogFile
reboot
fi
fi
exit 0
三、crontab
*/2 * * * * /etc/myLte/redial4g
重连时间不要设太短,太短可能还没拨号结束就⼜进⾏重播,会重复了。
四、拨号脚本dial4g
PORT=/dev/ttyUSB0
MODE="AT+CFUN=1" gcom -d $PORT -s /etc/
sleep3
MODE="AT+COPS=0" gcom -d $PORT -s /etc/
sleep3
MODE="AT+CEREG=1" gcom -d $PORT -s /etc/
sleep3
MODE="AT+CGDCONT=1,'IP'" gcom -d $PORT -s /etc/ sleep3
MODE="AT+CGACT=1,1" gcom -d $PORT -s /etc/ sleep3
梦见给死人烧纸MODE="AT+ZGACT=1,1" gcom -d $PORT -s /etc/ sleep3
ifup wwan &怀孕早期的症状
论据大全exit 0
五、开机启动
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
/etc/myLte/dial4g
exit 0
>沙漠作品