Good day, Im doing power consumption monitoring using Esp32 and blynk. Basically, there is a kilowatt-hrs (kWh) that will be displayed in the app (V11). My obvious problem is the value displayed in V11 which is kWh will reset everytime the esp32 goes off or unplug the 5v supply.
My question is, is there a code that will retrieve the value of kWh after turning the esp32 ON again?.
Do your V0, V1 and V2 datastreams have the “Sync with latest server value every time device connects to the cloud” option enabled in the Advanced datastream setup?
If not, then Blynk.syncAll won’t achieve anything.
Good day pete, I tried " Sync with latest server" but still doesn’t work. If my esp32 goes off (unplug USB cable connected on laptop) and tried to on again, all my stored data resets automatically.
Exactly which virtual pin value(s) are you trying to synchronise, and how are those datastreams configured (screeenshots would help).
Adding serial print messages to show the program flow (such as a message in BLYNK_CONNECTED that says “BLYNK_CONNECTED function triggered”) and serial print messages to show the values of the various variables you want to synchronise at various locations within the sketch is your next step.
My concern on this project is, even though we have the data on the cloud and can be retrieved…. There are times when there is no internet connectivity. Then there is no previous data to add the consumptions that’s going on until the internet is up. If this is just a hobby project, then it’s totally fine. If you want a perfect meter, you might want to consider adding a battery pack to your esp32 to always keep it running and an external SD card module and save the data(min 10hrs of backup)
This way the meter will be always up and ready to take the readings as soon as the power is back.
If I turn off the wifi connection and turn it on after few minutes it still can retrieve the data from V11. But it won’t retrieve if I unplug the 5v supply to my ESP32.
This is for our thesis that the kWh must be displayed (V11) for a month. But the problem is when power suddenly goes off the kWh that displayed in V11 restarts to 0.
Is it possible to retrieved if I use BLYNK_CONNECTED ()??? Or should I make a simple database like excel?
Posting snippets of code doesn’t help us (and therefore doesn’t help you), especially when those code snippets are in the form of screenshots.
You’ve ignored this piece of advice…
so I’ll take a back step until you’ve done that and posted you full updated code along with the serial output and some narrative that explains what steps you took in terms of removing and restoring power and removing and restoring WiFi to go along with the serial monitor output.