I have successfully synched integer virtual pins with this command on the console: “Sync with latest server value every time device connects to the cloud”
My question can virtual pins that are strings be synched with the same command?
Reason is I am not having success.
In console V127 is set to “Sync with latest server value every time device connects to the cloud”
//globals
String timeString; //mail delivered time stamp
...
//in setup
Blynk.syncVirtual(V127); //sync timestring
...
my overall code is just shy of 1000 lines... so don't want to post it all.
All virtual pin can be synched
1 Like
My understanding of this “Sync with latest server value every time device connects to the cloud” is that if you call 'Blynk.syncAll()` then only pins that have the “Sync with latest server value every time device connects to the cloud” option enabled will actually be synchronised.
So, as a result the name is quite confusing.
As far as I know, calling Blynk.syncVirtual(V127)
will work regardless of the “Sync with latest server value every time device connects to the cloud” setting for that virtual datastream.
I think your issue is that you are calling this from void setup, and that doesn’t usually work. Instead you should have a BLYNK_CONNECTED()
function, and call it from there:
BLYNK_CONNECTED()
{
Blynk.syncVirtual(V127);
}
Obviously, you also need a corresponding BLYNK_WRITE(V127)
function that will be triggered when the Blynk.syncVirtual(V127)
call is made.
Another thing to be careful of is that if you use virtual pin numbers higher than 127 then you have to use the BLYNK_WRITE_DEFAULT
function to capture the values from these virtual pins.
Pete.
1 Like
Pete thank you sir. Many tips in your reply! I will run them down one by one in the days ahead. Did not know about the limit to V128 and above needing the BLYNK_WRITE_DEFAULT function.
THANK YOU again!
All the best, Dave
2 Likes