Article Directory
Foreword
1, Amazon cloud platform
1.1 application for the Amazon account
https://aws.amazon.com/cn/
1.2 into the AWS IOT Management -> items, create a single article
1.3 To create a certificate
1.4 Save and download a certificate
2, compiled to support access to Amazon's AT firmware
Get the SDK 2.1
at the firmware source: https://github.com/espressif/esp-at.git
modify the contents of makefile
export ESP_AT_PROJECT_PLATFORM ?= PLATFORM_ESP32
export ESP_AT_MODULE_NAME ?= WROOM-32
become
export ESP_AT_PROJECT_PLATFORM ?= PLATFORM_ESP8266
export ESP_AT_MODULE_NAME ?= WROOM-02
Certificate replacement
AmazonRootCA1.pem Alternatively Components / customized_partitions / raw_data / mqtt_ca / mqtt_ca.crt
xxx.cert.pem Alternatively Components / customized_partitions / raw_data / mqtt_cert / mqtt_client.crt
xx.private.key replacement components / customized_partitions / raw_data / mqtt_key / mqtt_client. key
2.2 SDK to compile
2.3 firmware configuration burning
3, AT commands docking platform Amazon
3.1 connection route
AT+CWMODE=1
AT+CWJAP="miot_default","123456789x" //填入路由ssid和密码
3.2 configuration information
AT+CIPSNTPCFG=1,8,"ntp1.aliyun.com" //
AT+MQTTUSERCFG=0,4,"esp_test","[email protected]","Aithinkerxxx",0,0,""//添加产品ID,亚马逊登录账户和密码
AT+MQTTCONN=0,"a2cmlaa8vbcuj-ats.iot.us-west-2.amazonaws.com",8883,1 //建立MQTT连接
3.3 subscribe to topics
Amazon cloud platform to subscribe to a topic esp_test / at
AT+MQTTSUB=0,"esp_test/at",1 //设备订阅主题
Amazon cloud platform client of the data:
Module receive a reply:
+MQTTSUBRECV:0,"esp_test/at",45,{
"message": "Hello from AWS IoT console"
}
3.4 announced
AT+MQTTPUB=0,"esp_test/at","hello aws!",1,0 //设备发布消息
Amazon cloud platform client receives the message:
Have any questions contact email messages or articles, not private letter to me, this blog has been shielded private letter! A lot of support!
- Technical Support E-mail: [email protected] must have asked to reply!