Can't do Blynk.syncAll();

Hey! it’s finaly works :smile: i Blynk.syncVirtual() instead of Blynk.syncAll
Thanks :wink:

Hi, but then SyncAll or SyncVirtual must be in void setup or I can put in other part of the code?
Thak you

Hi,
It is best to put these inside BLYNK_CONNECTED() { }, so whenever your device gets connected to blynk server after some disconnection or first time, all the instructions or programs written inside BLYNK_CONNECTED() { } will get executed for once.

Regards,
Gaurav Barwalia

Ok, but doesn’t work for me. I insert this in my code:

BLYNK_CONNECTED() {
  if (isFirstConnect) {
    Blynk.syncVirtual(buttonFaretto10W, buttonMadonna, correnteIstantanea, potenzaIstantanea, energiaTotale, correnteTotale, correnteTotaleDay, V9, V10, V11, V12);   //V9  V10 V11 V12  are TIMER
    isFirstConnect = false;
  }
} 

Why?
I must put single syncValue for each value?
Thank you

Hi,

I have never tried the syntax you have used, so cannot comment on that now, but I am using below syntax for each virtual pin and it works,

    Blynk.syncVirtual(V20); 
    Blynk.syncVirtual(V18); 
    Blynk.syncVirtual(V24); 
    Blynk.syncVirtual(V27); 

After each Blynk.syncVirtual(V27) call, their corresponding BLYNK_WRITE(V27) { } gets called automatically and this is how blynk sync works.

Regards,
Gaurav Barwalia

I use SyncAll according with Blynk docs, but doesn’t work. So I’ll try putting single SynkVrtual in BLYNK_CONNECTED and I’ll let you know.
Can I ask you a question please? I see in you code this:

This is a method to avoid falling the connection? I explain better…
Plaese fif you want I write a post here : For me Blynk is contradictory! - #6 by Andrea_Errico
Can you help me? I have 2 problem:
1)My app recieve data slowly from blynk server
2)the connection always falls.
Let me know
Thank you

Sorry, another question. So, after last single SyncVirtaul I must put BLYNK_WRITE() for each virtual pin?? :open_mouth: sure?

Hi,

SyncAll() is considered a bad practice for low config devices like ESP8266, you may be using 100s of virtual pins and SyncAll() will try to sync them all at once, it may reboot your ESP as well due to WDT software or hardware reset.
Try to sync those virtual pins that you really need in the blynk server connection.
BLYNK_WRITE(V27) { } is not mandatory but it is useful.

Regards,
Gaurav Barwalia

Ok I’ll try!
Plese read this:

Please don’t keep spamming multiple threads with your issues.
Keep the discussion in one place and focus on listening to the feedback that is given.

Pete.

if people bored I search another way…