Fail Connecting EmonTX+ESP8266 to Azure IoT HUB using MQTT protocol

Hi!, I’m Julian, The aim of my project is to implement an IoT device based on ATMega328+EmonTX Shield+ESP8266. This IoT device needs to send MQTT messages to Azure Cloud. I have ready the cloud part except for MQTT communications.

The first issue that I found is MQTT login process. ESP8266 setup interface doesn’t accept Azure’s MQTT protocol (Furtheremore information MicrosoftDocs/azure-docs/blob/master/articles/iot-hub/

Once all steps in Azure cloud side are clear and defined (IoT Hub, Device Created, SAS token generated) can’t setup LogIn parameters in emonESP site.

Username required by Azure :

SAS Token generated and required for Azure MQTT as password (include blank space between Signature and sr=):


Also requires:

ClientID : Can’t be defined in emonESP page

My theories are:

  • emoESP is not prepared to handle SaS token format as a password for MQTT login. Even when SAS token is HTTP compatible.

  • Username format required by Azure is not accepted by emonESP page.

Hope someone could help me to solve this issue.

Many thanks in advance for your support


Hi Julian, welcome.

There is another thread re MQTT Custom Port running. EmonESP Custom MQTT Port - what version are you running? @glyn.hudson is the man for the ESP Firmware.

I’d suggest this is best raised as an Issue on GitHub.

If you can’t easily get this to work swap the ESP for a PiZero.

Easier to manage & modify.