I don't know if this is the most suitable forum for this discussion, but it is one of the most helpful ones I know in the business, so maybe there is someone who can help me.
I am developing an Iot project and I usually take many of my beginner's questions to the forum.
Well, my project consists of an ESP32 card, node red and broker mosquitto (both run on a local host on a machine with windows 10). In this project I perform the reading of sensors and the activation of some actuators as relays. I have a well-built and well-functioning node red flow. My problem is in the broker mosquitto: As for the reading of the sensors everything goes well, with the display on the dashboard almost in real time. However, when I am going to activate a relay, it is seconds or minutes until the message leaves the broker and arrives at the board executing the requested. In addition to the latency in the broker-ESP32 sense, I have disconnection problems. It is as if the status messages "ok" did not arrive on time, I believe it is related to the latency that affects the activation of the relays.
What's more, sensor messages range from 5kb to 10kb. While a relay activation message is around 1kb.
I don't understand the reason for the difference in latency.
Why is the reading of the sensors almost momentary and the activation of the relays not?
Again, I don't know if this is the right place, but node red is often used with these technologies, so I believed that someone here could help me.
I'm almost desperate. Any assistance is welcome.