一、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
else
echo 4G pid is failed!
echo $mdate 4G pid is failed! >> $LogFile
#/etc/myLte/dial4g
#reboot
#exit
fi if ping -c3 www.baidu.com > /dev/null >&
then
echo ping baidu is ok!
#echo $mdate ping baidu is ok! >> $LogFile
echo > /tmp/4g_tmp.txt
exit
else
echo ping baidu is failed!
echo $mdate ping baidu is failed! >> $LogFile
/etc/myLte/dial4g #must place here
#read pvar < /tmp/4g_temp.txt
#if [ -z "$pvar" ] ; then
# pvar=
#fi
if [ ! -f "/tmp/4g_tmp.txt" ] ; then
pvar=
echo file not exist
else
read pvar < /tmp/4g_tmp.txt
echo file exist
fi
pvar=`expr $pvar + `
echo $pvar > /tmp/4g_tmp.txt
if [ $pvar -ge ] ; then
echo failed times!
echo $mdate failed times! >> $LogFile
reboot
fi fi
exit

三、crontab

*/2 * * * * /etc/myLte/redial4g

重连时间不要设太短,太短可能还没拨号结束就又进行重播,会重复了。

四、拨号脚本dial4g

PORT=/dev/ttyUSB0
MODE="AT+CFUN=1" gcom -d $PORT -s /etc/gcom/setmode.gcom
sleep
MODE="AT+COPS=0" gcom -d $PORT -s /etc/gcom/setmode.gcom
sleep
MODE="AT+CEREG=1" gcom -d $PORT -s /etc/gcom/setmode.gcom
sleep
MODE="AT+CGDCONT=1,'IP'" gcom -d $PORT -s /etc/gcom/setmode.gcom
sleep
MODE="AT+CGACT=1,1" gcom -d $PORT -s /etc/gcom/setmode.gcom
sleep
MODE="AT+ZGACT=1,1" gcom -d $PORT -s /etc/gcom/setmode.gcom
sleep
ifup wwan &
exit

五、开机启动

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing. /etc/myLte/dial4g exit

4G模块luci的配置及重连脚本的更多相关文章

  1. [nRF51822] 13、浅谈nRF51822和NRF24LE1/NRF24LU1/NRF24L01经典2.4G模块无线通信配置与流程

    前言:  nRF51可以支持基于2.4G的互相通信.与NRF24LE1的通信.与NRF24LU1的通信.与NRF24L01的通信. 一.nRF51822基于2.4G和nRF51822通信 其中nRF5 ...

  2. 【树莓派】树莓派使用4G模块上网

    想了解一下树莓派通过4G网络模块通信如何实现,看到这篇文章(http://www.lxway.com/95811506.htm),准备接下来有机会实践一下,先留存学习: 一.4G Luci配置 1. ...

  3. 嵌入式Linux利用ppp实现4G模块联网

    https://blog.csdn.net/qq361294382/article/details/52136126 https://blog.csdn.net/qq361294382/article ...

  4. 高新兴 ME3630-W 4G 模块 Android 平台适配

    2019-04-26 关键字:高新兴 ME3630-W 适配.rk3128 移植 4G 模块 本篇文章系笔者在移植 高新兴物联 ME3630-W 4G 模块到运行着 Android4.4 操作系统的 ...

  5. 迅为IMX6开发板支持全网通4G模块丨GPS模块丨WIFI蓝牙丨千兆以太网

    迅为i.MX6开发板丨迅为i.MX6Q开发板丨四核imx6开发板丨Cortec-A9开发板丨资料介绍: 特点: 处理器:Freescale Cortex-A9四核i.MX6Q主频1GHz 核心板配置: ...

  6. 嵌入式开发 迅为4418开发板Qt移植移动4G模块第一部分

    本文转自迅为论坛:http://topeetboard.com 了解更多:https://item.taobao.com/item.htm?spm=a1z10.1-c.w4004-7744162139 ...

  7. [转载]迅为4418开发板Qt移植移动4G模块第一部分

        本文转自迅为论坛:http://topeetboard.com   平台:iTOP-4418开发板   1.首先要配置内核,这个一步和Android系统移植3G或者4G模块是一样的.一般模块的 ...

  8. 在ARM-linux上实现4G模块PPP拨号上网【转】

    本文转载自:http://blog.csdn.net/zqixiao_09/article/details/52540887 在ARM平台上实现4G模块的PPP拨号上网,参考网上的资料和自己的理解,从 ...

  9. 什么是4G模块 4G模块的工作原理及特点

    什么是4G模块 4G模块,也被叫做4G通信模块或4G DTU模块,他是物联网行业具有4G通信功能的一种产品,通过4G模块,我们可以实现工业设备数据通过无线4G网络传输到远端控制中心,并从控制中心通过4 ...

随机推荐

  1. ipv6地址管理

    为了彻底解决IPv4存在的问题,国际互联网工程任务组从1995年开始,着手研究开发下一代IP协议,即IPv6.可彻底解决IPv4地址不足的问题,除此之外,IPv6还采用分级地址模式.高效IP包头.主机 ...

  2. ajax异步上传图片(TP5)

    直接上代码 PHP代码如下 /** * 上传 */ public function upload_photo(){ $file = $this->request->file('file') ...

  3. 微软Power BI 每月功能更新系列——5月Power BI 新功能学习

    Power BI Desktop 5月份功能摘要 本月Power BI Desktop除了许多报表功能的更新,Power BI对条件格式进行了重大改进,可以对报表的任何字段(包括字符串和日期)进行条件 ...

  4. lesson5rnns-fastai

    32min 如何确定embedding个数即嵌入矩阵容量?:不确定:与文本的字数关系不大,关键是语言的复杂度和需要解决的问题类型 embedding的效果要比one hot编码的效果好

  5. QuickSort(Java)

    private void quickSort(int[] input, int start, int end) { if (start >= end) return; int index = p ...

  6. poj 2155 B - Matrix 二维树状数组

    #include<iostream> #include<string> #include<string.h> #include<cstdio> usin ...

  7. Python基础-使用paramiko

    一:简介 paramiko是用python语言写的一个模块,遵循SSH2协议,支持以加密和认证的方式,进行远程服务器的连接. 由于使用的是python这样的能够跨平台运行的语言,所以所有python支 ...

  8. hdu4135 Co-prime 容斥原理

    Given a number N, you are asked to count the number of integers between A and B inclusive which are ...

  9. LeetCode - Baseball Game

    You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 ...

  10. react 简书开发笔记

    详见文章<React简书开发实战课程笔记>