mqtt connection issue error code: ESP_ERR_ESP_TLS_CONNECTION_TIMEOUT

sinmosh
Posts: 6
Joined: Mon Oct 17, 2022 3:06 am

mqtt connection issue error code: ESP_ERR_ESP_TLS_CONNECTION_TIMEOUT

Postby sinmosh » Sun Jun 04, 2023 1:37 am

When using esp-idf v4.4.3 and the esp-mqtt client code, I attempted to connect to a broker with the IP address 192.168.0.40 and port 1883. However, I got the following error logs:

E (81019) esp-tls: [sock=57] select() timeout
E (81019) TRANSPORT_BASE: Failed to open a new connection: 32774
E (81019) MQTT_CLIENT: Error transport connect
E (81029) MQTT: MQTT_EVENT_ERROR
E (81029) MQTT: MQTT Error code: 1
E (81039) MQTT: connect_return_code: 0
E (81039) MQTT: esp_tls_last_esp_err: 0x8006

It seems tcp_connect() gets ESP_ERR_ESP_TLS_CONNECTION_TIMEOUT.

Note that I am able to connect to this broker using mqtt explorer so the broker setup should be fine.

Also I have not issue to connect to broker ip of 10.0.0.203 on a different network. So can it be something related to the ip address range?

Any help appreciated.

a2800276
Posts: 78
Joined: Sat Jan 23, 2016 1:59 pm

Re: mqtt connection issue error code: ESP_ERR_ESP_TLS_CONNECTION_TIMEOUT

Postby a2800276 » Sun Jun 04, 2023 8:29 am

Port 1883 is usually not configured to support mqtt over TLS. It seems as though you may have configured your connection to expect TLS and therefore things aren't working. Could you post the code where you're configuring the connection parameters?

Who is online

Users browsing this forum: No registered users and 77 guests