-
Notifications
You must be signed in to change notification settings - Fork 115
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.publish() introduces huge delays #22
Comments
Mqtt is writed for realtime execution ?
|
Of course mqtt is not for real time, but publishing or receiving 100 messages per second is faaar from real time. Besides, I don't mind occasional delays, as long as average frequency will be around these 100Hz. |
To see how long the publish() and loop() methods can take, I modified the mqtt_basic sketch like this: uint32_t t = millis();
client.publish("outTopic", "hello world");
Serial.printf("Publish took %dms\n", millis() - t); and t = millis();
client.loop();
Serial.printf("Loop took %dms\n", millis() - t); Client.loop() almost always took "0ms" (i.e < 1 ms). Client.publish() took much longer - from less than 10 ms to over 100 ms. I don't know if there's much we can do about this. It's all up to the Espressif SDK and the Wifi network. |
Ok, I have edited a topic to reflect your measurements. I have also done some additional testing with different QoS settings.
|
Hi All I have been using this library with ATWINC1500. I started off with using knolleary/pubsubclient sudheera |
I have following code running on ESP:
When I subscribe to the test/# topic I would expect the counter on the end of the message to have difference close to 10 between subsequent messages, but I usually get something around 100-200. What is even more bizzare, when I set up a python script on the PC to publish messages in 30ms intervals to a topic that ESP is subscribed to, the publishing rate accelerates to something around 20ms. Unfortunately after some time, ESP reboots with
The text was updated successfully, but these errors were encountered: