Use Emonhub with RPICT: Difference between revisions
Line 74: | Line 74: | ||
[[[init_settings]]] | [[[init_settings]]] | ||
[[[runtimesettings]]] | [[[runtimesettings]]] | ||
apikey = | apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
sendinterval = 10 | sendinterval = 10 | ||
senddata = 1 | senddata = 1 |
Revision as of 16:47, 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]]] apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx sendinterval = 10 senddata = 1 [nodes] [[11]] nodename = my_RPICT3V1 firmware = v1.1 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.