Dear TI!
I am following this advice from Microsoft ( https://learn.microsoft.com/en-us/azure/iot-dps/concepts-deploy-at-scale ) to skip provisioning to IoT Hub when connection string is known.
I am not sure how to correctly recognize that connection failed.
On MS Azure portal I have disabled the connection:
Now trying to understand situation - I have added some log output:
01> provisioning() called
01> MQTT CLIENT CB: CONNACK
01> 1 MQTTClient_connect() returned: 0
01> MQTT CLIENT CB: receive event
01> MQTT CLIENT CB: receive event
01> MQTT CLIENT CB: receive event
01> MQTT CLIENT CB: DISCONNECTION EVENT
01> iotHubConnection() called
01> MQTT CLIENT CB: CONNACK
01> 2 MQTTClient_connect() returned: -3
01> delay=3
01> MQTT CLIENT CB: DISCONNECTION EVENT
01> 2 MQTTClient_connect() returned: 0
01> 2 MQTTClient_subscribe() returned: -7 // this is called because previous call of MQTTClient_connect() returned 0 and we see no blocker here
"MQTT CLIENT CB" is taken from SDK examples and corresponds to metaData->messageType called via callback provided to MQTTClient_create(..) function.
"2 MQTTClient_connect()" is call of MQTTClient_connect(..) from iotHubConnection(..) which follows provisioning(..) procedure.
It is really weird that second try (second call) of MQTTClient_connect(..) returned 0 after previous call returned -3.
My questions:
* how to try again connecting to IoT Hub properly? Is new call of MQTTClient_connect(..) the right way?
* what means error code -3 and how to properly react?
Thank you for help!
Jiří