Why do I get Connection_Refuse_Server_Unavailable when connecting device to IoT central

Søren Thestrup 1 Reputation point
2022-11-10T12:03:48.79+00:00

I am trying to add a sensor to IoT Central. I already have 2 identical sensors running, but suddenly I cant add sensor nr. 3. I get the following error :

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13864
load:0x40080400,len:3608
entry 0x400805f0
1970/1/1 00:00:06 [INFO] Connecting to WIFI wifi_ssid mms-wireless
.0
1970/1/1 00:00:07 [INFO] WiFi connected, IP address: 10.11.12.106
1970/1/1 00:00:07 [INFO] Setting time using SNTP
........
2022/11/10 11:59:37 [INFO] Time initialized!
2022/11/10 11:59:37 [INFO] Azure IoT client initialized (state=2)
2022/11/10 11:59:37 [INFO] MQTT client target uri set to 'mqtts://global.azure-devices-provisioning.net'
2022/11/10 11:59:37 [INFO] MQTT client connecting.
2022/11/10 11:59:38 [INFO] MQTT client connected (session_present=0).
2022/11/10 11:59:38 [INFO] MQTT client subscribing to '$dps/registrations/res/#'
2022/11/10 11:59:38 [INFO] MQTT topic subscribed (message id=37503).
2022/11/10 11:59:38 [INFO] MQTT client publishing to '$dps/registrations/PUT/iotdps-register/?$rid=1{"modelId":"dtmi:azureiot:co2Template;1"}{"registrationId":"co2demo1","payload":{"modelId":"dtmi:azureiot:co2Template;1"}}'
2022/11/10 11:59:39 [INFO] MQTT message received.
2022/11/10 11:59:39 [INFO] MQTT client publishing to '$dps/registrations/GET/iotdps-get-operationstatus/?$rid=1&operationId=5.07d3c19271d37856.635fd50d-bec6-4415-a560-ea6386e10bac'
2022/11/10 11:59:39 [INFO] MQTT message received.
2022/11/10 11:59:42 [INFO] MQTT client publishing to '$dps/registrations/GET/iotdps-get-operationstatus/?$rid=1&operationId=5.07d3c19271d37856.635fd50d-bec6-4415-a560-ea6386e10bac'
2022/11/10 11:59:42 [INFO] MQTT message received.
2022/11/10 11:59:45 [INFO] MQTT client publishing to '$dps/registrations/GET/iotdps-get-operationstatus/?$rid=1&operationId=5.07d3c19271d37856.635fd50d-bec6-4415-a560-ea6386e10bac'
2022/11/10 11:59:45 [INFO] MQTT message received.
2022/11/10 11:59:48 [INFO] MQTT client publishing to '$dps/registrations/GET/iotdps-get-operationstatus/?$rid=1&operationId=5.07d3c19271d37856.635fd50d-bec6-4415-a560-ea6386e10bac'
2022/11/10 11:59:48 [INFO] MQTT message received.
2022/11/10 11:59:51 [INFO] MQTT client publishing to '$dps/registrations/GET/iotdps-get-operationstatus/?$rid=1&operationId=5.07d3c19271d37856.635fd50d-bec6-4415-a560-ea6386e10bac'
2022/11/10 11:59:51 [INFO] MQTT message received.
2022/11/10 11:59:54 [INFO] MQTT client publishing to '$dps/registrations/GET/iotdps-get-operationstatus/?$rid=1&operationId=5.07d3c19271d37856.635fd50d-bec6-4415-a560-ea6386e10bac'
2022/11/10 11:59:54 [INFO] MQTT message received.
2022/11/10 11:59:57 [INFO] MQTT client publishing to '$dps/registrations/GET/iotdps-get-operationstatus/?$rid=1&operationId=5.07d3c19271d37856.635fd50d-bec6-4415-a560-ea6386e10bac'
2022/11/10 11:59:57 [INFO] MQTT message received.
2022/11/10 12:00:00 [INFO] MQTT client publishing to '$dps/registrations/GET/iotdps-get-operationstatus/?$rid=1&operationId=5.07d3c19271d37856.635fd50d-bec6-4415-a560-ea6386e10bac'
2022/11/10 12:00:00 [INFO] MQTT message received.
2022/11/10 12:00:00 [INFO] MQTT client being disconnected.
2022/11/10 12:00:00 [INFO] MQTT client target uri set to 'mqtts://iotc-23dd2f7e-b6cc-4460-bb6a-dd296ea2881b.azure-devices.net'
2022/11/10 12:00:00 [INFO] MQTT client connecting.
2022/11/10 12:00:01 [ERROR] MQTT client in ERROR state.
2022/11/10 12:00:01 [ERROR] esp_tls_stack_err=0; esp_tls_cert_verify_flags=0;esp_transport_sock_errno=0;error_type=2;connect_return_code=3
2022/11/10 12:00:01 [ERROR] connect_return_code=MQTT_CONNECTION_REFUSE_SERVER_UNAVAILABLE
E (35969) MQTT_CLIENT: MQTT connect failed
2022/11/10 12:00:01 [INFO] MQTT client disconnected.
2022/11/10 12:00:16 [INFO] MQTT client connecting.
2022/11/10 12:00:17 [ERROR] MQTT client in ERROR state.
2022/11/10 12:00:17 [ERROR] esp_tls_stack_err=0; esp_tls_cert_verify_flags=0;esp_transport_sock_errno=0;error_type=2;connect_return_code=3
2022/11/10 12:00:17 [ERROR] connect_return_code=MQTT_CONNECTION_REFUSE_SERVER_UNAVAILABLE
E (52353) MQTT_CLIENT: MQTT connect failed
2022/11/10 12:00:17 [INFO] MQTT client disconnected.
2022/11/10 12:00:27 [INFO] MQTT client connecting.

What is going wrong?

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
342 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Søren Thestrup 1 Reputation point
    2022-11-15T08:23:16.303+00:00

    We have confirmation from Microsoft support that our problem can be reproduced. It turns out that if your application is based on "Azure_IoT_Central_ESP32" it will not be able to connect at the moment. Microsoft is investigating the issue. Until the issue is resolved Microsoft advise to use "Azure_IoT_Central_ESP32_AzureIoTKit" instead.