You will have seen concerns mentioned here and elsewhere about using a Raspberry Pi as a central hub to control ESP8266s using MQTT and Node-Red. The issue is that the Pi uses an SD card and these don’t last forever. You can minimise use by using RAMLOG which keeps logs in memory and once a day backs them up to the SD. That in itself is fine (but not perfect, it’s caused me to lose an Apache log which in turn stopped Apache from powering up!) but there is also the MYSQL server - and while it should be possible to run THAT in RAM and back it up every night – I’ve not found anything remotely like plans to do that anywhere.
Swapping the internal SD for a USB stick doesn’t help, you could of course use a USB drive. Another way is to put the entire Pi (except boot) on a NAS drive. This is EASILY done if you happen to have something like a Synergy DiskStation – using BERRYBOOT which makes it easy to set up your NAS drive as a destination.
So – I did all that and decided I wanted a script like the one my friend Aidan has done so that once the drive is running – the script will do all the installation of everything I use. NOT as easy as it sounds and thanks to backup and restore facilities on the NAS, having made a backup of the basic setup (just Raspbian) I’ve been stuck in a testing scripts – restoring drive – testing scripts loop for much of the day.
Nothing to report yet, my scripts are the prettiest colours but don’t completely work yet. More soon. The idea being that the Raspberry Pi will be wall mounted – showing temperature and allowing control of temperature and lighting via a touch screen (on it’s way) while simultaneously being the hub for data, Node-Red etc with the actual code and data on my Diskstation which is RAID and can regularly back up the volume (sadly not incrementally).