EmonWRT: Difference between revisions

From lechacal
Jump to navigation Jump to search
 
(17 intermediate revisions by the same user not shown)
Line 5: Line 5:
'''''<br />'''''
'''''<br />'''''


EmonWRT is a one unit system for energy monitoring. It takes measurements of the consumption of an electrical installation and post the data on a server (Emoncms). You can then view the data on your computer or phone.
[[EMONWRT2 | EmonWRT2 version here]]
 
EmonWRT is a one unit system for energy monitoring. It measures usage of an electrical installation and post data on a server (Emoncms). You can then view the data on your computer or phone.


It combines the EmonTX sensor board and the WR703N wifi router together. Emontx sensor node interfaces with sensors like Current Transformers/ Temperature and Interrupt.
It combines the EmonTX sensor board and the WR703N wifi router together. Emontx sensor node interfaces with sensors like Current Transformers/ Temperature and Interrupt.
Line 11: Line 13:
This is a powerful system for a small installation like a domestic house with an access to the internet. <br />  
This is a powerful system for a small installation like a domestic house with an access to the internet. <br />  


[http://www.ebay.co.uk/itm/141306538724 The EmonWRT is currently for sale here.]
[http://lechacal.com/shop/?16,emonwrt The EmonWRT is currently for sale here.]


[[Image:diagram_small.png|directct1temp1]]<br />
[[Image:diagram_small.png|directct1temp1]]<br />
Line 62: Line 64:




[[Image:Im121114001_1.jpg|right]]<br />
[[Image:Wr+emontx crop.png|900px]]<br />
 


[[Image:inside_emonwrt.jpg]]


===EmonTX: The sensor node module===
===EmonTX: The sensor node module===
Line 70: Line 72:
The EmonWRT uses the open source EmontX V2.2 from [http://openenergymonitor.org openenergymonitor.org] as sensor interface. The only difference is the RF module not being installed. It's not needed and keeps cost down.
The EmonWRT uses the open source EmontX V2.2 from [http://openenergymonitor.org openenergymonitor.org] as sensor interface. The only difference is the RF module not being installed. It's not needed and keeps cost down.


The sketch can be uploaded to the board to work for the application that you need. This is a default [http://lechacal.com/EmonWRT/emonTx_CT123_temperature_NORF_WR703N.zip sketch] to work with CT123 and temperature together.
The sketch can be uploaded to the board to work for the application that you need. This is a default [http://lechacal.com/EmonWRT/EmonWRT_CT123_T_v1_5.ino sketch] to work with CT123 and temperature together.


A quick overview of the Emontx V2<br /> * 3 Current transformer ports.<br /> * 1 Temperature port (DS18B20).<br /> * 1 Interrupt port.<br /> * 1 AC Adaptor.<br /> * 1 FTDI port for flashing the mcu.<br />
A quick overview of the Emontx V2<br /> * 3 Current transformer ports.<br /> * 1 Temperature port (DS18B20).<br /> * 1 Interrupt port.<br /> * 1 AC Adaptor.<br /> * 1 FTDI port for flashing the mcu.<br />
Line 141: Line 143:
=Files=
=Files=


[http://lechacal.com/EmonWRT/EmonWRT_CT123_T_v1_5.ino Default EmonTX Sketch - Ct123 & Temperature]<br />
[http://lechacal.com/EmonWRT/EmonWRT_CT123_T_v1_6.ino Default EmonTX Sketch - Ct123 & Temperature]<br />
[http://lechacal.com/EmonWRT/system/v1.3/emonwrt_forwarder.sh emonwrt_forwarder.sh ]<br />
[http://lechacal.com/EmonWRT/system/v1.3/emonwrt_forwarder.sh emonwrt_forwarder.sh ]<br />
[http://lechacal.com/EmonWRT/system/v1.3/config/emonwrt Configuration file]
[http://lechacal.com/EmonWRT/system/v1.3/config/emonwrt Configuration file]
Line 149: Line 151:
[[Startup_guide_emonwrt | Startup Guide]]
[[Startup_guide_emonwrt | Startup Guide]]


[[update_emonWRT| Install/Update EmonWRT on WR703N]]
[[update_emonWRT| (old) Install/Update EmonWRT on WR703N]]
 
[[update_emonWRT_from1.5 | (New) Install/Update EmonWRT on WR703N]]


[[forwarder_debug| Start the forwarder in debug mode]]
[[forwarder_debug| Start the forwarder in debug mode]]


[[FIRMWARE_UPLOAD| Upload Firmware]]
[[FIRMWARE_UPLOAD| Upload Firmware]]
[[Timeout for some wifi connections]]
=Version History=
==Sketch==
===1.6===
==EmonWRT Software==
===1.3===
* Support for OpenWRT Attitude Adjustment
===1.4===
* Support for OpenWRT Barrier Breaker

Latest revision as of 15:29, 28 July 2016

EmonWRT Wifi Energy Monitoring Device with OpenWRT and Emontx.


EmonWRT2 version here

EmonWRT is a one unit system for energy monitoring. It measures usage of an electrical installation and post data on a server (Emoncms). You can then view the data on your computer or phone.

It combines the EmonTX sensor board and the WR703N wifi router together. Emontx sensor node interfaces with sensors like Current Transformers/ Temperature and Interrupt.

This is a powerful system for a small installation like a domestic house with an access to the internet.

The EmonWRT is currently for sale here.

directct1temp1

  • Simple to use with web interface for configuration.
  • Connect with Wired or Wifi.
  • Wall mountable.
  • Single box system.
  • Open source components like OpenWRT and Emontx.

EmonWRT vs Raspberry Pi. The main motivation for developing the EmonWRT was to increase robustness. For the long run the RaspberryPi solution can become vulnerable due to the operating system hosted on a SD card. High quality SD cards can be used but a higher risk of failure still remains. The EmonWRT contains the operating system on an embedded flash memory and will solidly keep on running.

Technical Specifications

  • 3 Current Sensor Ports
  • 1 Temperature Sensor Port
  • 1 Pulse Counting Port
  • 1 AC/AC Adaptor Port
  • 1 FTDI port (internal)


  • 1 Ethernet Port
  • 1 USB port
  • 1 MicroUSB Power Supply port


  • Operating System: OpenWRT 12.9 Attitude Adjustment
  • Micro Controller Unit: Atmega328 (Arduino Bootloader)
  • Current Sensor burden resistor: 24Ω (or 18Ω)
  • Wifi Specifications: See TP-link WR703N
  • Dimensions: 70x62x35mm

Recommended Sensors

Current: SCT-013-000
Temperature: DS18B20
Pulse Detector: TSL257
AC/AC Adaptor: 77DB-06-09

Defaults

IP Address (LAN): 192.168.2.1
IP Address (WAN): DHCP
Username: root
Password: admin

Hardware

The WR703N wifi routers is used to connect to the home router (wired or wireless) and forward the data to an Emoncms server such as emoncms.org
The two units are connected together with serial interface.




EmonTX: The sensor node module

The EmonWRT uses the open source EmontX V2.2 from openenergymonitor.org as sensor interface. The only difference is the RF module not being installed. It's not needed and keeps cost down.

The sketch can be uploaded to the board to work for the application that you need. This is a default sketch to work with CT123 and temperature together.

A quick overview of the Emontx V2
* 3 Current transformer ports.
* 1 Temperature port (DS18B20).
* 1 Interrupt port.
* 1 AC Adaptor.
* 1 FTDI port for flashing the mcu.

More info on the Emontx here


WR703N Wifi Router

The TP-LINK WR703N Wifi router runs with OpenWRT operating system.

The configuration of the router is quite simple using the Luci web interface that comes with OpenWRT. One can at easy configure the router to connect to a home wireless router.

Emontx and WR703N communicates together using serial communication with /dev/ttyATH0

Configuration

The web interface

OpenWRT uses Luci for configuration. The EmonWRT has a page on Luci where APikey, emoncms server and node ID can be configured.

Apikey is the long number that identify the account on the Emoncms server. It can be found on the emoncms server in the API help page. The Read & Write apikey key should be copy pasted here.
EmonCMS Hostname is the location of the emoncms server to use. It can either be emoncms.org or your own server. If using your own emoncms server you might need to indicate the full path here. e.g. 192.168.1.50/emoncms/
Node ID is a number that identify the device. If you have several EmonWRT (or emontx) you can change this number here to differentiate between them on the server.


Background Configuration

The actual configuration is saved in a text configuration file /etc/config/emonwrt.

Arduino Sketch

The emontx has an atmega328 which can be programmed with the Arduino IDE. To upload a sketch you will have to open the EmonWRT box and connect a FTDI/USB cable to the FTDI port on the emontx. The default arduino sketch can be found Here. The library from OEM is also needed for this. It can be found here. This sketch will output three current sensors (CT1 2 and 3) and temperature.

Serial String Format

If you decide to write your own sketch you need to output on serial interface the data in the following format:

EMONWRT CSV_DATA

CSV_DATA being each output field separated by a comma. Here is an example for three fields:

EMONWRT 75,45,4058
EMONWRT 79,51,4060

This format is necessary for the forwarder program in the WR703N.

Data Forwarder script

The WR703N router has a script written in bash to grab the data from the EmonTX and send them over to the emoncms server. This script is called emonwrt_forwarder.sh. You can download it below.
The script is launched when the WR703N boots up using init.d mechanism.

RF Gateway

The EmonWRT can optionally be used as a gateway for other RF sensors. Using the RFM12B module the EmonWRT will read and receive all data from other sensors equipped with the same module (other emontx, emonTH, tinyTX etc...).
To enable the RF forwarding from your sensor to EmonCMS one should set the RF variable to 1 in the Arduino sketch.

Internally the emontx inform the forwarder script using a RFNODE header in the serial string. The format is as follow:

RFNODE <node_ID> <csv_DATA>

For example with a node ID 10 the string will look like:

RFNODE 10 165,0,0,2781
RFNODE 10 168,0,0,2781

Files

Default EmonTX Sketch - Ct123 & Temperature
emonwrt_forwarder.sh
Configuration file

Howtos

Startup Guide

(old) Install/Update EmonWRT on WR703N

(New) Install/Update EmonWRT on WR703N

Start the forwarder in debug mode

Upload Firmware

Timeout for some wifi connections

Version History

Sketch

1.6

EmonWRT Software

1.3

  • Support for OpenWRT Attitude Adjustment

1.4

  • Support for OpenWRT Barrier Breaker