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.