question

Sahithya23-0888 avatar image
0 Votes"
Sahithya23-0888 asked SatishBoddu-MSFT answered

"Connection refused: server unavailable" error while connecting Arduino MKRGSM with Azure IoT Hub

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.

azure-iot-hubazure-iot
· 4
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.

Hello @Sahithya23-0888 this is an interesting scenario. Have you tried to de-register the device with IoTHub and retry the device registration process, just to make sure the error surfaces again?

0 Votes 0 ·

Hi @SatishBoddu-MSFT I had tried it multiple times but every time it is the same case. I had also tried with 3 different MKRGSM boards, with every device its same.

0 Votes 0 ·

Hello @Sahithya23-0888

So after few hours(around 10 hours) of registering the device in IoT Hub, was able to communicate with the device without any error? is this the same repeated behavior every time?
looks like it needs deeper investigation.

0 Votes 0 ·
Show more comments

1 Answer

SatishBoddu-MSFT avatar image
1 Vote"
SatishBoddu-MSFT answered

Hello all,

As a troubleshooting step in this scenario, we recommend using a new Azure IoTHub created and connect another real IoT Device example using the: IoT Plug and Play app quickly.https://play.google.com/store/apps/details?id=com.iot_pnp&hl=en_IN&gl=US

and connect to the IoT hub. Then send the telemetry messages. It can be monitored using IoT explorer Install and use Azure IoT explorer | Microsoft Docs

Please comment in the below section if you also face the same issue. Happy to help!


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.