当前位置:网站首页>上海域格ASR CAT1 4g模块2路保活低功耗4G应用
上海域格ASR CAT1 4g模块2路保活低功耗4G应用
2022-06-28 05:29:00 【hhl_48384104】
上海域格ASR CAT1 4g模块2路保活低功耗4G应用
主控有操作系统,如户外摄像头等,有远程唤醒需求,使用usb 虚拟出来的网卡上网。操作系统一般使用linux 或者liteos,支持rndis 或者ECM 网卡。
2路保活主要用于连接双平台,支持2个应用接入
实例: liteos + ecm网卡 + 指定内容唤醒 + 1路保活tcp连百度服务器
1.驱动支持
修改主控驱动支持TTYUSB,使用TTYUSB1 作为AT 口
2.休眠
初始化指令: AT+YGFEATURECFG=128,0 //只需设置一次即可
AT+CFUN=1,1 //重启生效
AT+YGFEATURECFG? //确认 sleep8 是否为“1”

① 开启需发送AT^GPIOWAKE=1(重启生效,仅需设置一次)
② 设置休眠参数,如 AT+ENTERSLEEPHEX=1 设为 HEX,默认为 1,实际发送给服务器会转换成原始数据(0为原始数据,有特殊字符时建议 HEX 模式)
③ 设置服务器、心跳包、唤醒包信息,如服务器地址 192.168.0.100,服务器端口号12346,心跳间隔 180,心跳包发“sleep12345” ,唤醒包发“wake123”,
登录包为“login” 、应答包为“ok” 、心跳包回复“data” (任意数据唤醒,唤醒
包可设置为空“” ;无登录包以及应答包可将登录包以及应答包设置为空“” )
AT+ENTERSLEEPHEX=1时可设置以下:
AT+ENTERSLEEP=“192.168.0.100”,12346,180,“736c6565703132333435”,“77616B65313233”,“6c6f67696e”,“6f6b”,“64617461”
AT+ENTERSLEEPHEX=0时可设置以下:
AT+ENTERSLEEP=“192.168.0.100”,12346,180,“sleep12345”,“wake123”,“login”,“ok”,“data”)
AT+ENTERSLEEP参数说明:
AT+ENTERSLEEP=<server_ip>,<server_port>,<in_t erval>,<heartbeat_data>,<wakeup_data>,<auth_data>,<auth_resp>, <heartbeat_resp>
<server_ip>:服务器地址;
<server_port>:服务器端口号;
<in_terval>:心跳间隔时间(1-21600)秒;
<heartbeat_data>:心跳包, (范围:1-512字节)
<wakeup_data>:唤醒包, (范围:1-512字节)
<auth_data>:登录包, (范围:1-1024字节)
<auth_resp>:应答包, (范围:1-32字节)
<heartbeat_resp>:心跳包回复头, (范围:1-32字节)
④设置登录包、应答包、USB断开方式、连接重试次数及发送重试次数(若
AT+ENTERSLEEP设置了登录包、应答包,会被 AT+ENTERSLEEPCFG 设置的所覆盖。如果不需要设置 USB 断开方式及重试次数,该步骤可跳过。USB 断开方式固定为 1,表示由模块主动断开 USB;连接重试次数默认为 3;发送重试次数默认为3)。
如AT+ENTERSLEEPCFG=“6c6f67696e”,“6f6b”,1,3,2//登录包为
“6c6f67696e” 、应答包为“6f6b” 、USB断开方式固定为 1 表示由模块主动断开 USB、连接重试次数 3、发送重试次数为 2。
AT+ENTERSLEEPcfg=“6c6f67696e”,“6f6b”,1,3,2
⑤ 主控进入休眠前发送 AT+ENTERSLEEP指令并拉高WAKEUP_IN
模块建立与服务器的tcp连接,此时服务器会收到指令设置的登录包,服务器需 10s内回复应答包, 如示例中模块发送登录包login, 服务器 10s内需要返回应答包ok,若设置登录包和应答包为空,模块连接服务器时服务器会收到心跳包,服务器10s内也需要返回应答 ok响应,之后模块拉低 RI脚进入休眠。
3.心跳
模块根据设置的参数,周期发送心跳给服务器,维持tcp 的长连接
4.唤醒
4.1 网络唤醒包触发唤醒
4.1.1 手机等app 发送唤醒信号给服务器,服务器发送唤醒包给指定设备
4.1.2 模块收到数据时断开与服务器的连接,恢复usb,RI 脚输出高电平唤醒主控
4.1.3 主控被唤醒后,拉低模块WAKEUP_IN 脚,快速恢复网络
4.2 主控唤醒
4.2.1 拉低模块WAKEUP_IN 脚
4.2.2 模块收到数据时断开与服务器的连接,恢复usb,RI 脚输出高电平
4.2.3 快速恢复网络
5. 2路保活
在1路保活基础上增加1路tcp连接阿里服务器:
- 建立第二条保活tcp,例如加2条AT指令
AT+ENTERSLEEP2=“192.168.0.100”,12346,180,“736c6565703132333435”,“77616B65313233”,“6c6f67696e”,“6f6b”,“64617461”
AT+ENTERSLEEPCFG2=“6c6f67696e”,“6f6b”,1,3,2
- 维护第二条tcp连接心跳,策略和第一条连接一样,任意一条连接保活失败都唤醒主控
边栏推荐
- Yunda's cloud based business in Taiwan construction 𞓜 practical school
- Biovendor sRAGE protein solution
- Voltage mode and current mode control of switching power supply
- jsp连接Oracle实现登录注册
- msa.h:没有那个文件或目录
- 2022 special operation certificate examination question bank and simulation examination for safety management personnel of fireworks and firecrackers business units
- Docker安装Mysql5.7并开启binlog
- 8VC Venture Cup 2017 - Elimination Round D. PolandBall and Polygon
- Function reentry caused by Keil C51's data overlaying mechanism
- Why is point shield cloud forced to quit playing?
猜你喜欢

How high is the gold content of grade II cost engineer certificate? Just look at this

sqlmap工具使用手册

Animation de ligne

Codeworks 5 questions per day (1700 for each)

如何在您的Shopify商店中添加实时聊天功能?

Pcr/qpcr research: lumiprobe dsgreen is used for real-time PCR

Sqlmap tool user manual

gorm事务体验

Oracle基础知识总结

Yin Yang master page
随机推荐
Comparison between relational database and document database
Gorm transaction experience
[C language practice - printing hollow square and its deformation]
Simple usage of GSAP
線條動畫
msa. h: There is no such file or directory
[leetcode] 12. Integer to Roman numeral
Docker installs mysql5.7 and starts binlog
Wedding studio portal applet based on wechat applet
MySQL 45讲 | 05 深入浅出索引(下)
RL 实践(0)—— 及第平台辛丑年冬赛季【Rule-based policy】
What is the difference between AC and DC?
SlicePlane的Heading角度与Math.atan2(y,x)的对应转换关系
Docker安装Mysql5.7并开启binlog
How does the power outlet transmit electricity? Simple problems that have plagued my little friend for so many years
Dart learning - functions, classes
Lumiprobe cell imaging analysis: PKH26 cell membrane labeling kit
数据中台:六问数据中台
[JVM series] JVM tuning
如何做好水库大坝安全监测工作