1.准备工作
(1)下载MQTT透传固件(安心可官网下载即可)
(2)下载MQTT固件到ESP8266
2.AT指令连接设备上传属性值
(1)AT\r\n
(2)AT+RST\r\n
(3)AT+CWMODE=1\r\n
(4)AT+CWDHCP=1,1\r\n
(5)AT+CWJAP="WIFISSID","密码"\r\n //连接路由器
(6)AT+MQTTUSERCFG=0,1,"设备名/设备id","产品ID","Token工具生成的鉴权信息",0,0,"" //配置连接信息
(7)AT+MQTTCONN=0,"mqtts.heclouds.com",1883,0 //连接服务器
(8)AT+MQTTSUB=0,"$sys/2mW915JKR7/test1/thing/property/xxx",0 //订阅属性
AT+MQTTUNSUB=0,"$sys/2mW915JKR7/test1/thing/property/xxx" //取消属性订阅
(9)AT+MQTTPUB=0,"$sys/2mW915JKR7/test1/thing/property/post","{\\"id\\":\\"123\\"\\,\\"params\\":{\\"temp\\":{\\"value\\":86}}}",0,0 //发布属性,上传属性值
(10)AT+MQTTCLEAN=0 //释放连接
标签:test1,ONENET,sys,MQTT,Studio,property,上传,属性 From: https://www.cnblogs.com/qingfeng515/p/17605412.html