Set Label Property on Button BUG

Hello!

For some reason I have to send two times the same property if i want to change the label on a button.

Blynk.setProperty(virtualPin, “onLabel”, valueString);

If I send this line only once to Blynk it will get updated after it is sent again ( I am sending this msg every 4 seconds)

Example (pseudo code):

Time => 00:00:00
Send => Blynk.setProperty(virtualPin, “onLabel”, 10);
What I see on Android => 0;

Time => 00:00:04
Send => Blynk.setProperty(virtualPin, “onLabel”, 20);
What I see on Android => 10;

Time => 00:00:08
Send => Blynk.setProperty(virtualPin, “onLabel”, 30);
What I see on Android => 20;

The same delay I see on the Blynk Terminal in Android.

Workaround:
Blynk.setProperty(virtualPin, “onLabel”, 10);
Blynk.setProperty(virtualPin, “onLabel”, 10);

Hope this helps to solve the (possible) BUG

Regards

@Cejfi have you tried a sync after the update command e.g.

Blynk.syncVirtual(Vx);

Nothing wirtten about it in the documentation, will try that tomorrow.

Regards

This might be due to the baud rate issue (when using the USB-link connection option) mentioned in another topic… one of the “issues” that occasionally plagued me was “missing” instructions, both to and from the App <-> Arduino.

In the Docs, both Blynk.syncAll() and Blynk.syncVirtual(vPin) only specify “value” updates… which sorta makes sense since that is the only “data” linked directly to the Vpin. Properties seem to be treated separately as a subset. @Dmitriy?

@Cejfi please post full code.
@Gunner not sure what do you mean.

Will syncing vPins also synchronize properties like label and colour?

On hardware side - no. Only values are returned.

OK, let me rephrase… since I have yet to figure out how to install an App Widget on my Arduino :laughing:

So Blynk.syncAll() and Blynk.syncVirtual(vPin) will synchronize to the App, the latest server stored, value, label and colour (where applicable) of a Widget?

Of course I could probably have rigged up a test for this by now… but lazy today :stuck_out_tongue_winking_eye:

@Dmitriy but sync does “kick” the server negating the OP’s requirement to double up on his need to duplicate commands, right?

I certainly use it for virtualWrite() updates but I don’t do much setProperty() stuff.

For hardware side, SYNC command will synchronize just value. For the app side - all 3 are restored.

could you please rephrase? I didn’t get it.

1 Like

If i do this it updates instantly:

void Blynk_buttonIntValueToBlynk(int virtualPin, char* valueString) {
  if (Blynk.connected()) {
    Blynk.setProperty(virtualPin, "onLabel", valueString);
    Blynk.setProperty(virtualPin, "onLabel", valueString);
  }
}

If I do this it updates after the same method is called again

void Blynk_buttonIntValueToBlynk(int virtualPin, char* valueString) {
  if (Blynk.connected()) {
    Blynk.setProperty(virtualPin, "onLabel", valueString);
  }
}

Doesn’t work.

Regards

@Cejfi do you use local server? Latest apps?

I use the Blynk cloud and the latest app. I will make a simple example and try to reproduce this issue.

Regards

@Dmitriy bug confirmed for onLabel and offLabel but regular label is OK.

void changeButton()   // called at 7s intervals with BlynkTimer
{
  if (Blynk.connected()) {
    Serial.println(valueInt);
    //Blynk.setProperty(V1, "label", String(valueInt));
    //Blynk.setProperty(V1, "onLabel", String(valueInt));
    Blynk.setProperty(V1, "offLabel", String(valueInt));
    valueInt = valueInt + 7;    
  }
}

@Cejfi do you use Adnroid? @Costas you too, right?

Yes Android.

Ok. Bug confirmed. This is Android bug and will be fixed in next update (with new history graph :wink:). thanks for reporting.

1 Like

Hi.
Is this bug fixed yet?

I’m quite sure its the same bug i’m experiencing.

I’m using android and local server. the app is newest version. And i’m quite sure the server is too. But i cant confirm right now dont have acces to the server before tomorrow.

thanks.

Yes. It was fixed. What Android version do you have and device? @iclimb are you sure you have latest app (fix was in app)? @BlynkAndroidDev

Yep, issue is fixed. if you have have such issue you could add here your sketch and button’s setup, so we could try to reproduce it on our side.