Hello All,
I love this app and I think it’s exactly what I’m looking for but I’m running into a (common?) issue. I’m sending 9 integers from the phone app to a ESP8266 by wifi with a local server setup (debug notes 6ms ping). Blynk.run(); takes about 50-70microseconds while receiving data and the latency is well within a usable range (why I set up the local server). Unfortunately, sending back to the app through Blynk.virtualwrite() or led.on()/off() takes about 60-80milliseconds each?! I would be fine with excessive write latency but the command locks the MCU loop during.
I’ve read through the similar forum posts and documentation which notes ‘clean the loop’, ‘don’t use vituralwrite in loops’, to use a timer to initiate the push (which still locks the loop for 60-80ms for each write), or my favorite ‘it depends’. I’m trying to send 8 integers and 4 led status’ so the full write takes about 800-900ms!? And yes, the led.on()/off() take just as long as the .virturalwrite(). Putting this on a timer that sends every 1sec still locks the loop for 800-900ms every 1000ms.
How can it be so fast (50-70us) to receive data from the app (through local server) but take so long (60-80ms) to send data to the app? What is happening here? The documentation did not help me understand the fundamentals of IOT that are happening here.
If needed I’ll post simplified code but it’s the same as others have posted. I’m just looking to rationalize why the data direction so drastically affects the time. If there’s nothing to be done to fix the virtualwrite time then my solution here is to not send data from the mcu to the app which is unfortunate. I was looking forward to using this as a diagnostic display.
Thanks,