I have a low power application where the sensor device connects and sends data every 5min.
This works great using PUSH for Label or Value Display widgets for virtual pins combined with syncAll() however the LED widgets does seem to work the same way.
In the Blynk App (on the phone) I need to flip into edit mode and back into “run” mode for the LED to update its status correctly.
I also have problems updating the LED status. My setup is
Arduino Nano
HM-10 BLE
Android app
When I do virtualWrite (or using led.on() / led.off() ) I always see the “before last” value instead of the last value.
My workaround is to run 2 times the command (virtualWrite or led.on/off) and it works.
The strange thing is that I see on the debug-values that it is actually sending the data to the serial-connection. But I didn’t find the time yet to check if the problem is in the communication to the HM-10 module, or between HM-10 and Android app.
BTW not sure what the debug on the sensor device has to do with it. The sensor is sending the data. The problem is that when I resume Blynk from background mode the LED widget is not updated with the correct value or not updated at all. A simple “stop” and “start” of the application updates the LED status correctly.
Well it seems that this behavior is now happening for all widgets Even with PUSH mode for the values, when returning the iOS App from background I need to press stop and start to refresh the values
Here is a Video to illustrate the problem. You see that when Blynk App returns from background it does not update any values. When I go through a stop / start sequence then it refreshes the values correctly. All the values are set for “PUSH” mode.
Everything works fine, but when I do:
BLYNK_READ(V3)
{
if (light < 50)
Blynk.virtualWrite(3, HIGH);
else
Blynk.virtualWrite(3, LOW);
return;
}
The LED associated to V3 never changes state, no matter what the value of the variable is.
I put a print inside the function and I never see any prints either so the routine is never called.
No push from the server, it seems.