STM32+ESP8266+MQTT connects to Alibaba Cloud server (3. AT command connects to Alibaba Cloud platform)

Preparation:
1. Check the device certificate and prepare for subsequent connections.

2. Use Alibaba Cloud configuration tool to generate device information and client ID
Alibaba Cloud IoT Platform Configuration ToolExtraction code: oxq9
(1) Paste the triplet information of your device certificate into the corresponding text box and click to generate client ID, username and password

(2) Connect to Alibaba Cloud ESP8266+AT command
①AT+RST
Reboot the device
②AT+CWMODE=3
AP+Station mode
③AT+CIPSNTPCFG=1,8,“ntp1.aliyun.com”
Enable the SNTP server, time domain 8, the SNTP server is the Alibaba Cloud domain name
④AT+CWJAP=“YCF”,“ycf88888888”
Connect to WIFI
⑤AT+MQTTUSERCFG=0,1,“NULL”,“C6T6&gavk88e3djY”,
“64678A30225AB875CA6A6C323DAA575A3B283AB7”,0,0,””
Configure MQTT user properties
⑥AT+MQTTCLIENTID=0,“112233|securemode=3,signmethod=hmacsha1,timestamp=456|”
Configure MQTT client ID
⑥AT+MQTTCONN=0,“gavk88e3djY.iot-as-mqtt.cn-shanghai.aliyuncs.com”,1883,1
Connect/query MQTT Broker
⑦AT+MQTTSUB=0,”/sys/gavk88e3djY/C6T6/thing/service/property/set”,1
Subscribe/query topic
Note: Remember to replace the instructions sent above with information related to the products you create!

After sending all the AT commands to the Alibaba Cloud management platform, you will see that the device you created is online.

On the management platform, click Monitoring and Operation->Online Debugging->Find the attribute debugging to send simulation data to ESP8266, and use the serial port to print out the subscribed data.

The serial port debugging assistant prints out the subscribed message data.

⑧AT+MQTTPUB=0,”/sys/gavk88e3djY/C6T6/thing/event/property/post”,“test”,1,0
Post a string message
⑨AT+MQTTPUB=0,”/sys/gavk88e3djY/C6T6/thing/event/property/post”,”{“method”:“thing.service.property.set”,“id”:“2012934115”,“params”:{“temperature”:36.5},“version”:“1.0.0”}”,1,0
Publish a message to the platform and send the temperature data to 36.5 degrees. The reported temperature data can be viewed on the management platform.


The following is using STM32 to connect to the Alibaba Cloud platform through code
STM32 connects to Alibaba Cloud

Related Posts

Several methods of remote connection to Galaxy Kirin advanced server operating system V10SP1 (command line remote + graphical remote)

Cloud migration practice: Migrate VMware virtual machines to Huawei Cloud

Based on the 51 tracking car (the first project for beginners!!!)

Yuanchuang Essay Collection|[Cloud Native] Docker View Log Usage Notes

LeetCode Greedy Algorithm 1005. Maximized array sum after K times inversion

Robomaster wheel motion calculation

Thoroughly understand permissions in Linux [detailed explanation]

docker startup command, docker restart command, docker shutdown command

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*