7 years, 8 months ago.

iothub_client_sample_mqtt is not able to connect

I have build the iothub_client_sample_mqtt, and tried to connect to an Azure account. The mbed (NXP LPC1768) connects to the internet and updates the time using an ntp server, but fails when trying to connect to the Azure server with the following message:

Info: IoT Hub SDK for C, version 1.0.13 Error: Time:Mon Aug 29 09:00:59 2016 File:/src/iothub_mqtt_transport/iothubtransportmqtt.c Func:GetTransportProviderIfNecessary Line:627 Unable to create the lower level TLS layer. Error: Time:Mon Aug 29 09:01:00 2016 File:/src/iothub_client/iothub_client_ll.c Func:IoTHubClient_LL_SetOption Line:941 underlying transport failed, returned = IOTHUB_CLIENT_ERROR failure to set option "TrustedCerts" IoTHubClient_LL_SetMessageCallback...successful. IoTHubClient_LL_SendEventAsync accepted message [0] for transmission to IoT Hub. Error: Time:Mon Aug 29 09:01:00 2016 File:/src/iothub_mqtt_transport/iothubtransportmqtt.c Func:GetTransportProviderIfNecessary Line:627 Unable to create the lower level TLS layer. IoTHubClient_LL_SendEventAsync accepted message [1] for transmission to IoT Hub. Error: Time:Mon Aug 29 09:01:00 2016 File:/src/iothub_mqtt_transport/iothubtransportmqtt.c Func:GetTransportProviderIfNecessary Line:627 Unable to create the lower level TLS layer. IoTHubClient_LL_SendEventAsync accepted message [2] for transmission to IoT Hub. Error: Time:Mon Aug 29 09:01:01 2016 File:/src/iothub_mqtt_transport/iothubtransportmqtt.c Func:GetTransportProviderIfNecessary Line:627 Unable to create the lower level TLS layer. IoTHubClient_LL_SendEventAsync accepted message [3] for transmission to IoT Hub. Error: Time:Mon Aug 29 09:01:01 2016 File:/src/iothub_mqtt_transport/iothubtransportmqtt.c Func:GetTransportProviderIfNecessary Line:627 Unable to create the lower level TLS layer. IoTHubClient_LL_SendEventAsync accepted message [4] for transmission to IoT Hub. Error: Time:Mon Aug 29 09:01:01 2016 File:/src/iothub_mqtt_transport/iothubtransportmqtt.c Func:GetTransportProviderIfNecessary Line:627 Unable to create the lower level TLS layer.

I have tried a similar program on my PC, build with Visual Studio, and it is running fine. This should mean that the connection string is OK, and the internet connection is OK. The firewall is open for MQTT communication. One difference between the two programs is that the mbed version is using certificates, and that seems to fail.

Can anybody help me solving what is going on?

1 Answer

7 years, 7 months ago.

Thomas, start with the simplesample_mqtt, it worked for me. There are no problems with the certificates.

Update: I tested right now iothub_client_sample_mqtt and there were no problem too.

Error: Time:Thu Jan 1 00:53:33 1970 File:/src/azure_c_shared_utility/tlsio_wolfssl.c Func:on_underlying_io_open_complete Line:255 WolfSSL connect failed result from xio_open =0 Error: Time:Thu Jan 1 00:53:33 1970 File:/src/azure_c_shared_utility/tlsio_wolfssl.c Func:tlsio_wolfssl_open Line:709 Failed to connect to server. The certificates may not be correct. result from xio_open =94 Error: Time:Thu Jan 1 00:53:33 1970 File:/src/azure_umqtt_c/mqtt_client.c Func:mqtt_client_connect Line:895 Error: io_open failed Error: Time:Thu Jan 1 00:53:33 1970 File:/src/iothub_mqtt_transport/iothubtransport_mqtt_common.c Func:SendMqttConnectMsg Line:1517 failure connecting to address 13.76.217.46.

This is the problem I am facing with simplesample_mqtt .Can you please help me to overcome it.

posted by harish reddy 07 Aug 2017