256dpi / arduino-mqtt

MQTT library for Arduino
MIT License
1.01k stars 232 forks source link

can this library run in a separate task? where should I place the mqtt.loop(); #255

Closed TLS1000 closed 1 year ago

TLS1000 commented 3 years ago

Hi, when trying to use this library in a separate task, I can only receive packets when I place the mqtt.loop(); in the main loop (which I normally keep empty) I receive some of the subscribed topics. But since the wifi also gets used by other tasks this causes a crash. When I place the mqtt.loop(); in the 'wifi-handling task' the mqtt.connect() is succesfull and I can subscribe, but receive nothing.

I'm using the ESP32 development board example as template...

please help

256dpi commented 1 year ago

Closing as stale. Please reopen if issue persists.