I have found that the following code logic below (i.e. BLYNK_CONNECTED) does not complete the SyncVirtual commands successfully i.e. SyncVirtual is called but the appropriate BLYNK_WRITE function for the respective virtual pins in the SyncVirtual command is not called when using Blynk API 0.4.3 (I have verified this through Serial.print statements). I am using local Server v 0.21.3
Interestingly, I have verified that it DOES work with Blynk API 0.4.0 but NOT Blynk API 0.4.3. I am using latest version of IOS App (which should make no material difference in any case). I can reproduce this condition consistently. [NOTE: I have not included the complete code of the sketch as its well over 2k lines].
// Global Variable
int syncPins[] = {V1, V2, V3, V4, V8, V9, V10, V11, V12, V13, V19, V20, V30, V31, V40, V41, V42, V50, V70, V71, V72, V73, V74, V75, V76, V77, V78, V79, V80, V81, V82, V83, V84, V85};
//****************************************************************
//====== RUN THIS CODE ONCE WHEN BLYNK IS FIRST CONNECTED ========
BLYNK_CONNECTED() {
if (isFirstConnect) {
isFirstConnect = false;
// Sync pins with a little delay
for(int i=0;i<sizeof(syncPins)/sizeof(int);i++)
{
Blynk.syncVirtual(syncPins[i]);
delay(5);
}
#ifdef DISPLAY_DEBUG
Serial.println ("Blynk First connected EXECUTED");
#endif
terminal.println ("==== NEW SESSION ====");
terminal.print ("Connected to Blynk Server: ");
clockDisplay_to_terminal();
}
}
In 0.4.3 we actually fixed a bug with syncVirtual and multiple pins - so you should check your logic and flow now. It should work as described in the docs
hi - the weird thing is my code from 0.4.0 and 0.4.3 is identical but it works under 0.4.0 but not 0.4.3 @Dmitriy I noticed a new server update with release notes indicating “Critical SYNC issue fix” - is this fix addressing the issue I raised or another issue ?
The best way is to turn on BLYNK_DEBUG and get understanding what goes wrong.
Probably output is truncated due to limited buffer length or something like that…
hi vhymanskyy - i will investigate, I just don’t understand why it works with 0.4.0 and not 0.4.3 — what could have changed ? For field trial I’ve rolled back to 0.4.0 for now.