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 client returning connection error -5

Part Number: MSP432E401Y
Other Parts Discussed in Thread: CC1312R, , CC1310

Dear all,

I'm trying to develop my own application using MSP432E401Y LaunchPad. The goal is to achieve communication with CC1312R CoProcessor and MQTT communication so I'm basing on two example projects: mqttclient from MSP432 SDK and MSP432 collector from SDK 15.4 plugin. 

My application compiles without any error (I added all necessary libraries), gets IP over DHCP, gets time over SNTP and connects to MQTT broker but immediatly fails with error -5. After digging in headers I found that this error is defined by MQTT_PACKET_ERR_PKT_AVL constant which means I have problems with memory pools. I'm really stuck there, I went through mqttclient example and I think I did everything the same - the error shows that I don't. 

Do you have any advices what to check next? I checked both secure and non-secure TCP/IP with the same result.


Regards,

Pawel

  • Hi,

    I have forwarded your query to the relevant team. They will get back as soon as possible.

    Thanks for your patience.

    Regards,

  • Hello Pawel,

    Did you refer the example TI 15.4 Gateway IBM in the TI 15.4 Stack? It uses MSP432E401Y + CC1310 and communicates with IBM over Ethernet using MQTT.

    ppielorz said:
    After digging in headers I found that this error is defined by MQTT_PACKET_ERR_PKT_AVL constant which means I have problems with memory pools.

    You can try to increase RAW_PAGE_SIZE and RAW_PAGE_COUNT values in the ndk_tirtos.c.

    Thanks,

    Sai

  • Hi,

    Thanks for your very fast response.

    Yes, I have looked at TI 15.4 Gateway IBM example but due to my own code, which was almost ready (I was only porting it for MSP432) I decided to build a project on my own.

    Thanks to your advice I have figured out using Wireshark, that the MQTT Broker is returning code -5, which means "Not authorized". The reason was simple - I didn't set username and password to MQTT client instance.

    Very misleading for me was the return codes defines which are conflicting with MQTT error codes.

    Nevertheless, thank you for your advice!

    Regards,

    Pawel

**Attention** This is a public forum