emonhub.conf not reporting to emoncms.org?

Thanks to those who have got me this far with my quest to monitor my PV and home electricity status using emonTx v3 with a R Pi/RFM69.  I'm almost there but the last hurdle of getting my data to emoncms.org eludes me.  

This is a copy of the log

2016-01-26 17:51:27,652 INFO emonCMS sending: http://localhost/emoncms/input
/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&
data=[[1453830687.53,8,3,540,0,0,24232,3000,3000,3000,3000,3000,3000,1,0,-
38]]&sentat=1453830687

2016-01-26 17:51:27,719 DEBUG emonCMS acknowledged receipt with 'ok' from 
http://localhost/emoncms

2016-01-26 17:51:37,337 DEBUG 983 NEW FRAME : 1453830697.34 OK 8 2 0 29 2 0 0 0 
0 93 94 184 11 184 11 184 11 184 11 184 11 184 11 1 0 0 0 (-41) 

2016-01-26 17:51:37,341 DEBUG 983 Timestamp : 1453830697.34

2016-01-26 17:51:37,342 DEBUG 983      Node : 8

2016-01-26 17:51:37,343 DEBUG 983    Values : [2, 541, 0, 0, 24157, 3000, 3000, 
3000, 3000, 3000, 3000, 1, 0]

2016-01-26 17:51:37,345 DEBUG 983      RSSI : -41

2016-01-26 17:51:37,350 DEBUG 983 Append to 'emonCMS' buffer => time: 
1453830697.34, data: [8, 2, 541, 0, 0, 24157, 3000, 3000, 3000, 3000, 3000, 
3000, 1, 0, -41], ref: 983

and this is my emon.conf file (with the API keys blanked

# SPECIMEN emonHub configuration file
# Note that when installed from apt, a new config file is written
# by the debian/postinst script, so changing this file will do
# nothing in and of itself.

# Each Interfacer and each Reporter has
# - a [[name]]: a unique string
# - a type: the name of the class it instantiates
# - a set of init_settings (depends on the type)
# - a set of runtimesettings (depends on the type)
# Both init_settings and runtimesettings sections must be defined,
# even if empty. Init settings are used at initialization,
# and runtime settings are refreshed on a regular basis.

# All lines beginning with a '#' are comments and can be safely removed.

#######################################################################
#######################    emonHub  settings    #######################
#######################################################################
[hub]

# loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
# see here : http://docs.python.org/2/library/logging.html
loglevel = DEBUG

#######################################################################
#######################        Reporters        #######################
#######################################################################
[reporters]

# This reporter sends data to emonCMS
[[emonCMS]]
    Type = EmonHubEmoncmsReporter
    [[[init_settings]]]
    [[[runtimesettings]]]
        url = http://localhost/emoncms #(defaults to emoncms.org)
        apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

[[emoncmsorg]]
    Type = EmonHubEmoncmsHTTPInterfacer
    [[[init_settings]]]
    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS,
        url = http://emoncms.org [1]
        apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        senddata = 1
        sendstatus = 1

#######################################################################
#######################       Interfacers       #######################
#######################################################################
[interfacers]

# This interfacer manages the RFM2Pi module
[[RFM2Pi]]
    Type = EmonHubJeeInterfacer
    [[[init_settings]]]
        com_port = /dev/ttyAMA0
    [[[runtimesettings]]]
        group = 210
        frequency = 433
        baseid = 15

#######################################################################
#######################          Nodes          #######################
#######################################################################
[nodes]

# List of nodes by node ID
# 'datacode' is default for node and 'datacodes' are per value data codes.
# if both are present 'datacode' is ignored in favour of 'datacodes'
[[10]]

Please will someone look at my emonhub.conf file and see if any errors can be spotted.

Edit - wrapped long lines - Moderator, BT

Robert Wall's picture

Re: emonhub.conf not reporting to emoncms.org?

You have filled in your Read & Write APIkey in the real file, haven't you?

And what is the [1] doing on the end of the URL?

rpjg51's picture

Re: emonhub.conf not reporting to emoncms.org?

Hi Rob

Thank you, yes I have put in the API keys.  I know not how the [1] at the end of the URL was copied in, however, I have removed it and it has not made any difference to the log report.

Could it be anything to do with nodes and datacodes?  I have played around with a bunch of these to varying effect.

Changing the [[10]] to [[8]] (as one would expect to be correct as the log refers to node 8, causes nothing to be updated on my localhost/emoncms.  

Including       

datacodes = L, h, h, h, h, l, l, l, l  

as recommended by the support documentation,   produces in the log a WARNING that these codes are not sufficient for the 26 bites of information being supplied.

​I have found better results excluding the data codes.  At least I get local reporting then.

Thanks for your interest

Rob

 

Robert Wall's picture

Re: emonhub.conf not reporting to emoncms.org?

To solve the datacodes question, you need to go back to your emonTx and determine what its NodeID is and which sketch it is running, from which we can put together the requisite strings. If there is any inconsistency, the packet gets rejected by emonhub, and won't get sent to either emoncms.org or to your local emoncms. By excluding "datacodes = ", you actually used the default "datacode = h", meaning the data stream was interpreted as all signed integers.

http://openenergymonitor.org/emon/node/11950#comment-37981 and Paul's follow-up below it might help a little.

pb66's picture

Re: emonhub.conf not reporting to emoncms.org?

The main issue here is the "EmonHubEmoncmsHTTPInterfacer" in the [reporters] section. Change

[[emoncmsorg]] 
        Type = EmonHubEmoncmsHTTPInterfacer 
        [[[init_settings]]] 
        [[[runtimesettings]]]
                pubchannels = ToRFM12, 
                subchannels = ToEmonCMS,

                url = http://emoncms.org
                apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                senddata = 1
                sendstatus = 1

To

[[emoncmsorg]] 
        Type = EmonHubEmoncmsReporter 
        [[[init_settings]]] 
        [[[runtimesettings]]]
                url = http://emoncms.org
                apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

​The "emon-pi" variant doesn't have "reporters" and the original version of emonHub doesn't have "EmonHubEmoncmsHTTPInterfacers".

Assuming you are using v1.2 (original) emonhub and a "stock" emontx v3 you shouldn't need to define the node, you can if you wish but it shouldn't be mandatory as it's payload only has signed integers so no other datatypes force the need for defining the node. Plus you are not using the nodes module and the input module doesn't make defining nodes mandatory either, so you should be good with an empty [nodes] section.

Paul

 

 

rpjg51's picture

Re: emonhub.conf not reporting to emoncms.org?

Hi Paul,

This is brilliant.  It works!  Thank you so much

Rob

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.