ESP8266 MQTT AT firmware docking overseas Amazon Cloud notes

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

Here Insert Picture Description
Here Insert Picture Description

1.3 To create a certificate

Here Insert Picture Description

1.4 Save and download a certificate

Here Insert Picture Description

Here Insert Picture Description

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,亚马逊登录账户和密码

Here Insert Picture Description

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
Here Insert Picture Description

AT+MQTTSUB=0,"esp_test/at",1 //设备订阅主题

Amazon cloud platform client of the data:
Here Insert Picture Description
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:
Here Insert Picture Description

Have any questions contact email messages or articles, not private letter to me, this blog has been shielded private letter! A lot of support!

Released two original articles · won praise 0 · Views 837

Guess you like

Origin blog.csdn.net/Boantong_/article/details/104633166