当前位置:网站首页>上海域格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连接心跳,策略和第一条连接一样,任意一条连接保活失败都唤醒主控
边栏推荐
- How does guotaijun charge for safe varieties? Let's talk about the futures account opening process
- Study on chemical properties and technology of biovendor rage ELISA Kit
- 数据中台:一篇带你深入浅出了解数据中台
- mysql 导出查询结果成 excel 文件
- Lhasa accordion
- [skywalking] learn distributed link tracking skywalking at one go
- If a programmer goes to prison, will he be assigned to write code?
- 【无标题】drv8825步进电机驱动板子原理图
- Have you finished the examination of level II cost engineer? There are also qualification regulations!
- To batch add background pictures and color changing effects to videos
猜你喜欢

Linked list in JS (including leetcode examples) < continuous update ~>

Reactive dye research: lumiprobe af594 NHS ester, 5-isomer

Lhasa accordion

jq图片放大器

MySQL export database dictionary to excel file

How does the power outlet transmit electricity? Simple problems that have plagued my little friend for so many years

双向电平转换电路

独立站卖家都在用的五大电子邮件营销技巧,你知道吗?

Lumiprobe cell imaging analysis: PKH26 cell membrane labeling kit

The heading angle of sliceplane is the same as that of math Corresponding transformation relation of atan2 (y, x)
随机推荐
Voltage mode and current mode control of switching power supply
How to develop the language pack in the one-to-one video chat source code
Qcom LCD commissioning
数据仓库:DWS层设计原则
2022 Western pastry (Advanced) test question simulation test platform operation
Keil C51的Data Overlaying机制导致的函数重入问题
Blog login box
Liuhaiping's mobile phone passes [[uiapplication sharedapplication] delegate] window. safeAreaInsets. The height of the bottom security zone is 0
Shutter nestedscrollview sliding folding head pull-down refresh effect
Oracle 常用基础函数
Yunda's cloud based business in Taiwan construction 𞓜 practical school
msa.h:没有那个文件或目录
Zzuli:1071 decomposing prime factor
Wireless sensor network learning notes (I)
Sqlmap tool user manual
Biovendor sRAGE antibody solution
小球弹弹乐
数据中台:数据治理的建设思路以及落地经验
Office is being updated and the application cannot start normally
jq图片放大器