[Solved] Sync all not sync'ing the v pins collected from devices by the new Tag functionality

Hi

Can you take a look. sync all for the v pins that are common to more than one devise collected by Tag? My V pins that are unique to a device are sync’ing OK. But those pins that are common to 2 devices are not syncing. I’ve tried using the sync virtual pin function but that is not working either.

// blynk virtual pins
BLYNK_CONNECTED() {
if (isFirstConnect) {
// Request Blynk server to re-send latest values for all pins
Console.println(F(“Sync”));
Blynk.syncAll();
Blynk.syncVirtual(V16,V17);
isFirstConnect = false;
}
}

Hello. That’s correct. It is not implemented. Could you please describe what do you expect here? Some simple use case?

Hi. Resizable widgets - nice! A lot of effort but a good result.

My expectation for the V pin sync for pins shared via a Tag would be to reinstate the status of the pins on a restart of my devices to reflect the status of the button/widget on the phone. Same logic as for pins not shared by a Tag.

To use your example: I button to control 2 lights: 1 light per device. If one device was restarted then I would expect it to restart with the pin value as per the other device/light as per the status on the phone.

My requirement is different but the same in concept. I’m using Blynk to control my ground source heat pump & underfloor heating/water heating.

Hi

I’ve done some more testing and I think the behaviour of the Tag function with syncall is a bit unstable - whether you have implemented it or not.

I have 2 devices sharing the same 2 V pins via the Tag function.

1 of the devices is not syncing at all as you say - perhaps. However the other device is definitely syncing rubbish.

This is my syncall as per normal
BLYNK_CONNECTED() {
if (isFirstConnect) {
// Request Blynk server to re-send latest values for all pins
Blynk.syncAll();
isFirstConnect = false;
}
}

The following code should be executed normally for one of the V pins either via syncall or by the widget on the phone as a push. I have put additional debug code to write the results to a labelled value widget on the phone.

BLYNK_WRITE(V16) //GSHPOnOffValue
{
Blynk.virtualWrite(V20, GSHPOnOffValue); // debug
GSHPOnOffValue = param.asInt();
Blynk.virtualWrite(V21, GSHPOnOffValue); //debug

}

Previous to the function call I am setting GSHPOnOffValue (an int) to a value of 1. The vwrite to V20 shows the value of GSHPOnOffValue to be 1 as I would expect prior to the reassignment to the value of param.asInt(). The vwrite to V21 shows that GSHPOnOffValue has been changed after the assignment of param.asInt();. So something in syncall is definitely triggering the BLYNK_WRITE(V16) function and filling it not with what is on the server i.e. my phone, but with rubbish.

Can you comment?

@koaiwi fixed. Please check.

Yes tested and fixed. Thanks.