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