Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
TrystanLea committed Oct 12, 2020
2 parents aff53c6 + b012343 commit 5159e8a
Show file tree
Hide file tree
Showing 34 changed files with 1,554 additions and 724 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ README.md
*.swp
*.idea
*~
.vscode/settings.json
103 changes: 50 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
## emonHub (emon-pi variant)
# emonHub

Emonhub is used in the OpenEnergyMonitor system to read data received over serial from either the EmonPi board or the RFM12/69Pi adapter board then forward the data to emonCMS in a decoded ready-to-use form - based on the configuration in [emonhub.conf](https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md)
emonHub is used in the OpenEnergyMonitor system to read data received over serial from either the EmonPi board or the RFM12/69Pi adapter board then forward the data to emonCMS in a decoded ready-to-use form - based on the configuration in [emonhub.conf](https://github.com/openenergymonitor/emonhub/configuration.md)

More generally: Emonhub consists of a series of interfacers that can read/subscribe or send/publish data to and from a multitude of services. EmonHub supports decoding data from:

### Default Interfacers

- `EmonHubJeeInterfacer`: Decode data received from RFM69Pi & emonPi in [JeeLabs data packet structure](http://jeelabs.org/2010/12/07/binary-packet-decoding/) e.g. emonTx, emonTH, JeeNode RFM12 demo etc.
- `EmonHubMqttInterfacer`: Publish decoded data to MQTT

### Other Interfacers

*See interfacer specific readmes in [/conf/interfacer_examples](conf/interfacer_examples)*

- Direct Serial: space seperated value format
- Direct Serial (emontx3e): current emonTx V3 CSV key:value format (added by @owenduffy)
- Smilics energy monitors (added by @K0den)
- Victron Products e.g BMV 700 battery monitor (added by @jlark)
- ModBus e.g. FRONIUS Solar inverter (added by @cjthuys)
- Graphite timeseries DB (added by @hmm01i)
- SMASolar (added by @stuartpittaway)
- BMW EV API e.g state of charge, charging state etc. (added by @stuartpittaway)

***

Emonhub is included on the [emonsD pre-built SD card](https://github.com/openenergymonitor/emonpi/wiki/emonSD-pre-built-SD-card-Download-&-Change-Log) used by both the EmonPi and Emonbase. The documentation below covers installing the emon-pi variant of emonhub on linux for self build setups.

### 'Emon-Pi' variant
## Features

This variant of emonhub is based on [@pb66 Paul Burnell's](https://github.com/pb66) experimental branch adding:
This vesrion of emonhub is based on [@pb66 Paul Burnell's](https://github.com/pb66) original adding:

- Internal pub/sub message bus based on pydispatcher
- Publish to MQTT
Expand All @@ -37,58 +17,75 @@ This variant of emonhub is based on [@pb66 Paul Burnell's](https://github.com/pb
- Rx and tx modes for node decoding/encoding provides improved control support.
- json based config file option so that emonhub.conf can be loaded by emoncms

### [emonhub.conf configuration](https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md)
## Interfacers

### Installing Emonhub
### Default Interfacers

Emonhub requires the following dependencies:
- `EmonHubJeeInterfacer`: Decode data received from RFM69Pi & emonPi in [JeeLabs data packet structure](http://jeelabs.org/2010/12/07/binary-packet-decoding/) e.g. emonTx, emonTH, JeeNode RFM12 demo etc.
- `EmonHubMqttInterfacer`: Publish decoded data to MQTT in a format compatible with emonCMS.

Mosquitto: (see http://mosquitto.org/2013/01/mosquitto-debian-repository)
### Other Interfacers

wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
cd /etc/apt/sources.list.d/
*See interfacer specific readmes in [/conf/interfacer_examples](conf/interfacer_examples)*

Depending on which version of Debian you're using:
- Direct Serial: space seperated value format
- Direct Serial (EmonHubTx3eInterfacer): current emonTx V3 CSV key:value format (added by @owenduffy)
- Smilics energy monitors (added by @K0den)
- Victron Products e.g BMV 700 battery monitor (added by @jlark)
- ModBus e.g. FRONIUS Solar inverter (added by @cjthuys)
- Graphite timeseries DB (added by @hmm01i)
- SMASolar (added by @stuartpittaway)
- BMW EV API e.g state of charge, charging state etc. (added by @stuartpittaway)

sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list
***
## Installing Emonhub

or:
### emonScripts

sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list
It can be installed by making suitable modifications to the emonScripts script.

Update apt information:
### Manual Install

sudo apt-get update
Emonhub requires Mosquitto

sudo apt-get install -y mosquitto python3-pip python3-serial python3-configobj python3-requests
sudo pip3 install paho-mqtt
```bash
sudo apt-get update
sudo apt-get install -y mosquitto
```

It is recommended to turn off mosquitto persistence

sudo nano /etc/mosquitto/mosquitto.conf
```bash
sudo nano /etc/mosquitto/mosquitto.conf
```

Set

persistence false

Install the emon-pi variant of emonhub:
```text
persistence false
```

git clone https://github.com/openenergymonitor/emonhub.git
cd emonhub
sudo ./install.sh
Install emonhub:

The emonhub configuration guide can be found here:

[emonhub.conf configuration](https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md)
```bash
git clone https://github.com/openenergymonitor/emonhub.git
cd emonhub
git checkout stable
sudo ./install.sh
```

To view the emonhub log via terminal on the emonpi or emonbase:

journalctl -f -u emonhub -n 1000
```bash
journalctl -f -u emonhub
```

## Configuration

The emonhub configuration guide can be found here:

### EmonHub Emoncms config module
[emonhub.conf configuration](https://github.com/openenergymonitor/emonhub/configuration.md)

If you're using Emoncms on the same Raspberry Pi as emonhub, you may find the emoncms config module useful which provides in-browser access to `emonhub.conf` and `emonhub.log`:
## EmonHub Emoncms config module

https://github.com/emoncms/config
The emonhub config module is now included on the standard emoncms build. If you're using Emoncms on the same Raspberry Pi as emonhub, the emoncms config module provides in-browser access to `emonhub.conf` and `emonhub.log`
Loading

0 comments on commit 5159e8a

Please sign in to comment.