Mqtt Clietn connection issue

Creating another thread since I am unable to update on the issue Unable to see data in mqtt

I updated mangOH with the mqttClient, and now I am able to see the LE_INFO logs. The issue now is the connection error.

I have connected my device directly to my laptop with Ubtuntu. mosquitto mqtt is running. I was able to publish message using MQTT Explorer application after connecting it with (mqtt://, and able to receive the topic using mosquitto_sub.

However, I am getting paho connection error 5, when I start mqttPublish application.
From this part of the code of mqttClientService.c
LE_WARN(“Paho connect returned (%d)”, connectResult);
result = LE_FAULT;

Do I need to connect mangOH device to a WiFi? What should be the system configuration?

did you shutdown the firewall by
iptables -I INPUT -j ACCEPT

You might see here

You might need to see \3rdParty\paho.mqtt.c\src\MQTTClient.c

To know why there is error