bertmelis / espMqttClient

MQTT 3.1.1 client library for the Espressif devices ESP8266 and ESP32 on the Arduino framework.
https://www.emelis.net/espMqttClient/
MIT License
100 stars 21 forks source link

Fix disconnect on ESP32 single core. #139

Closed dzungpv closed 8 months ago

dzungpv commented 9 months ago

More info: https://github.com/bertmelis/espMqttClient/discussions/138

bertmelis commented 9 months ago

There's no immediate issue with this PR but it's better to base your PR on a fresh branch and not keep building on top of an already merged one.

No need to change this one. I can just squash merge.

bertmelis commented 8 months ago

With this PR, the priority is fixed on single core systems. So even if you set a custom priority, it is ignored. This is not good, regardless of the usefulness.

The core id detection code should be in the espMqttClient(Secure) class and not in the underlying MqttClient class so we can forward the correct chosen priority. As alternative, we can set the default core to tskNO_AFFINITY and we can skip the core selection as a whole.

dzungpv commented 8 months ago

Yes, but even with the single core code or tskNO_AFFINITY, you lib still not stable for the S2. I still not find the root cause, and now I gave up and use official esp-mqtt