Im trying to connect to a hivemq Broker but get an error while doing so.
Error is:
[13:59:44][I][mqtt:176]: Connecting to MQTT…
[13:59:44][W][mqtt:264]: MQTT Disconnected: TCP disconnected.
Yes I have done some research. As it turns out, hivemq only supports secure connections. That means with an esp8266 board, which I am using, I cannot connect to that broker. Sadly.
[11:14:17][I][mqtt:250]: Connecting to MQTT...
[11:14:17][D][esp-idf:000]: I (33318) mqtt_client: Client asked to disconnect
[11:14:32][D][esp-idf:000][mqtt_task]: E (48253) esp-tls-mbedtls: mbedtls_ssl_setup returned -0x7F00
[11:14:32][D][esp-idf:000][mqtt_task]: E (48256) esp-tls: create_ssl_handle failed
[11:14:32][D][esp-idf:000][mqtt_task]: E (48258) esp-tls: Failed to open new connection
[11:14:32][D][esp-idf:000][mqtt_task]: E (48260) transport_base: Failed to open a new connection
[11:14:32][D][esp-idf:000][mqtt_task]: E (48269) mqtt_client: Error transport connect
[11:14:32][E][mqtt.idf:162]: MQTT_EVENT_ERROR
[11:14:32][E][mqtt.idf:164]: Last error code reported from esp-tls: 0x8017
[11:14:32][E][mqtt.idf:165]: Last tls stack error number: 0x7f00
[11:14:32][E][mqtt.idf:166]: Last captured errno : 0 (Success)
[11:14:33][W][mqtt:340]: MQTT Disconnected: TCP disconnected.
[11:14:33][I][mqtt:250]: Connecting to MQTT...
[11:14:33][D][esp-idf:000]: I (48610) mqtt_client: Client asked to disconnect
I’ve tried it both with skip_cert_cn_check: true and false. Same errors.
EDIT: solved. This is an OUT OF MEMORY problem. Im using an ili9341 display on a D1 mini WROOM board and my ESPHome code is over 2000 lines long. Commenting out the display section and everything works fine. Recommendation is to use an ESP32 S3 with more PS RAM.
I hope this helps someone else battling this problem!