Disaster struck at my remotely monitored location a week ago – a power cut – one instance of emonTx/RPi failed to come back up. Having now retrieved the SDHC and USB HDD which was running the system, I discovered the USB HDD was dead and my attempts at recovery failed. So a case of start again – I then discovered a new SD image (Oct 2019) and decided to try it back at my home as a testbed. For what it’s worth, here are my experiences to date.
Burning/validating the image to SDHC took more than 30 mins – but it’s a big image 14.4GB.
I then added a file ssh to boot so I could use SSH but perhaps that was unnecessary.
Fired up an RPi connected by wired Ethernet to my network and did a network scan to find the IP address so I could puTTY in.
Old habits die hard – went to /home/pi/data. It’s all changed – I was lost! Eventually discovered a readme.md and have printed that out to serve as a ‘navigation cheat sheet’ – if that were added to the documentation, it might help many others?
# --------------------------------------------------------------
# Welcome to your emonPi/emonBase
# --------------------------------------------------------------
This image was build using the EmonScripts installation scripts:
https://github.com/openenergymonitor/EmonScripts
You can find the emonSD software stack installed in the following primary locations:
# /opt/openenergymonitor
Contains software installed from github.com/openenergymonitor.
Including: EmonScripts, emonpi, emonhub, RFM2Pi & avrdude
# /opt/emoncms/modules
Contains symlinked emoncms modules installed from github.com/emoncms
Including: demandshaper, sync, backup, postprocess, usefulscripts
# /var/www/emoncms
Contains the emoncms web application and modules installed directly
# /var/opt/emoncms
Contains emoncms feed data, including PHPFina & PHPTimeSeries
Browsed to the IP address and registered an account. Then went to Admin and discovered I was running ver 10.1.9. Belt & braces, I tried a Full Update but that returned an error referring me to a github link which I did not follow up on.
Next I did an Import Backup (sadly the most recent file on my home laptop is from early August). During the import process there was a warning …
mv: cannot move '/opt/openenergymonitor/data/import/emonhub.conf' to '/etc/emonhub/old.emonhub.conf': Permission denied
I ignored this and did a few cursory checks – could see the Feeds and Graphs OK.
Then I tried an Export Backup. This was trouble free. I discovered the backup in /opt/openenergymonitor/data – quite large at circa 127Mb.
Did lsblk which revealed that the SDHC is split:
- 256Mb for /boot
- 4Gb for /
- 10.1Gb for /var/opt/emoncms
This begs the questions:
- Is 4Gb big enough to accommodate regular (weekly?) backups?
- Would it be more logical for data exports to reside alongside the time series data in the 10.1Gb?
My power cut damage experience is salutary – I need to think harder about backups:
- Auto deleting those more than x weeks old
- Storing them on a largish USB 3.0 flash drive – or even 2 flash drives – quasi RAID?
- Given I monitor the site remotely using dataplicity – uploading backups to Dropbox? – and there is a dated script on the Forum addressing this
Haven’t yet sorted how to use the imported emoncms.conf
I’ll keep you posted and thx for yr efforts on this