STM32F103+ESP8266+阿里云物联网 一、ESP8266烧写MQTT固件1、硬件正点原子ATK-ESP8266模块、USB转TTL(最好用CH340芯片的串口,我用CP2101芯片的串口下载固件没反应)
2、软件下载软件:flash_download_tools_v3.6.8
MQTT固件包下载地址:https://docs.ai-thinker.com/esp8266/sdk
固件说明:推荐下载第二个AT固件,即 ESP8266MQTT透传AT固件(AT口改为UART0),记得下载使用指导。
file:///C:/Users/YUCHAN~1/AppData/Local/Temp/msohtmlclip1/01/clip_image026.png AT+CWMODE=1 OK AT+CIPSNTPCFG=1,8,"ntp1.aliyun.com" OK AT+CWJAP="iPhone12","11111111" WIFI DISCONNECT WIFI CONNECTED WIFI GOT IP OK AT+MQTTUSERCFG=0,1,"NULL","Dev_1&a18ZTDYMXDe","443016E61D9D762B96810EE9211BAFB4CEB3AB1A",0,0,"" OK AT+MQTTCLIENTID=0,"01|securemode=3\,signmethod=hmacsha1|" OK AT+MQTTCONN=0,"a18ZTDYMXDe.iot-as-mqtt.cn-shanghai.aliyuncs.com",1883,1 +MQTTCONNECTED:0,1,"a18ZTDYMXDe.iot-as-mqtt.cn-shanghai.aliyuncs.com","1883","",1 OK AT+MQTTSUB=0,"/sys/a18ZTDYMXDe/Dev_1/thing/service/property/set",1 OK AT+MQTTPUB=0,"/sys/a18ZTDYMXDe/Dev_1/thing/event/property/post","{\"method\":\"thing.service.property.set\"\,\"id\":\"2012934116\"\,\"params\":{\"temperature\":50.5}\,\"version\":\"1.0.0\"}",1,0 OK +MQTTSUBRECV:0,"/sys/a18ZTDYMXDe/Dev_1/thing/event/property/post",105,{"method":"thing.service.property.set","id":"2012934116","params":{"temperature":50.5},"version":"1.0.0"}
四、STM32F103连接阿里云物联网平台代码详见附件
|