knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.82k stars 1.47k forks source link

Client.loop seem to clash with audio.h when playing sound resulting in system freeze #934

Open gbernal opened 2 years ago

gbernal commented 2 years ago

Hi,

I'm developing a project that looks to play a sound read from an sd card when an mqtt message is received. I'm using the Wio Terminal with the respeaker add on.

After a lot of debugging, I have come to realize that after I run the function .play from the audio library everything freezes and I have to power cycle to be able to load the code. If I remove client.loop() and I pressed a button instead of mqtt message the sound plays.

My question is there a way to handle such events? for a process that could collide with any background process that pubsubclient is using?

Thank you and any suggestion would be appreciated!