ECx00U&EGx00U&EG915U 系列 MQTT 应用指导
上海移远通信技术股份有限公司 3 / 31
目录
文档历史 ....................................................................................................................................................... 2
目录 .............................................................................................................................................................. 3
表格索引 ....................................................................................................................................................... 4
1 引言 ....................................................................................................................................................... 5
1.1. 适用模块 ..................................................................................................................................... 5
2 MQTT 数据交互 ..................................................................................................................................... 6
3 MQTT 相关 AT 命令 .............................................................................................................................. 7
3.1. AT 命令说明 ................................................................................................................................ 7
3.1.1. 定义 ................................................................................................................................. 7
3.1.2. AT 命令语句 ..................................................................................................................... 7
3.2. AT 示例声明 ................................................................................................................................ 8
3.3. MQTT 相关 AT 命令描述 ............................................................................................................ 8
3.3.1. AT+QMTCFG 配置 MQTT 可选参数 ............................................................................. 8
3.3.2. AT+QMTOPEN 打开 MQTT 客户端网络 .................................................................... 15
3.3.3. AT+QMTCLOSE 关闭 MQTT 客户端网络 .................................................................. 16
3.3.4. AT+QMTCONN 连接客户端到 MQTT 服务器 ............................................................. 17
3.3.5. AT+QMTDISC 客户端断开与 MQTT 服务器的连接 .................................................... 18
3.3.6. AT+QMTSUB 订阅主题 .............................................................................................. 19
3.3.7. AT+QMTUNS 退订主题 .............................................................................................. 20
3.3.8. AT+QMTPUBEX 发布消息 ......................................................................................... 21
3.3.9. AT+QMTRECV 从缓存中读取消息 ............................................................................. 23
4 MQTT 相关 URC ................................................................................................................................. 24
4.1. +QMTSTAT MQTT 链路层状态变化的 URC .......................................................................... 24
4.2. +QMTRECV 通知 Host 读取 MQTT 数据包的 URC .............................................................. 25
4.3. +QMTPING 通知 MQTT 保活时间内 Ping 状态的 URC ........................................................ 26
5 举例 ..................................................................................................................................................... 27
5.1. 无 SSL 的 MQTT 操作举例 ....................................................................................................... 27
5.2. 含 SSL 的 MQTT 操作举例 ....................................................................................................... 29
6 附录 参考文档和术语缩写 .................................................................................................................. 31