The guys at OpenEnergyMonitor were kind enough to send me a prototype of their new RFM12Pi board a few weeks ago, this handy little kit allows our favourite low power radio board to be connected to the immensely popular Raspberry Pi. This makes setting up a tiny little server for receiving data from the OEM emonTX or my own TinyTX sensor boards very easy and negates the need for a separate internet gateway device such as a NanodeRF. If you want a local back end solution rather than a remote server it’s ideal.
While everyone else was struggling with interrupt issues when trying to get the RFM12B to work directly with the Pi, Martin went instead for the simple method of using an ATtiny84 to receive the data from the RF module and then spit it out to the Pi’s UART. A PHP script on the Pi then receives this, correctly formats it and sends it on to emoncms. Simple but effective and allows the tried and tested JeeLib RF12 library to be used on the ATtiny.
The board comes as a kit which shouldn’t take more than 10 minutes to put together and then just plugs onto the GPIO headers of the Raspberry Pi. Assuming you already have the Raspbian Linux distro installed on your Pi all you need to do is install emoncms (+ Apache, PHP and MySQL if not already installed), the PECL PHP serial module and the Raspberry Pi emoncms Module and you will be receiving data from your nodes in no time. Follow the complete setup instructions here.
If you are using ACKs like I am with the TinyTX then you will need to make a small edit in raspberrypi_run.php otherwise your node numbers will all be increased by 32.
Just change the line:
$url = “/emoncms/input/post?apikey=”.$apikey.”&node=”.$values.”&csv=”.$msubs;
$url = “/emoncms/input/post?apikey=”.$apikey.”&node=”.($values-32).”&csv=”.$msubs;
This is a bit of a quick and dirty fix that won’t be any good if you have a mix of nodes that use ACKs and some that don’t but it does the job for me. Update: See comments below for a better fix that works with both, does mean updating the code on the ATtiny84 though.
I’ve been using emoncms for over 12 months now and it makes a fantastic back end for the TinyTX and similar sensors and has seen some great improvements in that time. If you want a local dedicated back end for your system I can highly recommend the RFM12Pi board and Raspberry Pi combo.
|RFM12Pi Kit||Completed Board||Fitted to Raspberry Pi|