Blynk.syncVirtual disconnects ESP8266 (if more than 2)

@Dmitriy
Dear Blynk experts,
I have faced many times the same problem, when I put in a simpletimer function Blynk.syncVirtual calls, if thet are more than 2 then the Android App reports many disconnections ( and that is true because all interactive widgets on the projects screen are in pause for a while. I use the latest App and library,
Please check it and let me know what is the suggested solution.

/// code snippet ///

 /// This function be called every 30 seconds
  timer.setInterval(30000L, updateVs);


void updateVs() {
    Blynk.syncVirtual(V21);   
    Blynk.syncVirtual(V22);
    Blynk.syncVirtual(V23);
    Blynk.syncVirtual(V24);
  }

In the above example if I reduce the Blynk.syncVirtual to two then all my scetch is running without any disconnection…

lots of solutions, for example - delay each sync by 1 second:

void updateVs() {
    Blynk.syncVirtual(V21);   
timer.setTimeout(1000L, updateVs2();
  }
void updateVs2() {
    Blynk.syncVirtual(V21);   
timer.setTimeout(1000L, updateVs3();
  }
void updateVs3() {
    Blynk.syncVirtual(V22);   
timer.setTimeout(1000L, updateVs4(); 
  }
void updateVs4() {
    Blynk.syncVirtual(V24);   
  }

That’s what I do, grouped in twos.

I feel I have the same issue with the ESP. I’ve reverted to syncAll, but timing could be an issue as stated by the two gentlemen above :slight_smile: (At least, I think they are gentlemen, one may never know :wink: )

my app tells me that my ‘things’ disconnect ALL THE TIME due to flooding - it never effects my operations, so i don’t see it as an issue…

(yes, i am working on addressing it by better coding, but since slider widget sends itself twice as a bug, i am just going to see how it goes after slider widget is fixed)

I get the same behavior trying to use Blynk.syncAll(). Watching on serial monitor it appears the device doesn’t reboot, but does reconnect to the server constantly. My issue is it will never get a correct RTC time. So I just group as above and all is well!

It might just be my sketch.

I believe that the only “correct” solution should be come from Blynk architects…
All the other are “work around” and self patches …

@vshymanskyy @Pavel @Dmitriy Please try to fix this very annoying problem. Thanks.

Or maybe just some clarification in docs.

I believe many of the issues stem from interspersing blynk code. In my agriculture environment, I keep my code sequential- sensor check first, then logic (if this, then that) that toggles a number of booleans, and then finally, I have a portion of code that runs almost strictly through all of my Blynk-related boolean switches (if (tempRelaySwitch), then bridge.digitalwrite(tempRelay, HIGH)- about 8 bridge writes. It works much MUCH better than incorporating my bridge functions where I now have the booleans.

Dangit… I keep forgetting to look at Github issues! Looks like it’s being tracked.