Chat freely about anything...

User avatar
By tester9
#31718 Hi,

I have a question to runtime behaviour of the nodemcu.
I would like to transfer some measured values from one device to another. The first device reads the values from sensors and provides the values with a small web server. The second device requests the values from the web server.
The reading of the sensors might take some time and should not be interrupted by an external request. It should be no problem if the response of the web server is a bit delayed.
Maybe my questions are much too detailed: How is net.server:listen() realized? Is it working like an interrupt? Or is this function called after another function has ended?
So maybe the device is inside the sensor reading function can I set a flag to delay the request of the server function?

Similar race conditions might happen if long multiple long timer routines are used. I found no documentation about this.
User avatar
By lethe
#31797 Why don't you just push the data from the ESP with the sensor to the other one, instead of polling it? That way can control when the transmission happens and guarantee that it won't interfere with the readout.