Blynk.syncVirtual(vPin) ERROR

Guys,

I’ve been using Blynk quiet sometimes and having a goodtime sofar, unfortunately lately I stumble on a wierd situation when I’m experiencing a power loss, FYI I’m using ESP8266 (NodeMCU) and local Blynk Server on Raspberry and all using the latest software/firmware.

During start-up after power (grid) loss now I’m experiencing a Watch Dog Timer Reset, and this can happen several times, 5-10 times until the ESP can start-up again

I recognised that the issue is caused by Blynk.syncVirtual(vPin) command.

Is there anyway to replace this Blynk.syncVirtual(vPin) command with something else, that I can read the value of Blynk Virtual Pin?

Heere are my skech:

BLYNK_CONNECTED() { // -- Executed every Blynk connected to internet
  rtc.begin();
  Timer_GetSunriseTime();  
  Blynk.syncVirtual(V1, V54, V64, V44, V41); // STEP Widget - Start Time Adjustment, STEP Widget - Stop Time Adjustment, TIME INPUT Widget for Lamp, BUTTON Widget for Lamp Auto Timer
  Blynk.virtualWrite(V47, LOW); // Set off Net Blink Button
  // Blynk.syncVirtual(V1, V54, V64, V44, V41, V47);
  // Blynk.syncAll();
  Serial.print("**** BLYNK RECONNECTED: ");
  Serial.println(NetworkDisconnectedTimes);
  Serial.flush();
  NetworkDisconnectedTimes++;
  NetConnectUp = 0; // -- Reset Network Connection Uptime upon Network Disconnected
}

Thanks

Noer

It is not the command itself as much as the fact that you are effectively simultaneously activating 5+ different Blynk functions or commands (we can’t tell from here without seeing whole code)… followed by 2 more Blynk commands in quick succession (not counting any you have commented out). And if some/all of those functions are all trying to take the same time to do something, or interact with another, well, timeout and disconnection/reset.

Simply put, you are “mashing buttons” and the code is doing too much too fast

I’ve strip down the script to this:

BLYNK_CONNECTED() { // -- Executed every Blynk connected to internet
  Blynk.syncVirtual(V1, V54, V64, V44, V41, V47);
  MyBlynkConnected = true;
  NetworkDisconnectedTimes++;
  NetConnectUp = 0; // -- Reset Network Connection Uptime upon Network Disconnected
}

And still experiencing similar result.

Yes, but you are still processing 6 vPin functions all at the same time… and who knows what any of them are doing, or trying to do, while the others all simultaneously try to do their thing.

So what is the suggestion? Should I reduce the vPIN?
This all (6) vPin is only 1 Button for 1 lamp (V1), 1 Time-Input, (V41), 1 Button for enable/disable Timer (V41), Slidebar V54, V64, and another Button for internal ESP866 LED (V47), so I think is really minimum configuration, there are some other virtual PiIN that connected to Blynk.sync

Are you 100% sure that these virtual pins are set-up ion your app and linked to the project that has the Auth code that you’re using?

Have you tried stripping the code down further and just syncing one, or two v-pins at the same time until the code fails again?

Pete.

IRC delay has a build in timer reset for the watchdog so you could change this:
Blynk.syncVirtual(V1, V54, V64, V44, V41, V47);

into

Blynk.syncVirtual(V1);
delay (10);
Blynk.syncVirtual(V54);
delay (10);
etc.

Yes I’m sure…
Even syncing only one Button could my system experiencing (WDT) timeout …

Whoa … this is new for me… using delay function, I thought delay function is now recommended in Blynk Script…

it isn’t and you shouldn’t. However this is during initialization NOT during the loop, so it should not cause issues!

however i just noticed your last remark and given that you get a WDT even with one vsync I doubt my suggestion will work…but you can try.