Community
OpenEnergyMonitor

Community

[solved] No Inputs in input list


(Hans) #1

I know I had this problem before and I followed the steps again. But I still get no inputs in input list. What have I forgotten?

My hardware is RPICT4T4
emonhub.conf

[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]]]
      nodeoffset = 11
      subchannels = ToEmonCMS,
       #url = http://localhost/emoncms #uncomment to save on local pi
       apikey = 4706b74a24b18bd418967xxxxxxxxx
       senddata = 0                    # Enable sending data to Emoncms.org
       sendstatus = 0                  # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list
       sendinterval= 30                # Bulk send interval to Emoncms.org in seconds


[nodes]

## See config user guide: https://github.com/openenergymonitor/emonhub/blob/emon-pi/conf/emonhub.conf

 [[11]]
   nodeoffset = 11   
   nodename = RPICT4T4
   hardware = RPICT4T4
   [[[rx]]]
       names = WP_L1, WP_L2, WP_L3, SERVER, T1, T2, T3, T4
       datacode = 0
       scales = 1,1,1,1,1,1,1,1
       units = W,W,W,W,C,C,C,C

The log file contains data:

2018-12-27 23:03:33,864 DEBUG    SerialDirect 34 Timestamp : 1545951813.86
2018-12-27 23:03:33,865 DEBUG    SerialDirect 34 From Node : 11
2018-12-27 23:03:33,866 DEBUG    SerialDirect 34    Values : [2070.04, 1944.99, 2364.22, 177.02, 31.19, -3.19, 22.81, 41.81]

How do I get these node into Input list.

Thanks for your attention

Hans


(Greebo) #2

Is datacode = 0 valid? From: https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md

b: byte, 1 byte
h: short integer, 2 bytes
i: integer, 4 bytes
l: long, 4 bytes
q: long long, 8 bytes
f: float, 4 bytes
d: double, 8 bytes
B: unsigned byte, 1 byte
H: unsigned integer, 2 bytes
I: unsigned integer, 4 bytes
L: unsigned long, 4 bytes
Q: unsigned long long, 8 bytes
c: char, 1 byte

(Hans) #3

Thanks for your answer. I did some experiments (because I’m not sure what I should use) I got the following results:

datacodes = d, d, d, d, d, d, d, d

2018-12-28 07:44:19,100 DEBUG SerialDirect 7 NEW FRAME : 11 95.26 49.89 50.89 161.83 33.31 -3.31 22.75 40.50

2018-12-28 07:44:19,101 WARNING SerialDirect 7 RX data length: 8 is not valid for datacodes [‘d’, ‘d’, ‘d’, ‘d’, ‘d’, ‘d’, ‘d’, ‘d’]

datacode = d
2018-12-28 07:49:47,666 DEBUG SerialDirect 10 NEW FRAME : 11 95.50 46.03 57.32 162.15 32.56 -3.19 22.75 39.88
2018-12-28 07:49:47,668 WARNING SerialDirect 10 Unable to decode as values incorrect for datacode(s)

datacode = i
2018-12-28 07:50:58,446 WARNING SerialDirect 3 Unable to decode as values incorrect for datacode(s)
2018-12-28 07:51:03,468 DEBUG SerialDirect 4 NEW FRAME : 11 95.35 46.68 56.68 155.94 32.06 -3.19 22.75 39.81

datacodes = i,d, d, d, d, d, d, d, d
2018-12-28 07:52:49,601 DEBUG SerialDirect 5 NEW FRAME : 11 98.76 50.46 47.42 172.39 31.75 -3.19 22.75 39.63
2018-12-28 07:52:49,603 WARNING SerialDirect 5 RX data length: 8 is not valid for datacodes [‘i’, ‘d’, ‘d’, ‘d’, ‘d’, ‘d’, ‘d’, ‘d’, ‘d’]

datacodes = d, d, d, d, d, d, d, d
2018-12-28 07:56:42,108 DEBUG SerialDirect 2 NEW FRAME : 11 95.35 39.24 55.60 166.22 31.44 -3.19 22.75 39.25
2018-12-28 07:56:42,110 WARNING SerialDirect 2 RX data length: 8 is not valid for datacodes [‘d’, ‘d’, ‘d’, ‘d’, ‘d’, ‘d’, ‘d’, ‘d’]

datacode = c
2018-12-28 07:54:45,909 DEBUG SerialDirect 3 NEW FRAME : 11 99.04 49.28 51.68 163.14 31.50 -3.19 22.75 39.44
2018-12-28 07:54:40,786 WARNING SerialDirect 2 Unable to decode as values incorrect for datacode(s)

datacode = c
2018-12-28 07:58:28,213 DEBUG SerialDirect 2 NEW FRAME : 11 100.15 47.90 55.77 165.87 31.69 -3.19 22.75 39.06
2018-12-28 07:58:23,190 WARNING SerialDirect 1 Unable to decode as values incorrect for datacode(s)

If I delete datacode:
2018-12-28 08:05:27,673 DEBUG SerialDirect 27 NEW FRAME : 11 98.80 45.67 57.14 158.63 31.50 -3.00 22.75 38.38
2018-12-28 08:05:27,675 DEBUG SerialDirect 27 Timestamp : 1545984327.67
2018-12-28 08:05:27,676 DEBUG SerialDirect 27 From Node : 11
2018-12-28 08:05:27,677 DEBUG SerialDirect 27 Values : [98.8, 45.67, 57.14, 158.63, 31.5, -3, 22.75, 38.38]

That looks great, but still no Inputs
in /home/pi/emonhub/src/emonhub_interfacer.py I found at line 344:

       # when no (default)datacode(s) specified, pass string values back as numerical values

When I use the example from http://lechacal.com/wiki/index.php/RPICT4T4 I see that this programm excepts “,” as delimiter to extract the values as I got it without datacode= in the emonhub.conf.

The fault must be somewhere else…


(Greebo) #4

Yes, I think you’re right - even with datacode=0 it was still able to interpret the values…

I think the next place to look is the upload to emoncms.org… Is there anything else in the emonhub log?


(Hans) #5

I did uncomment [[emoncmsorg]] because I log only local. But there is no change if I enable or disable it… I think I take another way. I write a wrapper and send the data via curl and the api to emoncms. But first of all I have to check how this works…


(Greebo) #6

You’ll need some way to get the data from EmonHub to EmonCMS. Just having the SerialInterfacer defined wont push the data into EmonCMS.

If you look at the first picture here: https://guide.openenergymonitor.org/technical/ you can see that emonhub pushes to MQTT and emonCMS reads from MQTT. So if you haven’t got the MQTT interfacer section enabled in your emonhub configuration (and MQTT installed and configured), then you need to use the HTTP interfacer (as you’ve attempted) to push the data into your local EmonCMS

Try fixing the url and apikey in your file:

You may also need to update senddata


(Brian Orpin) #7

Hi @Papageno, can you please post the details in the admin screen. Click on the Copy to Clipboard button next to Server Information and then just paste it to a reply here (no further formatting required).

I Don’t have an EmonPi so this is not something I can help with directly, but I note you started on this journey last March. A revised SD card image was released in October and it may be a good time to migrate to that if you have not already done so.

I am surprised you are having these issues as this should really work out of the box @TrystanLea @glyn.hudson may be able to help in more detail.

[edit] the configuation docs of EmonHub are here.

You should not need the section above to talk to the local EmonPi as that is done via MQTT I believe rather than via the HTTP API.


(Robert Wall) #8

Indeed it is, per Paul Burnell. It means that the data is NOT encoded as per that list, but is expressed in decimal (“human-readable”) characters exactly as the log file shows: 2070.04, 1944.99, 2364.22, ...

And datacode = 0 is also not the default. It’s probably best to think of it as zero = a number.


(Hans) #9

There was the fault!

I forgot to uncomment the url…

#url = http://localhost/emoncms #uncomment to save on local pi

Thanks for your help. Sometimes I can’t see the woodfor the trees


(Paul) #10

I believe this line in (emonhub emonpi variant’s) emonhub.conf should be set to “1” as in “send to emoncms.org, true”

senddata = 0                    # Enable sending data to Emoncms.org

If the url is not specified (eg commented out) it will default to emoncms.org (https://github.com/openenergymonitor/emonhub/blob/emon-pi/src/interfacers/EmonHubEmoncmsHTTPInterfacer.py#L24) so that line being commented out would not have prevented it sending to the hosted emoncms.org, but yes to “send” it to the local emoncms instance by http you would need to specify/change the url.

However if you are running the emonSD/emonPi image then the data should be transfered from emonhub to emoncms via MQTT not HTTP, that’s not to say you cannot use HTTP if you prefer, but MQTT should work, as Greebo and Brian say “out of the box”.

“0” is indeed a valid datacode, it is best remembered by thinking of it as either "0 = False (no decoding) or “Zero decoding required”, in code it is a logical test as to whether to continue through or bypass the decoding of the value(s).

Each interfacer has it’s own default datacode and in actual fact the default datacode for the serial interfacer IS “0” (https://github.com/openenergymonitor/emonhub/blob/emon-pi/src/emonhub_interfacer.py#L58) so you could just comment out the datacode line to the same effect as “datacode = 0”, either would denote an unspecified number of values that require no decoding. But “datacodes = 0,0,0,0,0,0,0,0” would differ slightly as it denotes exactly 8 values that require no decoding, any array of values that has less than or more than 8 values will be discarded, this stricter filtering can be advantageous in some circumstances.

I also notice that you have nodeoffset = 11 in multiple places, this is not required as you have the node id already specified in the payload, plus it would only ever get recognized in an incoming interfacer (eg serial, jee or socket etc) it has no effect in the http interfacer or the nodes section, although those entries will not cause any issues directly, they may cause some confusion down the line when trying to understand why they are there, best to remove them.


(Hans) #11

Thanks for clearing the issue. I’ve cleaned the emonhub.conf and still get data. Surprise :wink:

I have another construction which needs to be cleared. I’m working on adding 1-wire temperature readings (ds18b20). I see the sensors in

ls /sys/bus/w1/devices/

but not in the emonpi. I think it’s a [interfacer] issue, but I’m searching for a solution. You’ll see it maybe later in an extra post.


(Paul) #12

You have another thread on this topic already so I will reply there.


(Greebo) #13

Is this documented anywhere else besides the source code? I wasn’t able to find it in any of the documentation.


(Paul) #14

I really couldn’t say. Although I cannot recall seeing it, I don’t seem to have a good grasp of what is documented where.


(Robert Wall) #15

It’s certainly on my private crib sheet, but I think it isn’t anywhere in the documentation. It needs adding to: https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md

Methinks one more for your ‘to do’ list, @Gwil


(George) #16

Also not getting any data on setup/inputs, nothing listed…
nothing listed…

gone through everything above and still no luck.

missing something (RPI with RPICT8)

G


(Hans) #17

Did you test the basic function like mentioned in the wiki. http://lechacal.com/wiki/index.php/RPICT8 ?

What is the output?
Whats in the emonhub.log? Are there any failures mentioned?


(George) #18

Some data collected directly from /dev/… attached.

emonhub.conf attached.

only error I am getting in the emonhub log file is a warning because apikey is not specified which is expected as I’m trying to log locally.

G

emonhub.txt (3.5 KB)

serial-1911.txt (9.9 KB)


(George) #19

changing emonhub.conf to look like:

[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
datacode = 0

rebooting, will advise.

… looking better, I’m seeing values in the emonhub log, fixing a type, rebooting,
will advise.

ok, emonhub.log (attached) looks good, got values being seen now, but still nothing under setup/inputs ?

emonhub.txt (14.5 KB)

G


(Hans) #20

uncomment this and put your write API in the next line, then it should work.