MQTT_CLIENT: Error transport connect

VXavez
Posts: 1
Joined: Sat Apr 10, 2021 1:24 am

MQTT_CLIENT: Error transport connect

Postby VXavez » Sat Apr 10, 2021 1:35 am

Hello guys, I am starting with ESP32 development with IDF. My objective is to create an mqtt client for an IOT project that I am developing. I was trying to run the following example:

https://github.com/espressif/esp-idf/tr ... s/mqtt/tcp

After using the idf.py menuconfig command i can configure my WIFI network SSID and PASSWORD and a MQTT test broker, but when i try to execute the example code, after the conection success i get the following error

Code: Select all

I (3197) WIFI: Other event id:7
E (16687) TRANS_TCP: DNS lookup failed err=202 res=0x0
E (16687) MQTT_CLIENT: Error transport connect
I (16687) WIFI: MQTT_EVENT_ERROR
I (16687) WIFI: MQTT_EVENT_DISCONNECTED
Is this a common mistake? Does anyone know how I can solve this.

PS: I guess the steps to reproduce this error is just use the example code, and the command menuconfig to set the WIFI network.

Zoptune
Posts: 18
Joined: Mon May 27, 2019 11:02 pm

Re: MQTT_CLIENT: Error transport connect

Postby Zoptune » Tue Apr 13, 2021 5:32 pm

Hi VXavez,

The error is described in the log :

Code: Select all

E (16687) TRANS_TCP: DNS lookup failed err=202 res=0x0
This means that the URI you defined during the configuration is wrong and that it could not find the corresponding IP address of the broker via a DNS request.
Try with the default URI (

Code: Select all

mqtt://mqtt.eclipse.org
and it should work.

What URI did you use ?

Who is online

Users browsing this forum: No registered users and 103 guests