Skip to content
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

client.loop() should return after ONE message received #42

Open
Suxsem opened this issue Dec 12, 2015 · 1 comment
Open

client.loop() should return after ONE message received #42

Suxsem opened this issue Dec 12, 2015 · 1 comment

Comments

@Suxsem
Copy link

Suxsem commented Dec 12, 2015

I have this problem: I have a lot (about 10) topics that have retained messages.
After connecting to the broker I subscribe to all of them in one call to client.subscribe.
I start to receive the retained messages but after some of them the esp8266 freezes.

I put some debug instructions inside the callback function and before and after client.loop():
Serial.println("before");
client.loop();
Serial.println("after");
delay(500);

This is what i get:
before
new message
new message
new message

and then the esp8266 freezes. the delay is never called.
So, why client.loop() processes more then one message? How can i slow it down to prevent esp8266 from freezing when it receives a lot of messages at the same time?

I'm using QOS 2 for all pub/sub operations.

@Suxsem
Copy link
Author

Suxsem commented Dec 12, 2015

p.s. when the esp8266 freezes I still have a lot of free ram (more then 40k).
in mosquitto I got "Socket error on client ***, disconnecting" right when it freezes (mosquitto doesn't seems to need the missing keepalive packet to understand that the esp8266 freezed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant