This article explains how to connect devices to AWS IoT
using AT
commands.
AT+MQTT
command description AT+MQTT Command Set
Please refer to AWS IoT Developer Guide and obtain:
xxx.cert.pem
(device certificate)xxx.private.key
(private key)AmazonRootCA1.pem
(root CA certificate)xxx-ats.iot.us-east-2.amazonaws.com
(endpoint
)Suggestion:
AWS IoT
. For details, please refer to AWS IoT Developer GuideOhio
as your regionAWS
IoT Developer Guide repeatedly to deeper understandingMQTT
Integration into AWS IoT based on Two-Way AuthenticationAmazonRootCA1.pem
replaces components/customized_partitions/raw_data/mqtt_ca/mqtt_ca.crt
xxx.cert.pem
replaces components/customized_partitions/raw_data/mqtt_cert/mqtt_client.crt
xxx.private.key
replaces components/customized_partitions/raw_data/mqtt_key/mqtt_client.key
Re-compile flashing AT
firmware as described in AT
README.md
AT+CWMODE=1
AT+CWJAP="ssid","password"
AT+CIPSNTPCFG=1,8,"ntp1.aliyun.com"
AT+CIPSNTPTIME?
AT+MQTTUSERCFG=0,4,"esp32-at","espressif","1234567890",0,0,""
AT+MQTTCONN=0,"xxx-ats.iot.us-east-2.amazonaws.com",8883,1
AT+MQTTSUB=0,"esp32/at",1
AT+MQTTPUB=0,"esp32/at","hello aws!",1,0
Notes:
AT+MQTTUSERCFG
is 4
, it is authenticated by both sides and cannot be changed.AT+MQTTCONN=0,"",8883,1
, endpoint
is the endpoint
in preparation phase, and port 8883
cannot be changedAT+MQTT
parameters are user-definableLOG
for normal interaction is as follows:
LOG
on ESP32
sideLOG
on AWS
side