Raspberry Pi

From OpenEnergyMonitor Wiki
Revision as of 23:52, 23 October 2012 by Glyn.hudson (Talk | contribs) (Emoncms Setup)

Jump to: navigation, search


RFM12Pi Front RFM12Pi installed Raspberry Pi


Design Files & Part List

Raspberry Pi Setup

Raspbian Linux Setup

  1. Download Raspbian 'Wheezy' SD card image This guide was made using 18th September 2012 release.
  2. Copy SD card image on SD card using Linux tool "dd" for any other OS see Raspberry Pi tutorial
    • Insert SD card $ df -h to view mounted partition, make note of SD card device name, for me this was 'sdb'
    • Unmount SD card $ umount /dev/sdb1 you will need to change sdb to match your SD card drive. If the card has more than one partition un mount that also $ umount /dev/sdb2
    • Write the .img to the card $ sudo dd bs=4M if=~/Downloads/2012-09-18-wheezy-raspbian.img of=/dev/sdb again you will need to replace sdb with your SD card device name and modify the location and name of the image as need.
  3. Put SD card into Pi and connect network and power
  4. Find the IP address of the Pi and SSH to it $ SSH [email protected], default password is 'raspberry'
  5. Once successfully logged in run Raspbian setup $ sudo raspi-config
    • Select Expand root partition to fill SD card finish and reboot
    • One rebooted restart SSH connection and run $ sudo raspi-config again
    • Check for updates
    • Change password for user Pi to something of your choice, make it secure it will be storing your home energy data!
    • If you plan to run the Pi as a headless dataloggin emoncms server as we do then select memory-split and choose the first setting a 240/16 split, the gives the CPU more memory at the expense of graphics which we're not using
    • We also recommend selecting boot behaviour and disabling booting straight into a desktop since this increases boot time and wastes system resources. If required a desktop can be loaded with $ startx.
    • Set locale and timezone as required
    • Finish and reboot, remember to use your new password when SSH'ing back in!
  6. (optional) set a host name for the Pi to enable host name to be used instead of IP address when connection to the Pi
    • Enter the host name your desire eg.emoncms in the file $ sudo nano /etc/hostname/ [Ctrl+X] then [Y] then [Enter] to save and exit
    • and in the file $ sudo nano /etc/hosts/ {Ctrl+X] then [Y] then [Enter] to save and exit
    • Reboot the Pi and you should be able to SSH back in with $ ssh [email protected] if 'emoncms' was your chosen host name.
    • I had trouble getting host name to work, does this work for you?

Emoncms Setup

  1. Install emoncms following this guide up to the end of section 7
  2. Instead of emoncms3 on the OpenEnergyMonitor GitHub use $ git clone git://github.com/emoncms/emoncms.git as the GtiHub emoncms repo. This is a new 'modular' version of emoncms. Alternatively you could download the zip file from github an extract into /var/www
  3. Navigate to the emoncms modules folder $ cd emoncms/Modules
  4. Download the Raspberry Pi emoncms module into the Modules folder $ git clone https://github.com/emoncms/raspberrypi.git
  5. Now carry on following the emoncms install guide section 8-10.
    • Note: since we're using the new modular version of emoncms the first bit of step 9 should be $ cd /var/www/emoncms/
  6. When you've finished you should be able to browse to Http://Pi IP address or Host/emoncms, create and account and test posting data with the 'try me' button in the API section.

RFM12BPi Setup