Azure IoT Middleware for Freertos - Failed to establish MQTT connection, error 0x00000006

leo lee 0 Reputation points
2024-04-16T02:46:24.3066667+00:00

log

I used the ESP32S3 for azure iot connection and according to the code I have done the following:

DPS:

prvConnectToServerWithBackoffRetries --> OK

AzureIoTProvisioningClient_Init --> OK

AzureIoTProvisioningClient_Register --> OK

AzureIoTProvisioningClient_GetDeviceAndHub --> OK

IoT Hub:

prvConnectToServerWithBackoffRetries --> OK

AzureIoTHubClient_OptionsInit --> OK

AzureIoTHubClient_Init --> OK

But it fails in the call to AzureIoTHubClient_Connect with the previous log messages. AzureIoTResult_t value is 1.

We also encountered the same problem, and then we updated the certificate and this problem still occurred:

E (28665) MQTT: Connection refused: not authorized.

E (28665) MQTT: CONNACK recv failed with status = MQTTServerRefused.

E (28675) MQTT: MQTT connection failed with status = MQTTServerRefused.

E (28685) AZ IOT: Failed to establish MQTT connection: Server=XXX.azure-devices.net, MQTT error=0x00000006.

In the same question, I saw that deleting the Module ID would allow me to connect to azure iot, but I tried to leave the MODULE ID unconfigured or leave it empty.

Can you please help me? Please help check it.

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
381 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,120 questions
{count} votes