ESP8266 AT MQTT SSL Certificates not working
Posted: Thu Jun 08, 2023 7:35 pm
I've asked the same question on stackoverflow: https://stackoverflow.com/questions/764 ... 1_76433285
I'm using the ESP8266 (WROOM-02D) for MQTT over WIFI. I'm using AT commands for MQTT. I'm currently using ESP8266-IDF-AT_V2.2.1.0 firmware on the WROOM-02D. My broker has been configured to use both client and server certificates for authentication.
I flashed my certifactes to the module at the following addresses as per the partition table:
I configure the module with the following AT commands:
THE PROBLEM
Whenever I execute the command, the module will reset. The module will reset even if use the default provided certicates. I found that the module will reset whenever MQTT scheme uses TLS (with or without certificates).
When I set the scheme to 0 (TCP and no TLS), there is no issue.
I've tried several things and even different firmwares but cannot get it to work.
When looking at the AT command manual, the MQTT user configuration has a "path" parameter.
I'm not sure if this could be the problem, but I cannot find any documentation on specifying the path.
I'm using the ESP8266 (WROOM-02D) for MQTT over WIFI. I'm using AT commands for MQTT. I'm currently using ESP8266-IDF-AT_V2.2.1.0 firmware on the WROOM-02D. My broker has been configured to use both client and server certificates for authentication.
I flashed my certifactes to the module at the following addresses as per the partition table:
Code: Select all
0xF8000 - client_cert.bin
0xFA000 - client_key.bin
0xFC000 - client_ca.bin
0x106000 - mqtt_key.bin
0x104000 - mqtt_cert.bin
0x108000 - mqtt_ca.bin
Code: Select all
AT+CWMODE=1 // Station mode
AT+CWJAP="SSID","Password" // Connect to AP
AT+CIPMUX=0 // Single connection
AT+CIPSNTPCFG=1,8,"ntp1.aliyun.com" // Configure and enable SNTP
AT+CIPSNTPTIME? // Query the SNTP time
AT+CIPSSLCCONF=3,0,0 // Set the SSL clients (mutual authentication)
AT+MQTTUSERCFG=0,5,"ClientID","","",0,0,"" // MQTT user configuration
AT+MQTTCONNCFG=0,30,0,"topic","message",0,0 // MQTT connection configuration
AT+MQTTCONN=0,"BrokerAddress",BrokerPort,0 // Connect to the MQTT broker
Whenever I execute the command
Code: Select all
AT+MQTTCONN
When I set the scheme to 0 (TCP and no TLS), there is no issue.
I've tried several things and even different firmwares but cannot get it to work.
When looking at the AT command manual, the MQTT user configuration has a "path" parameter.
Code: Select all
AT+MQTTUSERCFG=<LinkID>,<scheme>,<"client_id">,<"username">,<"password">,<cert_key_ID>,<CA_ID>,<"path">