I am registering my Arduino MKRGSM board with Azure Iot Hub by following this link:
https://create.arduino.cc/projecthub/Arduino_Genuino/securely-connecting-an-arduino-nb-1500-to-azure-iot-hub-af6470
Arduino MKRGSM 1400 device is successfully registered in the IoT Hub. but, when I am trying to connect the MKRGSM board to IoT Hub with the example provided in the arduino IDE,
Arduino IDE using File -> Examples -> Arduino Cloud Provider Examples -> AzureIoTHub-> Azure_IoT_Hub_GSM
In the serial monitor, I could see that, the board is getting connected to cellular network successfully, but whenever it is attempting to connect with MQTT, I am getting an error 3(Connection refused:Server unavailable) from the mqttClient.connect(broker, 8883). what would be the reason for this error?
But after few hours(around 10 hours) of registering the device in IoT Hub, i could able to communicate with the device without any error.
why it is taking time to connect with IoT Hub? can anyone suggest me to get through this. Thanks.