GithubHelp home page GithubHelp logo

jackkelly / rfm_edf_ecomanager Goto Github PK

View Code? Open in Web Editor NEW
30.0 18.0 13.0 6.14 MB

Communicate with EDF EcoManager Transmitter Plugs; Whole House TX and CurrentCost Whole House TX using a 433MHz RFM12b and a ATmega328 micro controller

License: MIT License

C++ 82.00% C 17.34% Shell 0.28% Arduino 0.38%

rfm_edf_ecomanager's Introduction

This code runs on a Nanode / Arduino with an HopeRF RFM12b 433MHz wireless module and wirelessly communicates with Current Cost home energy monitors and EDF EcoManager monitors. The main aim of this code is the robust gathering of data from an arbitrary number of EDF EcoManager Wireless Transmitter Plugs and a small number of Current Cost whole-house "sensable" transmitters for tracking the state of the majority of appliances in a building.

Related projects

My RFM_ecomanager_logger code logs data from rfm_edf_ecomanager on a PC.

Current status

The code is "feature complete" in that it implements all of the features listed in the user manual.

Known issues

The code doesn't work especially well with Current Cost Individual Appliance Monitors (CC IAMs). See this issue for more details.

More info

Please see the user manual for more info.

rfm_edf_ecomanager's People

Contributors

jackkelly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rfm_edf_ecomanager's Issues

Tidy up const variables

All const variables should probably be defined in consts.h rather than in the classes. Then add note to wiki about where to find consts.

Debug code causes compilation errors

Pulled down the latest code after your updates of last night, but the debug code (to display output etc) now causing IDE (1.0.1 W8 64-bit) compilation errors again:

debug.cpp: In function 'void debug(DebugLevel, const char*, ...)':
debug.cpp:14: error: 'millis' was not declared in this scope
debug.cpp:14: error: 'sprintf' was not declared in this scope
debug.cpp:15: error: 'Serial' was not declared in this scope
debug.cpp:24: error: 'va_list' was not declared in this scope
debug.cpp:24: error: expected `;' before 'vl'
debug.cpp:25: error: 'vl' was not declared in this scope
debug.cpp:25: error: 'va_start' was not declared in this scope
debug.cpp:26: error: 'vsprintf' was not declared in this scope
debug.cpp:27: error: 'va_end' was not declared in this scope

Pairing function

2 modes:

auto_pair = true:
automatically accept all pairing requests (default)

auto_pair = false
require user to instruct pairing.

pair_id defaults to INVALID_ID
Constantly listen for pairing requests.
If request is received {
if pair_with != INVALID_ID then pair() else {
notify user over serial: {pr: } ("pr" is short for pairing request).
If auto_pair==true then set pair_with to .
}

If in auto_pair == false mode then if user wants to accept pairing request then respond with "{p: }" (short for "pair with "). Store a single id to pair with on Nanode in variable pair_with.

pair(){
if TRX {
transmit ACK;
store pair_with in cc_trx_ids;
} else {
store pair_with in cc_txs
}
Serial.print("{p: });
pair_with = INVALID_ID;
}

Why do we sometimes fail to receive TRXs?

If experiment with sending "ON" command to "prod" TRX works then:

  • don't make this the default setting.
    • Instead add a command to en/disable this feature.
    • Modify logger to enable this at init.
    • Modify logger to filter double-responses.
    • Document.
  • reduce retries

If experiment fails then try sending ACK instead.

Or try lengthening TRX timout

Check tuning for TRXs

Make absolutely sure that one missing TRX can't affect another TRX

Maybe the problem is fast clock recovery?

Auto pair with TXs

When in auto-pair mode, automatically pair with all heard TXs (and TRXs?)

Use dynamic, sorted array for trxs and txs

Appending happens very rarely so can be slow. Searching happens very very often so should be fast.

Template which can accept cc_tx and cc_trx. Subclass to add find_next_expect_tx

IDE compilation errors

Still getting errors (even after Jack's revision) at compile time. IDE 1.0.1 (and 1.0.0) on Windoze 8
Rfm12b.cpp.o: In function Rfm12b::interrupt_handler()': C:\Users\Andy\AppData\Local\Temp\build6281000564122575244.tmp/Rfm12b.cpp:78: undefined reference tospi::select(bool)'
C:\Users\Andy\AppData\Local\Temp\build6281000564122575244.tmp/Rfm12b.cpp:90: undefined reference to spi::select(bool)' C:\Users\Andy\AppData\Local\Temp\build6281000564122575244.tmp/Rfm12b.cpp:99: undefined reference tospi::select(bool)'

Tinker with 1/2-wave aerial

Turn on just a single TX.

Count number of received packets in 10 minutes.

Add 1/2 wave aerial. Count again.

Doesn't poll TRXs reliably

{id: 639, t: 1725200, s0: 12, s2: 0} {id: 28, t: 1726609, s0: 502} {id: 639, t: 1731272, s0: 12, s2: 0} <-- 6072 ms since last poll (correct) {id: 28, t: 1732793, s0: 487} {id: 28, t: 1738977, s0: 492} {id: 28, t: 1745161, s0: 493} {id: 28, t: 1751314, s0: 503} {id: 28, t: 1757405, s0: 482} {id: 639, t: 1761426, s0: 12, s2: 0} <-- 30154ms since last poll (5 times too long!) {id: 28, t: 1763494, s0: 504} {id: 28, t: 1769585, s0: 499} {id: 639, t: 1773362, s0: 12, s2: 0} <-- 11936ms since last poll (2 times too long!) {id: 28, t: 1775707, s0: 497} {id: 639, t: 1779434, s0: 12, s2: 0} <-- 6072ms since last poll (correct) {id: 28, t: 1781860, s0: 508}

maybe this is an RF problem?

Optimise for size

Arduino creates much smaller binaries. Supposedly it's optimising for size. Use this setting in my makefile.

Talk to a single emonTX

As rapidly as possible. Allow for multiple parameters, e.g. real, reactive, voltage, 3 CT clamps, temp.

Try using unmodified emonTX code first.

CC IAMs not being received.

I Thought Id had a problem with range/location of my Nanode vs IAMs, as not all data was being received.
However, I now believe Im not receiving ANY data from CC IAMs, but EDF IAMs ok, as are CC Optismart and Clamps.

Guidance on opening the whole house transmitter.

Hi, thanks it's brilliant to have the photo's and that understanding of the wireless code. I'm hacking for an energy monitoring project with Horizon Digital Economy research institute at the University of Nottingham.

I find the transmitter box clicks apart easily except would not part at two points a third of the way down from the top. I can see now that it's due to two legs which fit into the two hollow pillars. By the feel of it I was expecting screws but it was clear that there weren't any so I assumed glue. Did you have any trouble parting the case at that point? Are those legs glued in perhaps and did you use any particular tool or technique to get in?

Fascinating that the black areal is fake - it explains the odd feel of its rotation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.