Using an nRF52840dk with an nRF7002ek shield to implement wifi, bluetooth, and MQTT and can't get MQTT to work (TCP socket creation issue)

Hello! I am using an nRF52840dk with an nRF7002ek shield to implement wifi, bluetooth, and MQTT. My goal is to connect to wifi, set up the device as a central BLE hub so that peripherals can connect to it and data can be sent back and fort, and then connect to an MQTT broker (currently testing with the public EMQX broker broker.emqx.io over TCP port 1883 but I plan to use a private secure EMQX serverless broker over TLS/SSL with a ca_cert) so that the data sent the central BLE hub is sent through to the MQTT broker. To implement MQTT I am using https://github.com/nrfconnect/sdk-nrf/blob/09a6cfbc56082a997168df7b1c0ab30ce4320b26/include/net/mqtt_helper.h <net/mqtt_helper.h> and https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/lib/mqtt/mqtt.c <zephyr/net/mqtt.h>.

I have implemented BLE and wifi, but I'm struggling to get past setting up an MQTT connection and it looks like it is failing when the device tries to create a TCP socket. I also have tested this with my secure connection parameters for my private EMQX broker, and it still fails when it attempts to connect to MQTT. I have also tried this with "google.com" and gotten the same results.

Could this be a memory issue? here's my memory usage (the memory report feature on nRF SDK doesn't work for me so i can't use that):

if not, how can I fix this so it can connect to MQTT? Happy to also chat over email and I can send over the actual code to discuss! Really appreciate your help, thank you so much!!

Related