Closed parthesh-hub closed 2 years ago
Hi, check the ESP network library for TCP nodelay option. Because if have more experience with 8266 here is an explanation: https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/client-class.html#setnodelay
Thanks for the reply!! We have already tried this.. but no success..
Finally we moved to websocket method using another library and that works nicely!!!
@parthesh-hub Can you mention which library worked for you?
Hello everyone, we are currently working on project that involves IMU sensors along with ESP32 PubSubClient. We are trying to send sensor data to MQTT broker every 100ms(its fast because that's the need of the project)
The Serial Monitor says it is getting successfully sent on broker after 100ms. But on the broker it is getting published at uneven rate(some after 200ms or some after 2ms gap). There is uneven gap between messages which should be 100ms approx. We taught the issue might be on the MQTT broker but if we send the data per second then it is getting perfectly published on time.
But in our case we need faster speed (publish per 100ms).. here the ESP32 shows uncertain behavior..
We debug it and found out that it is because of TCP Buffer which accumulates multiple messages sent from esp32 and sends it to broker at once. Thus the subscriber receives the data at uncertain intervals. If we publish data after 1second it works fine but if we are publishing at fast rate(in our case 100ms, which is needed) this buffering behavior of TCP is causes issue.
Have anyone faced such issue? How to solve this? Thank you in advance :)
We are using ESP32 version : 1.0.6