Open Peterkn2001 opened 3 years ago
@Peterkn2001 now DS should be explicitly set as "sync" for SyncAll
operation to work:
Right now this option is missing on the UI. We'll add it with the next deployment.
This was done to avoid the hardware crash when syncAll
invoked. For the devices with many datastreams it was often a problem and calling sync
for the specific pin was not suitable as required a lot of calls.
In that case, the documentation here will need updating:
https://docs.blynk.io/en/blynk.edgent/api/virtual-pins
Blynk.syncAll() Requests all stored on the server latest values for all widgets. All analog/digital/virtual pin values and states will be set to the latest stored value. Every virtual pin will generate BLYNK_WRITE() event.
and I'm not sure that the wording of the advanced option in your screenshot is very self-explanatory.
Will Blynk_syncAll
cause BLYNK_WRITE_DEFAULT
to trigger for any datastream that has this option turned on and doesn't have an explicit BLYNK_WRITE(Vpin)
callback?
Pete.
To replicate this issue, use the following code (ESP32 with static provisioning for simplicity of testing)
Define a datastream for pin V1 and attach a slider widget to it in the web dashboard. (Note that this issue isn't limited to the slider widget, but there is another issue with the slider widget on the web dashboard, and I'll raise a separate issue about this (#140), but this setup will demonstrate that issue)
When the sketch is populated with the correct credentials and uploaded, it connects to Blynk and prints the "Blynk connected, processing syncAll..." message, but
BLYNK_WRITE(V1)
is not triggered. Moving the slider on the dashboard does triggerBLYNK_WRITE(V1)
.If you then modify the BLYNK_WRITE(V1) callback and uncomment the
Blynk.syncVirtual(V1)
codeBLYNK_WRITE(V1)
is triggered onBLYNK_CONNECTED()
.Pete.