Bar Graphs not Updating after Deleting Dat Files

Hi all,
A while back I lost access to my local Pi Emonbase. This is an old system, although I think I updated the Pi to new hardware & software in 2017 (Emoncms version: master:8.2.8, allegedly).

After reading some helpful forum posts, I diagnosed that the memory card was full, and since I’m not fussed about retaining historical info, I just deleted all the .dat files in /home/pi/data/phpfina. Voila, I was able to get into Emoncms, and all the inputs and feeds are now working perfectly.

However, none of my bar charts are updating - no values, max 0, min 0. I looked in /home/pi/data/phpfina and could see that the .dat files were not being recreated, so I touched a couple and chmoded these to www-data to see if that improved things - sadly not! (I notice that my files are all “www-data root”, whereas I’ve seen some forum posts that show “www-data www-data”. I don’t know why this is, as I’m sure I never changed the .meta files. Does it matter?)

pi@raspberrypi ~/data/phpfina $ ls -la
total 20
drwxr-xr-x 2 www-data root 1024 Apr 20 13:55 .
drwxrwxrwx 6 pi pi 1024 Mar 29 2017 …
-rw-r–r-- 1 www-data root 16 Jan 14 2015 13.meta
-rw-r–r-- 1 www-data root 0 Apr 4 08:54 15.dat
-rw-r–r-- 1 www-data root 16 Jan 18 2015 15.meta
<snip, lots more meta files, and a few dat files that I randomly created>

I’ve restarted a few times, without any improvement.

As you’ve probably worked out, I have no clue what I’m doing (to be precise, I have A Little Knowledge). I learnt “Unix” over 40 years ago, and have barely used it since. Poking and hoping normally works, but in this case I’m stumped. Everything was working perfectly before the memory card filled up, so I’m assuming that my deleting the .dat files has broken something. I would be very grateful for any pointers to what I need to do to get the graphs working again. Even knowing which log files to look at would be helpful!

As the fixed interval files rely on a start time & data rate (I believe saved in the meta file) to work out where the data for a particular instant is in the data file, you probably need to recreate each Feed so that today’s date & time is associated with the 1st data item written into the file.

If you haven’t updated your emonCMS since 2017, I think you should consider doing a backup to save your input processing steps, dashboard etc (assuming it doesn’t refuse because it’s missing files), and then start again with a new SD card with the present version of emonCMS. Maybe @TrystanLea can advise whether a backup of a 2017 version is compatible with the latest emonCMS?

Thanks for the suggestion Robert. Sadly, it didn’t work. I had hoped there was an easy fix, but perhaps not. I’ll think about a new install.

Hello @boardgamer, unfortunately not an easy one to recover from. You would need to clear the start time in the meta files. A fresh install is probably your best bet. In future it’s probably easier to delete something else e.g log files saved to disk or one or two feeds by deleting both the .dat and .meta files…

Could @boardgamer recover the rest - processing steps etc? via a backup & restore?

I would suggest it’s probably not worthwhile, the input processing will not be recoverable as the feed ids will change on the new image. The dashboards could in part be recovered but again the target feeds will all be different so will take a fair bit of reconfiguring to get it all back up and running anyway…

1 Like

Thanks to Trystan & Robert for the feedback. I’m somewhat inclined to start afresh, as my SD card is probably getting old (like me!), and could probably do with a refresh. I haven’t got a huge number of feeds, so it won’t be too onerous to rebuild. Probably sensible to have a bit of housekeeping in any case.

1 Like

Not having entirely given up on my existing installation, I tried deleting some feeds, and then re-creating them (having deleted the corresponding meta and dat files). I can see that new meta and dat files have been created, but the dat files aren’t being populated, and the graphs are obviously still empty. The new files are of the form - do these look right?
-rw-r–r-- 1 www-data www-data 0 Apr 22 15:24 35.dat
-rw-r–r-- 1 www-data www-data 16 Apr 22 15:24 35.meta

Hello @boardgamer that does look right. I wonder if the feedwriter service is running? the service status is listed on the Admin page.

Um, I checked feedwriter, and it was stopped, so I restarted it. That worked, but it stopped again soon after. I did a sudo redis-cli FLUSHALL , which made it somewhat more reliable. Still no joy at getting the graphs working again though, so I think my patience is exhausted and I’ll just update to the latest version.

1 Like