Setup Emoncms on a RaspberryPI with a Hard drive


After the SD Card write issue setback I've been keen to get an alternative that works for running emoncms locally on a raspberrypi. I now have my home monitoring setup running off a raspberrypi with a hard drive (as recommended by Paul Reed, thanks Paul!) and a pihub as in the picture above and I've uploaded an image and details of this option to the emoncms.org documentation here:

http://emoncms.org/site/docs/raspberrypihdd



I think there are quite a few benefits to running emoncms locally especially as we start to add the ability to control things from emoncms in addition to monitoring. Being able to set a heating profile shouldn’t depend on a working internet connection or a remote server's uptime. Control needs to be as robust and secure as possible.

I also think there is an important benefit of improved privacy: Energy, temperature and other environmental data is often sensitive personal data. Storing data locally is probably the best way to ensure you have full control over the privacy of your data as it never needs to leave the home unless that is you decide to share certain feeds for an open dataset or enable remote access for access while away or on the move.

Another benefit that I make regular use of is to develop new features such as the recent open source building energy modelling work (see application guide), because my data and the application was local I could edit the visualisations and model and see the results on my data straight away.

The emoncms raspberrypi hard drive image comes with quite a few add-on emoncms modules installed out of the box including the Event and MQTT module by Nick Boyle (elyobelyob). I tested the NMA notify my android feature and it worked great.

Here are all the add-on modules installed out of the box:
  • PacketGen, A new module for sending control packets.
  • Event module for sending Prowl, NMA, Curl, Twitter and Email notifications.
  • MQTT module for subscribing to MQTT topics containing data to be logged to emoncms.
  • Notify module sends an email if feeds become inactive
  • Energy module. Create a David MacKay style energy stack
  • OpenBEM module. Open Source Building Energy Model. Investigate the thermal performance of buildings.
  • Report module. Create's electricity use reports including appliance list exercise
There are two images in the zip attached in the documentation, one is called boot.img and the other pi_hdd_stack.img.

The boot.img goes on the SD card and just tells the PI to use the filesystem that is on the external harddrive. The second image pi_hdd_stack.img needs to be written to the hard drive.

With the harddrive connected to the PI through a powered hub and the boot SD card inserted in the PI, the pi should just boot-up and and be ready to use.

Environmental Considerations 

Adding a HDD to a Raspberry Pi setup does increase power consumption however I measured that my 2.5" 1TB USB external hard drive connected to the Pi only added 1.8W to the over all setup (3.9W). This modest increase in power can probably be justified.

Obviously purchasing a HDD has a considerable embodied energy, however there is an excess of low capacity second hand IDE hard drives commonly sold on ebay which are perfect for this application. A 20Gb drive (masses of space for emoncms!) can be picked up for a few £. With regular backup should provide a few years of service. It's great to be able to make use of something which otherwise would have to thrown away or at best recycled for raw materials. To engage in discussion regarding this post, please post on our Community Forum.