I want to store a value on the ESP-32 Board on the local Blynk server and the ESP-32 Board when it restarts I want to get this value stored automatically in the Blynk application on ESP-32. How can I do that?
Blynk.syncVirtual(vPin) will cause the server to push the latest value.
That’s because you’re using the wrong syntax for Blynk.syncVirtual(vPin) command.
You should read the documentation here:
You will also need a BLYNK_WRITE(vPin) handler for V2.
It’s probably best to put your Blynk.syncVirtual command in the special BLYNK_CONNECTED() function so that it is called automatically whenever your device connects or re-connects to your server.