Hope someone can advise the best way of resolving this (and perhaps preventing it happening again). I’ll try and explain my steps prior to the issue, but it’s possible I’ve missed something; I didn’t notice this glitch in my use_kwh feed until today.
My kit is an rPi 2 Model B Rev 1.1 (yea, ancient, but it works), with a TPLink WN823N Rev 2 (rtl8192eu) WiFi dongle to get around the fact that the Pi2 doesn’t have onboard WiFi. I had some (unrelated) issues with my router recently, and in my fumblings, probably ran a ‘sudo apt update’ and ‘sudo apt upgrade’ on my homebrew EmonPi without thinking. Then I remembered there’s a tool in the EmonCMS Admin menu to do this, so I ran that as well. (18th Nov). I kept an update.log from that time, and a couple of times since (just to check that it really was as up to date as it can be).
My EmonSD in use is emonSD-17Oct19 and I think the previous last time I ran an update (via the EmonCMS Admin tool) was 25th Jan 2025.
As a result of my ongoing WiFi issues (now resolved, I think), I had cause to cleanly shutdown the rPi three times (or possibly sudo reboot - not sure how I can confirm which, to be honest).
It appears that the continuous process for turning my ‘use’ (pulse monitoring of smart-meter) feed to ‘use-kwh’ (the accumulating kwh feed used for daily/weekly/monthly totals, etc), has reset itself - but not to zero, as you might expect; instead to some other number which I think was the accumulated total from a previous restart or update. Again, not sure quite how to tell yet. Looking at the graph attached, it feels like it was the value of the accumulated kwh at the point of the last update attempt on 25th Nov (there’s a corresponding flatline there - not marked, but visible - which covers the time the unit was probably offline during my investigations with WiFi)
My main question now is - how do I correct this most safely? I’m tempted to simply delete all data on the use_kwh feed since the time of the update on 25th Nov, then somehow stifle new data coming in automatically (as part of the live feed process from ‘use’ feed - though I’m not sure how I’d suspend one without the other, safely). Then run a post-process from that same datetime, to do the ‘power-to-kwh’ accumulation and effectively ‘backfill’, then reinstate the original input-feed process (somehow). And hope it was all fairly seamless.
Is there a better way?
And is there a way to tell (i.e. not the hard way) whether any future hard-reboots are going to cause me to revert to this ancient use_kwh total (54505.something kwh)?
I am planning to move to emonSD-10Nov22 which I believe is the latest plausible candidate for my rPi2, but I’m in the middle of removing various other apps I’ve got on the same machine (Node-Red, and a mysql server I used for Octopus Agile data years ago), plus I need to copy over my homebrew pulse-reading software too - so it’s all a bit ‘tender’, and I need the EmonCMS/SD to be as near ‘normal’ as possible before I make that switchover.
Hence me wanting to do this step right. Any takers? I’d be really grateful for some insights or guiding steps, if anyone has anything to share. TIA
