pubsubclient icon indicating copy to clipboard operation
pubsubclient copied to clipboard

The broker plays a connection and reboots (ESP32)

Open butaikis opened this issue 6 months ago • 7 comments

Please tell me how to solve the problem. This happens when, for example, the broker disconnects, and the esp32 goes into reboot.

[ 75612][E][ssl_client.cpp:37] _handle_error(): [data_to_read():361]: (-76) UNKNOWN ERROR CODE (004C)
[ 75622][V][ssl_client.cpp:321] stop_ssl_socket(): Cleaning SSL connection.

abort() was called at PC 0x4012b743 on core 0

butaikis avatar Jul 01 '25 12:07 butaikis

Are you using PlatformIO? Which release of Arduino-esp32 are you on? Platformio is unfortunately a bit outdated, that's why I'm asking.

cziter15 avatar Sep 18 '25 22:09 cziter15

@cziter15 Thanks, I decided to change the mqtt client to a fully asynchronous one from esp-idf. It is more productive than this one, especially since pubsub is not updated.

butaikis avatar Sep 19 '25 05:09 butaikis

I'm using PubSubClient in my IoT Library - ksIotFrameworkLib and I also use SSL. No issues both on ESP32 and ESP8266, but the thing is that I'm not using CA bundle. I validate fingerprint instead. If you are using Platformio, try pioarduino and you will be able to compile with latest ESP SDKs.

MQTT implementation is very simple. When you are committed to ESP, it's okay to use their APIs, but if you want portable code I'd recommend to use sockets directly (or via library).

cziter15 avatar Sep 19 '25 06:09 cziter15

@cziter15 Yes, I switched to pio, but I also decided to immediately change the mqtt client)

butaikis avatar Sep 19 '25 07:09 butaikis

@cziter15 Thanks, I decided to change the mqtt client to a fully asynchronous one from esp-idf. It is more productive than this one, especially since pubsub is not updated.

I think it won't help you, but there is PubSubClient3 where we try to maintain this lib further.

hmueller01 avatar Sep 19 '25 10:09 hmueller01

@hmueller01 What means ?

it won't help you

It's working fine for me.

butaikis avatar Sep 19 '25 10:09 butaikis

Ok, sorry. Maybe I was a bit short. It was about

pubsub is not updated

Just wanted to note that there are updates in the meantime. But I think it will not solve your problem, as from your log it looks like the ssh client.

hmueller01 avatar Sep 20 '25 08:09 hmueller01