This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: MQTT SSL connection problem.

Part Number: MSP432E401Y

Hi, 

I am able create MQTT SSL connection with "test.mosquitto.org" successfully. 
I am not able to connect with my MQTT server. I change server ip and certificate for my MQTT server. But I am getting error -2021(SLNETERR_RET_CODE_FUNCTION_FAILED (Function couldn't execute correctly)) . Can anyone tell me that what is problem ?

Dinkar

  • Hello Dinkar,

    Can you let us know what function returns the error?

    Thanks,
    Sai
  • Hi Sai,

    MQTTClient_connect function return error -2021.

    Thanks,

    Dinkar

  • Hi Sai,

    I am waiting for reply.

    Dinkar
  • Hello Dinkar,

    Apologize for the delay in response!

    As you have mentioned, I was able to successfully test the "mqtt_client" example with the broker "test.mosquitto.org" with secure sockets.

    I tried to look through the error message, but it's hard to tell why "MQTTClient_connect" API returns the error "SLNETERR_RET_CODE_FUNCTION_FAILED" without any other information.

    You could try to establish mqtt connection to the broker without secure sockets. This will allow you to monitor the traffic using Wireshark. Once successfully connected without secure sockets, try with secure sockets. If the secure sockets fail, then mostly it's a certificate issue.

    Hope this helps!

    Regards,
    Sai
  • Hi Sai,

    I am able to connect  server with certificate from application "MQTT.fx".

    I use that same certificate in my device.

    Regards,

    Dinkar

  • Hello Dinkar,

    As mentioned in my previous post, it's very hard to figure out what's not working with the information on hand.

    If you are using an application on PC or smart phone that is communicating with the MQTT broker then try to turn off secure sockets and get a wireshark log and monitor the traffic.

    Then you can try the same approach with the embedded application to see what the difference is.

    Unfortunately I don't think we can help any further unless you have a specific request.

    Thanks,
    Sai

**Attention** This is a public forum