question

Harisboston avatar image
0 Votes"
Harisboston asked AshokPeddakotla-MSFT commented

Azure IoT Hub MQTT connect error 5 (unauthorized)

Hi,

I have successfully connected with an MQTT client (MQTTfx) to an IoT Hub with no issues.

However when I try to do the same with my device (HL7800 from Sierra Wireless) I get a connect error 5.

What could be the problem here? I am using MQTT 3.1.1 on both occasions and the same username and clientID.

I created different devices to make sure it's not something to do with multiple clients on the same device.

thanks

azure-iot-hub
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@NickWeliodro-9668 Could you share the complete error message? Please check this similar query and let us know if that helps?

Also, we are checking on this issue internally and update you as earliest with our findings.

0 Votes 0 ·
Murat-8621 avatar image Murat-8621 AshokPeddakotla-MSFT ·

I have been working on this project with my Arduino MKR 1010 WiFi

Following the guidelines below
https://github.com/microsoft/IoT-For-Beginners/blob/main/2-farm/lessons/4-migrate-your-plant-to-the-cloud/wio-terminal-connect-hub.md

I updated all the header to use the right wifi library.

Below line added where appropriate

elif ARDUINO_SAMD_MKRWIFI1010

include <WiFiNINA.h>



But nevertheless, so far I cannot connect to IoT Hub. I cannot get it connected to it gave me error #5 which is I assume #define MQTT_NOT_AUTHORIZED 5.

I don't know what I am doing wrong?.. Is it due to the hardware? Any idea? Or SSL Client

Any help would be appreciated.

0 Votes 0 ·

@Murat-8621 I see that you have created a new issue : https://docs.microsoft.com/en-us/answers/questions/519643/arduino-mkr-wifi-1010-to-azure-iot-hub-mqtt-not-au.html we shall continue the discussion on your new thread.

1 Vote 1 ·

1 Answer

Murat-8621 avatar image
0 Votes"
Murat-8621 answered AshokPeddakotla-MSFT commented

There is a great article just solving the problem above

https://paul-bruffett.medium.com/iot-azure-pipeline-9725ac2b6a00

Solution components are:
Arduino telemetry capture
Azure IoT Hub
Arduino Telemetry Capture
Using Arduino MKRWifi1010 or Arduino MKR WiFi 1010

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Murat-8621 Thanks for sharing the article. This would definitely benefit the community.

1 Vote 1 ·