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?.
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.
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.