-
Notifications
You must be signed in to change notification settings - Fork 51
loop() doesn't fetch all messages for a topic #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Should have said, this is: and my code to reproduce is:
|
It might just be "User error" i.e. it is supposed to work like this, and I just need to call loop() more often! But calling it too often can lead to #101 |
my suggestion to "fix" this is having _wait_for_msg() run in a while loop until no response is received. e.g.
|
Still trying to suss out what is going on here.
At the simplest level, I'm seeing that
mqtt_client.loop()
usually only fetches a single message from the queue(for a particular topic), even if there are many messages waiting. I assume this is incorrect behaviourI have seen that sometimes it does a 'catch up' and fetch all of the messages!
Not sure if this is a quirk of AdafruitIO's MQTT broker or this library.
e.g. if I run loop() every 5 seconds, expecting a message from AIO's
time/seconds
topicIt looks like if the queue builds up too much, it can cause other issues.
e.g. I'm trying to use MQTT and HTTP requests in the same code, there is an interaction where I see errors like:
Which seem to be associated with the MQTT queue not being cleared
The text was updated successfully, but these errors were encountered: