Use Emonhub with RPICT: Difference between revisions

From lechacal
Jump to navigation Jump to search
Line 74: Line 74:
     [[[init_settings]]]
     [[[init_settings]]]
     [[[runtimesettings]]]
     [[[runtimesettings]]]
        url = http://emoncms.org
         apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
         apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
         senddata = 1
         senddata = 1

Revision as of 16:49, 16 October 2017


Overview

This document will demonstrate how prepare the rasberrypi to use Emonhub with the RPICT.

Emonhub will be used to forward the data from the RPICT series board and forward them to Emoncms.

We assume here a fresh install of raspbian has been installed and all steps to get the serial port operating have been carried out. See Howto setup rpi3 for CSV reading.

Also make sure the RPICT board supports Emonhub format as output. Sketch versions that support this format are listed below.
RPICT3 v1.6
RPICT4T4 v1.5
RPICT3T1 v1.2
RPICT3V1 v1.2
RPICT7V1 model 1 v1.4
RPICT7V1 model 2 v2.6
RPICT8 same as RPICT7V1 model 2
RPICT4V3 model 1 v1.5
RPICT4V3 model 2 same as RPICT7V1 model 2


Install Emonhub

For this we would recommend following the steps indicated on the emonhub github page.

We have put a list of the command to executre below:

wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
cd /etc/apt/sources.list.d/
sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list
sudo apt-get update
sudo apt-get install -y mosquitto python-serial python-configobj
sudo easy_install -U pip
sudo pip install paho-mqtt
sudo pip install pydispatcher

Open my modify this file below:

sudo nano /etc/mosquitto/mosquitto.conf

Set persistence parameter as false

persistence false
cd
mkdir data
git clone https://github.com/openenergymonitor/emonhub.git && emonhub/installdata
sudo service emonhub start

RPICT configuration

The format parameter should be set to 3. If the board does not support this format then it will just output CSV.

Emonhub configuration

The configuration file for emonhub is located in /home/pi/data

Open this file. Delete all its content and replace with this one below:

[hub]
### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
### see here : http://docs.python.org/2/library/logging.html
loglevel = DEBUG #(default:WARNING)

[interfacers]

[[Serial]] 
   Type = EmonHubSerialInterfacer
   [[[init_settings]]]
       com_port = /dev/ttyAMA0
       com_baud = 38400
     [[[runtimesettings]]]

[[emoncms]] 
   Type = EmonHubEmoncmsHTTPInterfacer
   [[[init_settings]]]
   [[[runtimesettings]]]
       url = http://emoncms.org
       apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
       senddata = 1

[nodes]

 [[11]]
  nodename = my_RPICT3V1
  firmware = v1.2
  hardware = RPICT3V1
  [[[rx]]]
     names = P1,P2,P3,I1,I2,I3,V
     datacode = 0
     scales = 1,1,1,1,1,1,1
     units =W,W,W,A,A,A,V


Change the node information as relevant. Also change the apikey to the one that emoncms gave you.