Use Emonhub with RPICT: Difference between revisions
(23 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
=Overview= | =Overview= | ||
/!\ DO NOT USE THIS GUIDE WITH EMONPI / EMONCMS IMAGE. /!\ | |||
This document will demonstrate how prepare the rasberrypi to use Emonhub with the RPICT. | This is for use on a native Raspbian image. If using the emoncms image this is not necessary as emonhub is already installed. | ||
This document will demonstrate how to 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. | 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 [[ | 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_Raspbian_for_serial_read]]. | ||
Also make sure the RPICT board supports Emonhub format as output. | Also make sure the RPICT board supports Emonhub format as output. | ||
=Install Emonhub= | |||
This is not necessary if you are using the image from Emoncms as emonhub is already installed. | |||
To install emonhub we would recommend following the steps indicated on the [https://github.com/openenergymonitor/emonhub emonhub github page]. | |||
We have | We have summarized the commands to executre below: | ||
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key | wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key | ||
Line 36: | Line 31: | ||
sudo pip install paho-mqtt | sudo pip install paho-mqtt | ||
sudo pip install pydispatcher | sudo pip install pydispatcher | ||
Open | Open and modify this file below: | ||
sudo nano /etc/mosquitto/mosquitto.conf | sudo nano /etc/mosquitto/mosquitto.conf | ||
Set persistence parameter as false | Set persistence parameter as false | ||
Line 43: | Line 38: | ||
cd | cd | ||
mkdir data | mkdir data | ||
git clone https://github.com/openenergymonitor/emonhub.git && emonhub/ | git clone https://github.com/openenergymonitor/emonhub.git && emonhub/install | ||
sudo service emonhub start | sudo service emonhub start | ||
=RPICT configuration= | =RPICT configuration= | ||
The format parameter should be set to 3. | The format parameter should be set to emonhub, code number 3. | ||
format = 3 | |||
=Emonhub configuration= | =Emonhub configuration= | ||
Line 60: | Line 56: | ||
### see here : http://docs.python.org/2/library/logging.html | ### see here : http://docs.python.org/2/library/logging.html | ||
loglevel = DEBUG #(default:WARNING) | loglevel = DEBUG #(default:WARNING) | ||
[interfacers] | [interfacers] | ||
<nowiki>[[ | <nowiki>[[SerialDirect]]</nowiki> | ||
Type = EmonHubSerialInterfacer | |||
[[[init_settings]]] | |||
com_port = /dev/ttyAMA0 | |||
com_baud = 38400 | |||
[[[runtimesettings]]] | |||
pubchannels = ToEmonCMS, | |||
<nowiki>[[ | |||
<nowiki>[[emoncmsorg]]</nowiki> | |||
Type = EmonHubEmoncmsHTTPInterfacer | Type = EmonHubEmoncmsHTTPInterfacer | ||
[[[init_settings]]] | [[[init_settings]]] | ||
[[[runtimesettings]]] | [[[runtimesettings]]] | ||
apikey = | subchannels = ToEmonCMS, | ||
sendinterval = | #url = http://localhost/emoncms #uncomment to save on local pi | ||
[[apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]] | |||
senddata = 1 # Enable sending data to Emoncms.org | |||
sendstatus = 1 # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list | |||
sendinterval= 30 # Bulk send interval to Emoncms.org in seconds | |||
[nodes] | |||
<nowiki>[[11]]</nowiki> | |||
nodename = my_RPICT7V1 | |||
[[[rx]]] | |||
names = RP1, RP2, RP3, RP4, RP5, RP6, RP7, Irms1, Irms2, Irms3, Irms4,Irms5,Irms6,Irms7,Vrms | |||
scales = 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 | |||
units =W,W,W,W,W,W,W,mA,mA,mA,mA,mA,mA,mA,V | |||
Change the node information as relevant. Also change the apikey to the one that emoncms gave you. | |||
Latest revision as of 09:48, 3 May 2022
Overview
/!\ DO NOT USE THIS GUIDE WITH EMONPI / EMONCMS IMAGE. /!\
This is for use on a native Raspbian image. If using the emoncms image this is not necessary as emonhub is already installed.
This document will demonstrate how to 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_Raspbian_for_serial_read.
Also make sure the RPICT board supports Emonhub format as output.
Install Emonhub
This is not necessary if you are using the image from Emoncms as emonhub is already installed.
To install emonhub we would recommend following the steps indicated on the emonhub github page.
We have summarized the commands 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 and 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/install sudo service emonhub start
RPICT configuration
The format parameter should be set to emonhub, code number 3.
format = 3
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] [[SerialDirect]] Type = EmonHubSerialInterfacer [[[init_settings]]] com_port = /dev/ttyAMA0 com_baud = 38400 [[[runtimesettings]]] pubchannels = ToEmonCMS, [[emoncmsorg]] Type = EmonHubEmoncmsHTTPInterfacer [[[init_settings]]] [[[runtimesettings]]] subchannels = ToEmonCMS, #url = http://localhost/emoncms #uncomment to save on local pi apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx senddata = 1 # Enable sending data to Emoncms.org sendstatus = 1 # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list sendinterval= 30 # Bulk send interval to Emoncms.org in seconds [nodes] [[11]] nodename = my_RPICT7V1 [[[rx]]] names = RP1, RP2, RP3, RP4, RP5, RP6, RP7, Irms1, Irms2, Irms3, Irms4,Irms5,Irms6,Irms7,Vrms scales = 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 units =W,W,W,W,W,W,W,mA,mA,mA,mA,mA,mA,mA,V
Change the node information as relevant. Also change the apikey to the one that emoncms gave you.