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 192.168.2.3. (mqtt://192.168.2.2:1883), 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
default:
LE_WARN(“Paho connect returned (%d)”, connectResult);
result = LE_FAULT;
break;

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