KeyError: 'booster_dhw'

Asked by alphaomega

Note:
I split my question (KeyError and lftp) into two different questions in order to keep it clean, as Robert suggested.
To keep the context, I copied Robert's comments below. Sorry about any inconvenience that I may have caused.
________________

Hello,

I have now put everything to my NSLU2 (NAS form Cisco/ Linksys with Debian modified FW).
Almost everything seems to work, i.e. the daemon runs in the background, but then in log I find this:

Starting ...
Heatpump reports Version 2.16
Using protocol definition from alphaomega (testing on a Tecalor THZ 303 SOL = Stiebel Eltron LWZ 303 SOL is still in progress)
Up and running
=========
booster_dhw
---------
external: /bin/sh: None: command not found
Error: Return code was 127!
Traceback (most recent call last):
  File "heatpumpMonitor.py", line 114, in doMonitor
    t.check(values)
  File "/thz/thresholdMonitor.py", line 45, in check
    self._updateBaseline(values)
  File "/thz/thresholdMonitor.py", line 77, in _updateBaseline
    self._referenceValues[value] = values[value]
KeyError: 'booster_dhw'

=========

DHW obviously means "domestic hot water". But what exactly does this python error message mean?
I found this explanation (http://wiki.python.org/moin/KeyError):
Python raises a KeyError whenever a dict() object is requested (using the format a = adict[key]) and the key is not in the dictionary.
Well, this does not help me much, because I do not understand it, sorry. :-/

I found the "booster_dhw" in "thresholdMonitor.py":
[...]
# Main program: parse command line and start processing
def main():
    import config_manager, report
    config = config_manager.ConfigManager("heatpumpMonitor.ini")
    aT = ThresholdMonitor(config, report.Report(config))
    aT.gotQueryError()
    aT.gotQueryError()
    aT.gotQueryError()
    aT.check({"booster_dhw": 100, "booster_heating": 200})
    aT.check({"booster_dhw": 101, "booster_heating": 200})
    aT.check({"booster_dhw": 100, "booster_heating": 200})
[...]

Thanks for any hints!

Best regards,
Alphaomega

-------------------------------
Robert Penz wrote:

hmmm ... which firmware version config are you using?

The Version_4.38.ini has a OperationalState section which sets these values, if you're using a config which does not set it, you need to set the following entry to nothing in heatpumpMonitor.ini

[Threshold]
thresholdCounters = booster_dhw booster_heating

-------------------------------
Alphaomega wrote:

My THZ 303 SOL has FW 2.16, so I copied "Version_2.06.ini" to "Version_2.16.ini" and edited line "versions = 2.06" to "versions = 2.16". I did not change anything else, because I do not know, what I would need to change, if anything at all.
My problem is that I do not yet know how to efficiently monitor my heatpump in order to know if/ what to change. Do you have some general hints how one should do this?

So I do not use "Version_4.38.ini" and do not need to remove "booster_dhw booster_heating" from thresholdCounters?

DHW obviously means domestic hot water ("Warmwasser"), but what exactly is the above mentioned key "booster_dhw"?
Is this something which is only available in 4.38 but not in 2.x6?

PS:
I have edited as you suggested above:

[Threshold]
thresholdCounters =

... and started again:

root@nslu /var/log $ python /thz/heatpumpMonitor.py start

started with pid 30478

There is no error now, and also the log looks good:

root@nslu /var/log $ cat heatpumpMonitor.log
Starting ...
Heatpump reports Version 2.16
Using protocol definition from alphaomega (testing on a Tecalor THZ 303 SOL = Stiebel Eltron LWZ 303 SOL is still in progress)
Up and running

The process (daemon) still seems to run:

root@nslu /var/log $ ps -A | grep 30478
30478 ? 00:00:00 python

However, /var/www/graphs is still empty. :-(

How long do I have to wait until I see something there? And which file(s) whould be there?

According to "render.py" in line "def __init__(self, filename="heatpumpMonitor.rrd", outputPath = "."):" a file "heatpumpMonitor.rrd" should be saved in the current path (outputPath = ".") of "heatpumpMonitor.py", but there is no such "heatpumpMonitor.rrd" file.
What does this mean? Do I have to wait longer? Or should I not edit "thresholdCounters =", because I use 2.16 (not 4.38)?

Thanks a lot for your help, Robert!

Kind regards,
Alphaomega

-------------------------------
Robert Penz wrote:

- dhw booster means "elektrisches nachheizregister" in german
- forget th the def __init__ these are only default values which will be overwritten by the .ini file .. I really don't know why everyone looks there if there is a config file
- the how long depends on your settings, default is every 5 times so 5 mins

-------------------------------
Alphaomega wrote:

Thanks, Robert, I now understand (by the way, I am German ;-) but was not 100% sure that booster means "E-Heizstab").
About the def __init__: I did only look there, because I tried to find and understand the KeyError message.
I am really new to Python and at the moment have no other chance to try to understand what happens here with my heatpump.
Now I let run the script (daemon) in the background a while, but the /var/www/graphs/ is still empty.
No errors, but that does not help me further, unfortunately.

Best regards,
Alphaomgea

Question information

Language:
English Edit question
Status:
Solved
For:
heatpumpMonitor Edit question
Assignee:
No assignee Edit question
Solved by:
Robert Penz
Solved:
Last query:
Last reply:
Revision history for this message
Robert Penz (robert-penz-name) said :
#1

hmmm .. edit the line 218 in render.py and replace

g.write(debug=False)

with

g.write(debug=True)

Tell me the output now.

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.

Revision history for this message
alphaomega (alpha-omega) said :
#3

Sorry, Robert, that it took so long to answer, but only now I came a little bit further; however, still no graphs.
I followed Anderas' Wiki, and in addition I copied the contents of /html to /var/www. Or was this wrong?
Here is the Log with debug=True:

root@nslu /var/log $ cd /thz
root@nslu /thz $ python heatpumpMonitor.py start

started with pid 11658
root@nslu /thz $ cd /var/log
root@nslu /var/log $ ls -al
total 16
drwxr-xr-x 2 root root 4096 Apr 13 21:41 .
drwxr-xr-x 14 root root 4096 Feb 24 22:11 ..
-rw-rw-rw- 1 root root 4232 Apr 13 21:41 heatpumpMonitor.log
root@nslu /var/log $ cat heatpumpMonitor.log
Starting ...
Heatpump reports Version 2.16
Using protocol definition from alphaomega (currently testing for THZ 303 SOL)
Up and running
('/var/www/graphs/fans_week_small.png', '--start 1270582895 --end 1271187695 --step 300 --title "Fans" --vertical-label percent --width 400 --height 100 --color ARROW#FFFFFF --color AXIS#FFFFFF --color BACK#333333 --color CANVAS#333333 --color FONT#FFFFFF --color FRAME#AAAAAA --color MGRID#CCCCCC --color SHADEA#000000 --color SHADEB#111111 DEF:vent_speed_set=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:vent_speed_set:AVERAGE LINE:vent_speed_set#FF2802:"ventilator speed set" DEF:extr_speed_actual=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:extr_speed_actual:AVERAGE LINE:extr_speed_actual#D9FF02:"extractor speed actual" DEF:extr_speed_set=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:extr_speed_set:AVERAGE LINE:extr_speed_set#84FE19:"extractor speed set" DEF:vent_speed_actual=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:vent_speed_actual:AVERAGE LINE:vent_speed_actual#FFA902:"ventilator speed actual"')
('/var/www/graphs/enduser_temperatures_week_small.png', '--start 1270582895 --end 1271187695 --step 300 --title "Enduser temperatures" --vertical-label "degree celsius" --width 400 --height 100 --color ARROW#FFFFFF --color AXIS#FFFFFF --color BACK#333333 --color CANVAS#333333 --color FONT#FFFFFF --color FRAME#AAAAAA --color MGRID#CCCCCC --color SHADEA#000000 --color SHADEB#111111 DEF:dhw_temp=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:dhw_temp:AVERAGE LINE:dhw_temp#FF2802:"DHW temperature" DEF:return_temp=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:return_temp:AVERAGE LINE:return_temp#A31E00:"return temperature" DEF:inside_temp=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:inside_temp:AVERAGE AREA:inside_temp#75DB15:"inside temperature" DEF:flow_temp=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:flow_temp:AVERAGE LINE:flow_temp#FFA902:"flow temperature" DEF:outside_temp=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:outside_temp:AVERAGE AREA:outside_temp#025AFF:"outside temperature"')
('/var/www/graphs/internaltemps_week_small.png', '--start 1270582895 --end 1271187695 --step 300 --title "heat pump internal temperatures" --vertical-label "degree celsius" --width 400 --height 100 --color ARROW#FFFFFF --color AXIS#FFFFFF --color BACK#333333 --color CANVAS#333333 --color FONT#FFFFFF --color FRAME#AAAAAA --color MGRID#CCCCCC --color SHADEA#000000 --color SHADEB#111111 DEF:condenser_temp=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:condenser_temp:AVERAGE LINE:condenser_temp#D9FF02:"condenser temperature" DEF:dew_point_temp=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:dew_point_temp:AVERAGE LINE:dew_point_temp#025AFF:"dew point temperature" DEF:hot_gas_temp=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:hot_gas_temp:AVERAGE LINE:hot_gas_temp#84FE19:"hot gas temperature" DEF:evaporator_temp=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:evaporator_temp:AVERAGE LINE:evaporator_temp#FF2802:"evaporator temperature"')
('/var/www/graphs/humidity_week_small.png', '--start 1270582895 --end 1271187695 --step 300 --title "Humidity" --vertical-label "rel. humidity" --width 400 --height 100 --color ARROW#FFFFFF --color AXIS#FFFFFF --color BACK#333333 --color CANVAS#333333 --color FONT#FFFFFF --color FRAME#AAAAAA --color MGRID#CCCCCC --color SHADEA#000000 --color SHADEB#111111 DEF:rel_humidity=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:rel_humidity:AVERAGE AREA:rel_humidity#025AFF:"relative humidity"')
('/var/www/graphs/fans_3hours_small.png', '--start 1271176895 --end 1271187695 --step 60 --title "Fans" --vertical-label percent --width 400 --height 100 --color ARROW#FFFFFF --color AXIS#FFFFFF --color BACK#333333 --color CANVAS#333333 --color FONT#FFFFFF --color FRAME#AAAAAA --color MGRID#CCCCCC --color SHADEA#000000 --color SHADEB#111111 DEF:vent_speed_set=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:vent_speed_set:AVERAGE LINE:vent_speed_set#FF2802:"ventilator speed set" DEF:extr_speed_actual=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:extr_speed_actual:AVERAGE LINE:extr_speed_actual#D9FF02:"extractor speed actual" DEF:extr_speed_set=/var/lib/heatpumpMonitor/heatpumpMonitor.rrd:extr_speed_set:AVERAGE LINE:extr_speed_set#84FE19:"extractor speedroot@nslu /var/log $

Revision history for this message
alphaomega (alpha-omega) said :
#4

PS:
The file /var/run/heatpumpMonitor.pid does not contain the PID, but hundreds of identical lines, growing...:

ERROR: mmaping file '/var/lib/heatpumpMonitor/heatpumpMonitor.rrd': Invalid argument

Revision history for this message
alphaomega (alpha-omega) said :
#5

PS2:
In fact the deamon only runs when the file /var/lib/heatpumpMonitor/heatpumpMonitor.rrd is created ("touch") before, because it does not exist before. If I run python heatpumpMonitor.py start without that file, The Log tells me this:

root@nslu /thz $ python heatpumpMonitor.py start

started with pid 12082
root@nslu /thz $ cat /var/log/heatpumpMonitor.log
Starting ...
Heatpump reports Version 2.16
Using protocol definition from alphaomega (currently testing for THZ 303 SOL)
=========
Error: RRD file missing
---------
Traceback (most recent call last):
  File "heatpumpMonitor.py", line 72, in doMonitor
    r = render.Render(config.getDatabaseFile(), config.getRenderOutputPath())
  File "/usr/local/sbin/render.py", line 162, in __init__
    raise IOError, "Error: RRD file missing"
IOError: Error: RRD file missing

=========

I.e., obviously /var/lib/heatpumpMonitor/heatpumpMonitor.rrd is not created.
When I create it as an empty (zero bytes) file, the daemon starts without complaining about a missing RRD file, but then strange things happen as described above under PS1 (of course, because the RRD file is invalid).

I am really at a loss here and have the feeling that I will never get this running. Any ideas?
Kind regards, Alphaomega

Revision history for this message
Robert Penz (robert-penz-name) said :
#6

comment the line 126

deamon.startstop(config.getLogFile(), config.getPidFile())

in heatpumpMonitor.py out. now the programm does not fork into the background. this should it make easier to debug.

About you IOError: Error: RRD file missing, thats correct the file needs to be created by _createRRD(self, filename) in storage.py. Put a print "create RRD file", filename debug line into it if the file gets created.

Revision history for this message
alphaomega (alpha-omega) said :
#7

Thanks for the hint re. the background, Robert. Debugging will be a little bit easier now.
I have added two lines for debugging purposes to function _createRRD(self, filename) of storage.py like this:

        print "will now try to create RRD file", filename # added to debug

        # With those setup, we can now created the RRD
        myRRD = RRD(filename, step=step, ds=dss, rra=rras, start=int(time.time()))
        myRRD.create(debug=False)

        print "have tried to create RRD file", filename # added to debug

When calling heatpumpMonitor.py, it tells me that the rrd filename is "/var/lib/heatpumpMonitor/heatpumpMonitor.rrd".
However, this file is not created, i.e. the directory /var/lib/heatpumpMonitor/ is empty.
I.e. myRRD = RRD... etc. does not seem to work. Does this mean that my RRD installation is corrupt? It seems so.

root@nslu /usr/local/sbin $ python heatpumpMonitor.py start
Starting ...
Heatpump reports Version 2.16
Using protocol definition from alphaomega (currently testing for THZ 303 SOL)
will now try to create RRD file /var/lib/heatpumpMonitor/heatpumpMonitor.rrd
ERROR: Duplicate DS name: l
have tried to create RRD file /var/lib/heatpumpMonitor/heatpumpMonitor.rrd
=========
Error: RRD file missing
---------
Traceback (most recent call last):
  File "heatpumpMonitor.py", line 72, in doMonitor
    r = render.Render(config.getDatabaseFile(), config.getRenderOutputPath())
  File "/usr/local/sbin/render.py", line 162, in __init__
    raise IOError, "Error: RRD file missing"
IOError: Error: RRD file missing

=========

I will try to reinstall RRD and then try again. Maybe you have an idea that also something else might be wrong.
Have a nice weekend. Kind regards, Alphaomega

Revision history for this message
Robert Penz (robert-penz-name) said :
#8

use myRRD.create(debug=True) instead of myRRD.create(debug=False)

and also try on of the examples from the pyrrd homepage

http://code.google.com/p/pyrrd/source/browse/trunk/examples/example5.py

does this create a file?

Revision history for this message
alphaomega (alpha-omega) said :
#9

The example codes complains that "example5.data" is missing:

root@nslu /thz $ python example5.py
Traceback (most recent call last):
  File "example5.py", line 56, in <module>
    for line in open(datafile).readlines():
IOError: [Errno 2] No such file or directory: 'example5.data'

However, a file "example5.rrd" (135996 bytes long, with a lot of question marks in it) is created:

RRD0003/%??C+[<ds_in_pktsABSOLUTE???ds_in_bits
ABSOLUTE???ds_out_pktsABSOLUTE???ds_out_bitsABSOLUTE
???AVERAGE?AVERAGE?
AVERAGE?<?v?CU
UU
U??
???
????
???
??????????????????????????
????????????????????????????????
...

I have no idea where the files defined in the python code should come from:

filename = 'example%s.rrd' % exampleNum
datafile = 'example%s.data' % exampleNum
graphfile = 'example%s-%s.png'
graphfileLg = 'example%s-%s-large.png'

Revision history for this message
alphaomega (alpha-omega) said :
#10

PS - And here is the output with debug=True:

root@nslu /usr/local/sbin $ python heatpumpMonitor.py start
Starting ...
Heatpump reports Version 2.16
Using protocol definition from alphaomega (currently testing for THZ 303 SOL)
will now try to create RRD file /var/lib/heatpumpMonitor/heatpumpMonitor.rrd
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', '--start 1271575321 --step 60 DS:l:GAUGE:900:U:U DS:e:GAUGE:900:U:U DS:o:GAUGE:900:U:U DS:h:GAUGE:900:U:U DS:l:GAUGE:900:U:U DS:n:GAUGE:900:U:U DS:v:GAUGE:900:U:U DS:o:GAUGE:900:U:U DS:x:GAUGE:900:U:U DS:e:GAUGE:900:U:U DS:x:GAUGE:900:U:U DS:x:GAUGE:900:U:U DS:e:GAUGE:900:U:U DS:x:GAUGE:900:U:U DS:u:GAUGE:900:U:U DS:e:GAUGE:900:U:U DS:e:GAUGE:900:U:U RRA:AVERAGE:0:1:1440 RRA:AVERAGE:0:5:2016 RRA:AVERAGE:0:60:720 RRA:AVERAGE:0:720:730')
ERROR: Duplicate DS name: l
have tried to create RRD file /var/lib/heatpumpMonitor/heatpumpMonitor.rrd
=========
Error: RRD file missing
---------
Traceback (most recent call last):
  File "heatpumpMonitor.py", line 72, in doMonitor
    r = render.Render(config.getDatabaseFile(), config.getRenderOutputPath())
  File "/usr/local/sbin/render.py", line 162, in __init__
    raise IOError, "Error: RRD file missing"
IOError: Error: RRD file missing

=========

Revision history for this message
alphaomega (alpha-omega) said :
#11

PS2:
Still, no /var/lib/heatpumpMonitor/heatpumpMonitor.rrd file is created.
I understand that there are several rrd/python-related tools involved, and I installed them as described by Andreas in the Wiki without any error message. How can I find out which of the tools is maybe not correctly installed or setup?
Kind regards, Alphaomega

Revision history for this message
alphaomega (alpha-omega) said :
#12

PS3 (sorry, I would like to edit my previous posts, but I can only edit the first one):

I should of course have downloaded example5.data together with example5.py. ;-)
Well, now I have done this, and indeed all files are created, i.e. there are these (incl. .py and .data which I DL'ed before):

example5-10800-large.png
example5-10800.png
example5-259200-large.png
example5-259200.png
example5-43200-large.png
example5-43200.png
example5-86400-large.png
example5-86400.png
example5.data
example5.py
example5.rrd

I.e. the rrd/python setup seems to work, but no heatmumpMonitor.rrd file is created (see above).
The message "ERROR: Duplicate DS name: l" seems strange to me (see above), after there already appeared several lines like "DS:l:GAUGE:900:U:U DS:e:GAUGE:900:U:U DS:o:GAUGE:900:U:U" etc.

Is this a prove that the setup is really ok, and I have a problem somewhere else?
I use Debian Etch, not Lenny. Could that be the problem? But then example5.py would not work, either.
Hmm, any further help is really very much appreciated. I know that you, Robert, have spent already quite some time just for many many posts here to read and to answer. ;-)

Thank you and best regards, Alphaomega

Revision history for this message
Robert Penz (robert-penz-name) said :
#13

this entry:

ERROR: Duplicate DS name: l

is important. did you change anything in at dataSources in storage.py?

change in line 63 in storage.py?

        for source in dataSources:
            dss.append(DS(dsName=source[1], dsType='GAUGE', heartbeat=900))

to

        for source in dataSources:
            print "debug source: ", source
            dss.append(DS(dsName=source, dsType='GAUGE', heartbeat=900))

there is a change also in the last line not only the new line.

Revision history for this message
alphaomega (alpha-omega) said :
#14

Hi Robert, now the error message is gone and a lot of graphs are being created. Empty at the moment, but I will have to wait a few minutes for data collection. Would be great if it now worked...
Is this error message gone just because of the omitted [1] in storage.py?

root@nslu /usr/local/sbin $ python heatpumpMonitor.py
Starting ...
Heatpump reports Version 2.16
Using protocol definition from alphaomega (currently testing for THZ 303 SOL)
debug source: flow_temp
debug source: return_temp
debug source: hot_gas_temp
debug source: dhw_temp
debug source: flow_temp_hc2
debug source: inside_temp
debug source: evaporator_temp
debug source: condenser_temp
debug source: extr_speed_set
debug source: vent_speed_set
debug source: expel_speed_set
debug source: extr_speed_actual
debug source: vent_speed_actual
debug source: expel_speed_actual
debug source: outside_temp
debug source: rel_humidity
debug source: dew_point_temp
will now try to create RRD file /var/lib/heatpumpMonitor/heatpumpMonitor.rrd
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', '--start 1271740551 --step 60 DS:flow_temp:GAUGE:900:U:U DS:return_temp:GAUGE:900:U:U DS:hot_gas_temp:GAUGE:900:U:U DS:dhw_temp:GAUGE:900:U:U DS:flow_temp_hc2:GAUGE:900:U:U DS:inside_temp:GAUGE:900:U:U DS:evaporator_temp:GAUGE:900:U:U DS:condenser_temp:GAUGE:900:U:U DS:extr_speed_set:GAUGE:900:U:U DS:vent_speed_set:GAUGE:900:U:U DS:expel_speed_set:GAUGE:900:U:U DS:extr_speed_actual:GAUGE:900:U:U DS:vent_speed_actual:GAUGE:900:U:U DS:expel_speed_actual:GAUGE:900:U:U DS:outside_temp:GAUGE:900:U:U DS:rel_humidity:GAUGE:900:U:U DS:dew_point_temp:GAUGE:900:U:U RRA:AVERAGE:0:1:1440 RRA:AVERAGE:0:5:2016 RRA:AVERAGE:0:60:720 RRA:AVERAGE:0:720:730')
have tried to create RRD file /var/lib/heatpumpMonitor/heatpumpMonitor.rrd
Up and running

Best regards, Alphaomega

Revision history for this message
alphaomega (alpha-omega) said :
#15

PS - Unfortunately, another error message appeared under "Up and running":

=========
(22, 'Invalid argument')
---------
Traceback (most recent call last):
  File "heatpumpMonitor.py", line 117, in doMonitor
    time.sleep(61 - (time.time() - startTime))
IOError: [Errno 22] Invalid argument

=========

Revision history for this message
Robert Penz (robert-penz-name) said :
#16

hmmm ... this i don't understand ;-)

replace this by:

a = 61 - (time.time() - startTime)
print "sleep time:", a
time.sleep(a)

and tell me the output

Revision history for this message
alphaomega (alpha-omega) said :
#17

Thanks for your continuing support, Robert. I have replaced line time.sleep(61 - (time.time() - startTime)) with the three lines you suggested above, and sleep time is: -74.6726930141 (see below full log).
The file /var/lib/heatpumpMonitor/heatpumpMonitor.rrd is created (677192 bytes large) and also 48 .png files in /var/www/graphs (though these only contain the grids, no data).

root@nslu /usr/local/sbin $ python heatpumpMonitor.py start
Starting ...
Heatpump reports Version 2.16
Using protocol definition from alphaomega (currently testing for THZ 303 SOL)
debug source: flow_temp
debug source: return_temp
debug source: hot_gas_temp
debug source: dhw_temp
debug source: flow_temp_hc2
debug source: inside_temp
debug source: evaporator_temp
debug source: condenser_temp
debug source: extr_speed_set
debug source: vent_speed_set
debug source: expel_speed_set
debug source: extr_speed_actual
debug source: vent_speed_actual
debug source: expel_speed_actual
debug source: outside_temp
debug source: rel_humidity
debug source: dew_point_temp
will now try to create RRD file /var/lib/heatpumpMonitor/heatpumpMonitor.rrd
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', '--start 1271747082 --step 60 DS:flow_temp:GAUGE:900:U:U DS:return_temp:GAUGE:900:U:U DS:hot_gas_temp:GAUGE:900:U:U DS:dhw_temp:GAUGE:900:U:U DS:flow_temp_hc2:GAUGE:900:U:U DS:inside_temp:GAUGE:900:U:U DS:evaporator_temp:GAUGE:900:U:U DS:condenser_temp:GAUGE:900:U:U DS:extr_speed_set:GAUGE:900:U:U DS:vent_speed_set:GAUGE:900:U:U DS:expel_speed_set:GAUGE:900:U:U DS:extr_speed_actual:GAUGE:900:U:U DS:vent_speed_actual:GAUGE:900:U:U DS:expel_speed_actual:GAUGE:900:U:U DS:outside_temp:GAUGE:900:U:U DS:rel_humidity:GAUGE:900:U:U DS:dew_point_temp:GAUGE:900:U:U RRA:AVERAGE:0:1:1440 RRA:AVERAGE:0:5:2016 RRA:AVERAGE:0:60:720 RRA:AVERAGE:0:720:730')
have tried to create RRD file /var/lib/heatpumpMonitor/heatpumpMonitor.rrd
Up and running
sleep time: -74.6726930141
=========
(22, 'Invalid argument')
---------
Traceback (most recent call last):
  File "heatpumpMonitor.py", line 121, in doMonitor
    time.sleep(a)
IOError: [Errno 22] Invalid argument

=========

Revision history for this message
Robert Penz (robert-penz-name) said :
#18

I don't understand it. How do you get a negativ value. That is only possible if the program takes longer than 61 seconds to create the files. On my system it takes under 5 sec, how slow is this system? ;-)

To "fix" it, replace it with following

            # lets make sure it is aways 60 secs interval, no matter how long the last run took
            sleepTime = 61 - (time.time() - startTime)
            if sleepTime < 0:
                print "System is too slow for 60 sec interval by %d seconds" % abs(int(sleepTime))
            else:
                time.sleep(sleepTime)

Revision history for this message
alphaomega (alpha-omega) said :
#19

Well, it is a NSLU2 (NAS), which is - compared to not embedded systems - indeed rather slow.

root@nslu /proc $ cat cpuinfo
Processor : XScale-IXP42x Family rev 1 (v5l)
BogoMIPS : 266.24

Before I red your latest fix proposal, I had replaced the 61 by 121, i.e. waiting for 2 minutes.
Here is the result (I had to interrupt the tool by hitting Ctrl-D):

root@nslu /thz $ python heatpumpMonitor.py start
Starting ...
Heatpump reports Version 2.16
Using protocol definition from alphaomega (currently testing for THZ 303 SOL)
debug source: flow_temp
debug source: return_temp
debug source: hot_gas_temp
debug source: dhw_temp
debug source: flow_temp_hc2
debug source: inside_temp
debug source: evaporator_temp
debug source: condenser_temp
debug source: extr_speed_set
debug source: vent_speed_set
debug source: expel_speed_set
debug source: extr_speed_actual
debug source: vent_speed_actual
debug source: expel_speed_actual
debug source: outside_temp
debug source: rel_humidity
debug source: dew_point_temp
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', '--start 1271758246 --step 60 DS:flow_temp:GAUGE:900:U:U DS:return_temp:GAUGE:900:U:U DS:hot_gas_temp:GAUGE:900:U:U DS:dhw_temp:GAUGE:900:U:U DS:flow_temp_hc2:GAUGE:900:U:U DS:inside_temp:GAUGE:900:U:U DS:evaporator_temp:GAUGE:900:U:U DS:condenser_temp:GAUGE:900:U:U DS:extr_speed_set:GAUGE:900:U:U DS:vent_speed_set:GAUGE:900:U:U DS:expel_speed_set:GAUGE:900:U:U DS:extr_speed_actual:GAUGE:900:U:U DS:vent_speed_actual:GAUGE:900:U:U DS:expel_speed_actual:GAUGE:900:U:U DS:outside_temp:GAUGE:900:U:U DS:rel_humidity:GAUGE:900:U:U DS:dew_point_temp:GAUGE:900:U:U RRA:AVERAGE:0:1:1440 RRA:AVERAGE:0:5:2016 RRA:AVERAGE:0:60:720 RRA:AVERAGE:0:720:730')
created RRD file /var/lib/heatpumpMonitor/heatpumpMonitor.rrd
Up and running
ERROR: Could not save png to '/var/www/graphs/fans_week_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_week_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_week_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_week_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_week_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_week_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_week_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_week_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_month_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_month_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_month_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_month_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_month_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_month_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_month_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_month_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_year_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_year_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_year_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_year_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_year_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_year_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_year_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_year_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_day_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_day_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_day_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_day_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_day_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_day_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_day_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_day_big.png'
sleep time: 47.9988760948
sleep time: 119.067021847
sleep time: 119.144351959
sleep time: 119.164865971
sleep time: 119.121102095
ERROR: Could not save png to '/var/www/graphs/fans_week_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_week_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_week_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_week_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_week_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_week_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_week_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_week_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_month_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_month_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_month_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_month_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_month_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_month_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_month_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_month_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_year_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_year_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_year_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_year_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_year_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_year_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_year_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_year_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_day_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_day_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_day_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_day_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_day_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_day_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_day_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_day_big.png'
sleep time: 43.4777948856
sleep time: 119.126832008
sleep time: 119.130930901
sleep time: 119.148292065
sleep time: 119.127876997
ERROR: Could not save png to '/var/www/graphs/fans_week_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_week_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_week_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_week_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_week_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_week_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_week_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_week_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_month_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_month_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_month_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_month_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_month_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_month_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_month_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_month_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_year_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_year_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_year_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_year_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_year_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_year_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_year_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_year_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_day_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_day_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_day_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_day_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_day_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_day_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_day_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_day_big.png'
sleep time: 40.9204890728
sleep time: 119.133477926
sleep time: 119.142539024
sleep time: 119.117474079
sleep time: 119.017061949
ERROR: Could not save png to '/var/www/graphs/fans_week_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_week_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_week_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_week_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_week_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_week_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_week_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_week_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_3hours_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_3hours_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_month_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_month_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_month_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_month_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_month_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_month_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_month_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_month_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_year_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_year_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_year_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_year_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_year_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_year_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_year_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_year_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_halfday_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_halfday_big.png'
ERROR: Could not save png to '/var/www/graphs/fans_day_small.png'
ERROR: Could not save png to '/var/www/graphs/fans_day_big.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_day_small.png'
ERROR: Could not save png to '/var/www/graphs/enduser_temperatures_day_big.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_day_small.png'
ERROR: Could not save png to '/var/www/graphs/internaltemps_day_big.png'
ERROR: Could not save png to '/var/www/graphs/humidity_day_small.png'
ERROR: Could not save png to '/var/www/graphs/humidity_day_big.png'
sleep time: 40.8309102058
sleep time: 119.107032061
sleep time: 119.143074036
^CTraceback (most recent call last):
  File "heatpumpMonitor.py", line 133, in <module>
    main()
  File "heatpumpMonitor.py", line 130, in main
    doMonitor()
  File "heatpumpMonitor.py", line 120, in doMonitor
    time.sleep(a)
KeyboardInterrupt
root@nslu /thz $

I do not know why the files now could not be created, but I will further investigate on this and also apply your fix above.

Revision history for this message
Robert Penz (robert-penz-name) said :
#20

ls -la /var/www/graphs/ return what? Is there enough space on the volume?

Revision history for this message
alphaomega (alpha-omega) said :
#21

PS:
Sorry for the lengthy output above, which was due to my fault, i.e. I forgot to create "graphs" in /var/www.
And unfortunately, Launchpad does not allow to edit one's own posts (except for the first one), very strange...
Anyway, now your fix works and shows this:

root@nslu /usr/local/sbin $ python heatpumpMonitor.py start
Starting ...
Heatpump reports Version 2.16
Using protocol definition from alphaomega (currently testing for THZ 303 SOL)
Up and running
System is too slow for 60 sec interval by 83 seconds
System is too slow for 60 sec interval by 69 seconds

However, your tool is not terminated, i.e. there is no prompt. Does this mean, that it just waits longer until it adds the next data?
From your python code I cannot see what is supposed to happen (sorry, I am really not experienced with programming anymore, because it is ages ago). Do I just have to increase the 61 by 83 (well, better by 100 to be on the safe side)? Well, I will try this...

Just an additional thought:
Do you see another (even more elegant) way to dynamically adjust the waiting period, so the tool waits just as long as necessary?
My NAS is also used for recording TV stuff (DVB-T), and I could imagine that the system resources get even tighter during recordings.

Revision history for this message
Robert Penz (robert-penz-name) said :
#22

1. The program should not stop. It should run in the background. You disabled the feature which forks it into the background for debugging. enable it again ;-)

2. The Images are created every 5th time, normally it should not take so long.

3. The problem with the time is that you need the entries for the graphs. If you don't have one in a minute you've a whole in your graphs, but it should not be that bad as it is as rrd does a good job guessing missing single values. I would just try it for some time and look than at the graphs.

Revision history for this message
alphaomega (alpha-omega) said :
#23

1. Right, I have now enabled the daemon again. Thanks for reminding me. ;-)
What about stopping it? I get an error that the pid file is missing. And indeed it is searched for elsewhere:

root@nslu /usr/local/sbin $ python heatpumpMonitor.py stop
Could not stop, pid file 'pid.txt' missing.

In /etc/heatpumpMonitor.ini the file is called:
pidFile = /var/run/heatpumpMonitor.pid

This file is also created when the daemon has started, but heatpumpMonitor.pid is zero bytes long.
Usually, these pid files contain the pid number of the background task. There seems to be an issue with this.

In fact, deamon.py indeed shows pidfile='pid.txt':

def startstop(stdout='/dev/null', stderr=None, stdin='/dev/null',
              pidfile='pid.txt', startmsg = 'started with pid %s' ):

Shouldn't the path and filename be taken from /etc/heatpumpMonitor.ini? Here it seems to be hard-coded.
Sorry, if I am wrong and the fault is with myself.

2. Are you sure that you mean every 5th time? I thought every 5 minutes, see /etc/heatpumpMonitor.ini:

[Render]
# this is the output path of the diagrams and it is generated every 5 min
renderOutputPath = /var/www/graphs/
renderInterval = 5

3. Ok, I understand and will see what happens when I adjust the sleepTime in heatpumpMonitor.py.

By the way, do I also have to adjust the lines a little bit further up in your code of heatpumpMonitor.py?

except Exception, e:
                # log the error and just try it again in 120 sec - sometimes the heatpump returns an error and works
                # seconds later again
                logError(e)
                t.gotQueryError()
                time.sleep(120 - (time.time() - startTime))
                continue

There are 120 seconds. If my NAS is too slow (i.e. taking more time than 120 seconds), do I then also have to increase this value here? Is it always double as long as the value further below in the code?

What about these lines in storage.py:

        # Let's setup some data sources for our RRD
        dss = []
        for source in dataSources:
            print "debug source: ", source
# dss.append(DS(dsName=source[1], dsType='GAUGE', heartbeat=900))
            dss.append(DS(dsName=source, dsType='GAUGE', heartbeat=900))

I guess that I have to keep the adjusted (second) "dss.append" line in place in order to have a working tool, right?
Or is the [1] only to be ommitted for the <print "debug source: ", source> line to work?
I just ask because I am not sure if this [1] deletion was only necessary for the debug output, or in general needed.

For the time being I comment out the daemon again in order to easier see what is going on...

Revision history for this message
alphaomega (alpha-omega) said :
#24

PS: Hooray, I got graphs now! :-)

I run the tool in the background (daemon) and can see graphs now.
However, there appear several error messages in the log after several hours:

root@nslu ~ $ cat /var/log/heatpumpMonitor.log
Starting ...
Heatpump reports Version 2.16
Using protocol definition from alphaomega (currently testing for THZ 303 SOL)
debug source: flow_temp
debug source: return_temp
debug source: hot_gas_temp
debug source: dhw_temp
debug source: flow_temp_hc2
debug source: inside_temp
debug source: evaporator_temp
debug source: condenser_temp
debug source: extr_speed_set
debug source: vent_speed_set
debug source: expel_speed_set
debug source: extr_speed_actual
debug source: vent_speed_actual
debug source: expel_speed_actual
debug source: outside_temp
debug source: rel_humidity
debug source: dew_point_temp
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', '--start 1271782126 --step 60 DS:flow_temp:GAUGE:900:U:U DS:return_temp:GAUGE:900:U:U DS:hot_gas_temp:GAUGE:900:U:U DS:dhw_temp:GAUGE:900:U:U DS:flow_temp_hc2:GAUGE:900:U:U DS:inside_temp:GAUGE:900:U:U DS:evaporator_temp:GAUGE:900:U:U DS:condenser_temp:GAUGE:900:U:U DS:extr_speed_set:GAUGE:900:U:U DS:vent_speed_set:GAUGE:900:U:U DS:expel_speed_set:GAUGE:900:U:U DS:extr_speed_actual:GAUGE:900:U:U DS:vent_speed_actual:GAUGE:900:U:U DS:expel_speed_actual:GAUGE:900:U:U DS:outside_temp:GAUGE:900:U:U DS:rel_humidity:GAUGE:900:U:U DS:dew_point_temp:GAUGE:900:U:U RRA:AVERAGE:0:1:1440 RRA:AVERAGE:0:5:2016 RRA:AVERAGE:0:60:720 RRA:AVERAGE:0:720:730')
created RRD file /var/lib/heatpumpMonitor/heatpumpMonitor.rrd
Up and running
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271782130:24.0:23.0:32.6:47.2:U:U:24.0:23.8:U:U:U:38:44:U:19.3:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271782311:23.5:22.9:32.4:47.2:U:U:23.9:23.7:U:U:U:38:43:U:19.0:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271782492:23.3:22.7:32.1:47.1:U:U:23.8:23.4:U:U:U:39:43:U:18.8:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271782673:23.3:22.7:31.9:47.1:U:U:23.7:23.4:U:U:U:38:43:1:18.6:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271782854:23.6:23.0:31.7:47.1:U:U:23.6:23.7:U:U:U:38:43:U:18.3:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271783035:23.6:23.0:31.5:47.1:U:U:23.4:23.7:U:U:U:39:44:U:18.1:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271783216:23.7:23.0:31.3:47.1:U:U:23.4:23.7:U:U:U:39:44:U:18.0:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271783397:23.4:22.8:31.1:47.0:U:U:23.3:23.5:U:U:U:38:43:U:17.8:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271783578:23.6:22.9:30.8:47.0:U:U:23.2:23.6:U:U:U:38:43:1:17.6:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271783759:23.4:22.8:30.7:47.0:U:U:23.1:23.6:U:U:U:39:44:U:17.5:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271783940:23.3:22.7:30.5:47.0:U:U:23.0:23.4:U:U:U:38:43:U:17.4:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271784121:23.4:22.7:30.3:46.9:U:U:23.0:23.5:U:U:U:38:44:U:17.2:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271784302:23.5:22.9:30.2:46.8:U:U:22.9:23.6:U:U:U:39:44:U:17.0:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271784483:23.6:23.0:30.0:46.8:U:U:22.9:23.8:U:U:U:38:43:U:16.8:U:U')
debug: |
=========
Error: could not be set again into receiving mode (HeatingValues)
---------
Traceback (most recent call last):
  File "heatpumpMonitor.py", line 87, in doMonitor
    values = p.query()
  File "/usr/local/sbin/protocol.py", line 244, in query
    result.update(self._getValues(query))
  File "/usr/local/sbin/protocol.py", line 220, in _getValues
    s = self._get(queryData["name"], queryData["request"], queryData["responseLength"])
  File "/usr/local/sbin/protocol.py", line 206, in _get
    raise IOError, "Error: could not be set again into receiving mode (%s)" % queryName
IOError: Error: could not be set again into receiving mode (HeatingValues)

=========
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271784784:23.4:22.8:29.8:46.7:U:U:22.8:23.5:U:U:U:37:43:1:16.6:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271784965:23.5:22.8:29.6:46.6:U:U:22.7:23.5:U:U:U:39:43:U:16.5:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271785146:23.5:22.9:29.4:46.6:U:U:22.7:23.6:U:U:U:37:42:U:16.3:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271785327:23.6:23.0:29.3:46.6:U:U:22.6:23.7:U:U:U:38:44:U:16.2:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271785508:23.6:22.9:29.1:46.5:U:U:22.5:23.7:U:U:U:38:44:U:16.0:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271785689:23.4:22.7:28.9:46.5:U:U:22.4:23.4:U:U:U:38:43:U:15.9:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271785870:23.3:22.6:28.8:46.4:U:U:22.3:23.4:U:U:U:38:44:U:15.8:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271786051:23.4:22.9:28.7:46.4:U:U:22.4:23.6:U:U:U:38:43:U:15.6:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271786232:23.6:23.1:28.5:46.4:U:U:22.2:23.8:U:U:U:37:43:U:15.5:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271786413:23.4:22.8:28.4:46.3:U:U:22.2:23.5:U:U:U:38:44:U:15.3:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271786594:23.4:22.8:28.2:46.3:U:U:22.1:23.5:U:U:U:38:43:U:15.2:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271786775:23.4:22.8:28.1:46.3:U:U:22.0:23.4:U:U:U:37:43:1:15.1:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271786956:23.4:22.8:28.0:46.2:U:U:22.0:23.6:U:U:U:38:43:1:15.0:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271787137:23.6:23.1:27.8:46.1:U:U:21.9:23.7:U:U:U:38:43:U:14.8:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271787318:23.6:22.8:27.6:46.1:U:U:21.8:23.6:U:U:U:38:42:U:14.6:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271787499:23.3:22.7:27.5:46.1:U:U:21.8:23.4:U:U:U:39:45:1:14.5:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271787680:23.2:22.7:27.4:46.0:U:U:21.8:23.3:U:U:U:38:44:U:14.4:U:U')
=========
Error: heat pump does not understand ActualValues request
---------
Traceback (most recent call last):
  File "heatpumpMonitor.py", line 87, in doMonitor
    values = p.query()
  File "/usr/local/sbin/protocol.py", line 244, in query
    result.update(self._getValues(query))
  File "/usr/local/sbin/protocol.py", line 220, in _getValues
    s = self._get(queryData["name"], queryData["request"], queryData["responseLength"])
  File "/usr/local/sbin/protocol.py", line 156, in _get
    raise IOError, "Error: heat pump does not understand %s request" % queryName
IOError: Error: heat pump does not understand ActualValues request

=========
=========
Error: heat pump does not understand ActualValues request
---------
Traceback (most recent call last):
  File "heatpumpMonitor.py", line 87, in doMonitor
    values = p.query()
  File "/usr/local/sbin/protocol.py", line 244, in query
    result.update(self._getValues(query))
  File "/usr/local/sbin/protocol.py", line 220, in _getValues
    s = self._get(queryData["name"], queryData["request"], queryData["responseLength"])
  File "/usr/local/sbin/protocol.py", line 156, in _get
    raise IOError, "Error: heat pump does not understand %s request" % queryName
IOError: Error: heat pump does not understand ActualValues request

=========
-------------
Error: [heatpumpMonitor] Query error theshhold exceeded
Error details The number of queries which failed in a row exceeded the defined
threshold. Is the heatpump still connected and running? It is also possible that the software
of the heat pumpt crashed or not that stable. Take a look at it. An other possibility is that
the connection is not good and you get a lot of CRC errors. In all cases take a lock at the
logfile.
-------------
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271788101:23.6:23.1:27.1:45.9:U:U:21.6:23.7:U:U:U:38:44:U:14.2:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271788282:23.4:22.9:27.1:45.9:U:U:21.6:23.6:U:U:U:40:45:1:14.1:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271788463:23.3:22.7:26.9:45.8:U:U:21.5:23.4:U:U:U:38:44:U:14.1:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271788644:23.4:22.7:26.8:45.8:U:U:21.5:23.4:U:U:U:38:43:U:13.9:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271788825:23.4:22.8:26.6:45.7:U:U:21.3:23.5:U:U:U:38:44:1:13.8:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271789006:23.3:22.6:26.5:45.6:U:U:21.3:23.4:U:U:U:37:43:U:13.7:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271789187:23.2:22.6:26.4:45.6:U:U:21.3:23.3:U:U:U:37:42:U:13.6:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271789368:23.3:22.6:26.2:45.5:U:U:21.2:23.3:U:U:U:38:43:U:13.5:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271789549:23.4:22.7:26.2:45.5:U:U:21.1:23.4:U:U:U:37:42:U:13.4:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271789730:23.4:22.8:26.0:45.4:U:U:21.1:23.5:U:U:U:38:43:U:13.3:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271789911:23.2:22.7:25.9:45.4:U:U:21.1:23.4:U:U:U:38:43:U:13.3:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271790092:23.2:22.6:25.8:45.3:U:U:20.9:23.3:U:U:U:39:43:U:13.2:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271790273:23.2:22.6:25.7:45.3:U:U:20.9:23.3:U:U:U:38:42:U:13.1:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271790454:23.3:22.7:25.6:45.2:U:U:20.9:23.4:U:U:U:38:43:U:13.1:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271790635:23.4:22.9:25.5:45.2:U:U:20.8:23.6:U:U:U:38:42:1:13.1:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271790816:23.3:22.7:25.4:45.1:U:U:20.7:23.4:U:U:U:37:41:U:13.0:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271790997:23.1:22.5:25.3:45.0:U:U:20.7:23.2:U:U:U:37:43:U:12.9:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271791178:23.3:22.7:25.2:45.0:U:U:20.7:23.4:U:U:U:38:43:U:12.8:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271791359:23.5:22.9:25.0:45.0:U:U:20.6:23.5:U:U:U:38:43:U:12.7:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271791540:23.3:22.6:25.0:44.9:U:U:20.5:23.4:U:U:U:37:43:U:12.6:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271791721:23.0:22.4:24.9:44.8:U:U:20.4:23.1:U:U:U:37:42:1:12.5:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271791902:23.1:22.5:24.8:44.7:U:U:20.4:23.2:U:U:U:37:43:U:12.4:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271792083:23.3:22.7:24.7:44.7:U:U:20.4:23.4:U:U:U:38:42:U:12.4:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271792264:23.6:22.9:24.6:44.7:U:U:20.3:23.6:U:U:U:37:44:U:12.3:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271792445:23.3:22.5:24.5:44.6:U:U:20.3:23.3:U:U:U:38:43:1:12.3:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271792626:23.1:22.5:24.4:44.6:U:U:20.3:23.2:U:U:U:38:42:U:12.2:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271792807:26.1:23.0:36.4:44.5:U:U:10.6:25.5:U:U:U:34:44:17:12.1:U:U')
('/var/lib/heatpumpMonitor/heatpumpMonitor.rrd', ' 1271792988:25.1:24.0:52.2:44.5:U:U:-0.4:25.6:U:U:U:38:43:U:12.1:U:U')
debug: |
=========
Error: could not be set again into receiving mode (HeatingValues)
---------
Traceback (most recent call last):
  File "heatpumpMonitor.py", line 87, in doMonitor
    values = p.query()
  File "/usr/local/sbin/protocol.py", line 244, in query
    result.update(self._getValues(query))
  File "/usr/local/sbin/protocol.py", line 220, in _getValues
    s = self._get(queryData["name"], queryData["request"], queryData["responseLength"])
  File "/usr/local/sbin/protocol.py", line 206, in _get
    raise IOError, "Error: could not be set again into receiving mode (%s)" % queryName
IOError: Error: could not be set again into receiving mode (HeatingValues)

=========

Shall I put more debug to True in order to find the reason? Or do you have any further suggestions?
I am on the right track now - thanks to your continuing kind support. *thumbsup*

Best regards, Alphaomega

PPS: Is it possible to attach screenshots here in Launchpad? Or I try in your Wiki of you do not mind...

Revision history for this message
Best Robert Penz (robert-penz-name) said :
#25

About the pid file

replace

deamon.startstop(config.getLogFile(), config.getPidFile())

with

deamon.startstop(config.getLogFile(), pidfile=config.getPidFile())

does that help?

Revision history for this message
Robert Penz (robert-penz-name) said :
#26

It is 5 minutes if your interval is 60 sec, but the code just counts the loops and if every 5th time it executes the render part

Revision history for this message
Robert Penz (robert-penz-name) said :
#27

About the 120 seconds. It will only be executed if there was a read error from the heatpump. We wait than longer to give the heatpump more time to get back to life. This should normally only take 5 seconds even on a slow system, the cpu intensive part is the graph rendering

The [1] was a bug, which got in when I changed some parts for the last release and I didn't have to generate the rrd file as I'd already one .... just remove the print line and keep the rest ;-)

About the messages with something like this:

debug: |
=========
Error: could not be set again into receiving mode (HeatingValues)

Your query values do not seem to be 100% correct, take a look what the queries from the windows software are and compare them with the values your ini files send and receive.

Revision history for this message
alphaomega (alpha-omega) said :
#28

Thanks Robert Penz, that solved my question.

Revision history for this message
alphaomega (alpha-omega) said :
#29

Hi Robert,

the "deamon.startstop(config.getLogFile(), pidfile=config.getPidFile())" line helped regarding the pid file, which now contains the correct pid. Thus, the daemon can be stopped by "python heatpumpMonitor.py stop".

I just now realize that this thread mixes quite a lot of different topics. Please accept my apologies for having driven the discussion etc. into this kind of chaos. ;-) Hopefully, it is nevertheless educating for other users, too.

Regarding the various times (for rendering, waiting etc.) I will see how low I can put them. For the time being I will first check my query values, which indeed do not seem to fit 100%. But I am really happy now that graphs are rendered etc. This is definitely an important step forward for me.

If you like to, I can create a diff between my files and the files of your current archive and attach it in the Wiki for your consideration. Please let me know if this makes sense at this point in time.

I have already updated my screenshots in the Wiki - and by mistake have deleted one of your graphs from the attachment section. :-/ Sorry about that. I hope that you can get it back.

Thanks a lot for everything and best regards, Alphaomega

Revision history for this message
Robert Penz (robert-penz-name) said :
#30

Please check your version against the trunk if I missed change. The wiki has a history you can easily go back I believe to an old version with the delete picture. grab it and upload it again ;-)