0

I carefully followed (repeated twice) all the prerequisites and successfully connected to Azure IoT Hub. Uploaded Device Code for Get-Started Example (send the IoT DevKit sensor data to the IoT Hub). and I'm getting the following error in the final step.

[Starting] Opening the serial port - COM4
[Info] Opened the serial port - COM4
2019-02-09 06:31:12 INFO:  >>>IoTHubClient_LL_SendEventAsync accepted message for transmission to IoT Hub.
2019-02-09 06:31:17 ERROR: File:C:\Users\v-zuhu\AppData\Local\Arduino15\packages\AZ3166\hardware\stm32f4\1.6.0\cores\arduino\azure-iot-sdk-c\iothub_client\src\iothubtransport_mqtt_common.c Func:mqtt_operation_complete_callback Line:1724, Connection Not Accepted: 0x5: Not Authorized
[Done] Closed the serial port

I attempted recreating the example from scratch and noted multiple errors of the following type during DevKitDPS.ino upload:

..\AppData\Local\Arduino15\packages\AZ3166\hardware\stm32f4\1.6.1\system/platform/toolchain.h:23:2: warning: #warning toolchain.h has been replaced by mbed_toolchain.h, please update to mbed_toolchain.h [since mbed-os-5.3] [-Wcpp]
 #warning toolchain.h has been replaced by mbed_toolchain.h, please update to mbed_toolchain.h [since mbed-os-5.3]
..\examples\devkit_dps\Device\DevKitDPS.ino:12:32: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
 char* Global_Device_Endpoint = "global.azure-devices-provisioning.net";

Researched this issue and found following links: https://github.com/ARMmbed/mbed-os/issues/3876
toolchain.h has been replaced by mbed_toolchain.h

I don't how to proceed with this and any guidance will be much appreciated.

SanV
  • 855
  • 8
  • 16
  • From the error message, the device connection string was not accepted by Azure IoT Hub. Could you use another IoT Hub with price tier S1 and try again? – renhel Feb 10 '19 at 12:23
  • Just to clarify, you were able to connect to IoT Hub using the same connection string before? Few things to check, make sure the connection string is correct. You can check using iothub-diagnostics (https://github.com/Azure/iothub-diagnostics). Then, make sure you closed any connection using the same connection string before connecting. – Yi Zhong - MSFT Feb 11 '19 at 18:23
  • @YiZhong-MSFT As suggested, I used iothub-diagnostics to check the connection string and it passed all tests. I have identified an issue during Upload Code to Device from Visual Studio Code and trying to troubleshoot it. Will post my findings. – SanV Feb 12 '19 at 20:41
  • Got it, please keep us posted on the findings. You can reach out to us via Gitter as well for MXChip issues: https://gitter.im/Microsoft/azure-iot-developer-kit – Yi Zhong - MSFT Feb 13 '19 at 23:13
  • @YiZhong-MSFT updated the original posting with new error identified. Could it be causing the "Connection Not Accepted: 0x5: Not Authorized" error? If so, how to correct it? – SanV Feb 16 '19 at 04:17

0 Answers0