256dpi / arduino-mqtt

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

Can I execute instructions while client.loop () is running? #270

Closed carminelau closed 2 years ago

carminelau commented 2 years ago

I have this problem, my esp32 has to keep doing operations including sending a string to the MQTT broker, but at the same time it has to listen...

256dpi commented 2 years ago

This is not possible with the current synchronous Arduino API. If you're open to use esp-idf this might be a solution: http://github.com/256dpi/esp-mqtt.