Not able to connect ESP 8266 to Azure. Not able to authenticate. Please help!

Yash Paranjpay 0 Reputation points
2024-02-20T11:05:32.1433333+00:00

Hello, I have followed all procedure to connect my ESP8266 and i have entered my credentials correctly. Why am I facing this issue? Have uploaded screenshot of the error. Kindly help!

ERROR: MQTT client connect attempt failed. Check host, deviceId, username and password. (state -2) Is connected ? NO (4) X - Error at connection.h:32 Error @ iotc_connect. Code 1

  • ERROR: Client was not connected.
Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
400 questions
Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
364 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,198 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
222 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 32,736 Reputation points MVP
    2024-02-21T07:24:01.29+00:00

    Hello @Yash Paranjpay,

    welcome to this moderated Azure community forum.

    Last year, Microsoft finally replaced it's TLS certificate for encrypting the traffic with the IoT Hub.

    Check out this blog post with more background information.

    Because you are using an ESP, you are probably still pinning the old Baltimore certificate.

    Can you check it the old Baltimore certificate is being used?

    If so, replacing it with the new Digicert one is a simple solution. Check the link above for more information.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.