RRD4J - Logging

Hey !

I’m trying to logg some Data with rrd4j.

my rrd4j.persist file looks like this:

[CODE] Strategies {
everyMinute : “0 * * * * ?”
}

Items {
BMP_temp : strategy = everyMinute, restoreOnStartup
}
[/Code]

In my Items file i got a item called BMP_temp like this:

Number BMP_temp "Temperatur BMP280 [%.1f °C]" <temperature> {mqtt="<[mosquitto:/ESP001/BMP/Temp:state:default]"}

last my sitemap:

Frame label="Temp Chart"{ Chart item=BMP_temp period=h refresh=3600 }

i’ve read that in /usr/share/openhab/etc
i should find a file named “BMP_temp.rrd” after some time. Nothing there.

Also in the wiki its says that i need to change the openhab.config. but how ?

I got the rrd4j persistence is in my addon folder.

thanks for help !

EDIT
my openhab.cfg:

# The name of the default persistence service to use
persistence:default=rrd4j

########################### RRD4J Persistence Service #################################
#
# please note that currently the first archive in each RRD defines the consolidation
# function (e.g. AVERAGE) used by OpenHAB, thus only one consolidation function is
# fully supported
#
# default_numeric and default_other are internally defined defnames and are used as
# defaults when no other defname applies

#rrd4j:<defname>.def=[ABSOLUTE|COUNTER|DERIVE|GAUGE],<heartbeat>,[<min>|U],[<max>|U],<step>
#rrd4j:<defname>.archives=[AVERAGE|MIN|MAX|LAST|FIRST|TOTAL],<xff>,<steps>,<rows>
#rrd4j:<defname>.items=<list of items for this defname>

i changed nothing here…

Almost: for an apt-get install look into:
/var/lib/openhab/persistence/rrd4j

that directory exists but is empty as well.

i think the problem is the openhab.cfg.
im trying to work on that atm.

I don’t think so: there is no need to change anything in openhab.cfg.

I found a logging section in openhab.cfg which could have something to do with your problem:

######################### Logging Persistence Service #################################
#
# the logback encoder pattern to use to write log entries
# see http://logback.qos.ch/manual/layouts.html#ClassicPatternLayout for all options
# the item name is available as the "logger" name, the state as the "msg"
logging:pattern=%date{ISO8601} - %-25logger: %msg%n

But this is also default in openhab_default.cfg, so if you didn’t change anything it should be already in your openhab.cfg.
And it should only have to do something with logging, not with persisting your items values.

the wiki says that i have to change 3 lines in the openhab.cfg

#rrd4j:<defname>.def=[ABSOLUTE|COUNTER|DERIVE|GAUGE],<heartbeat>,[<min>|U],[<max>|U],<step>
#rrd4j:<defname>.archives=[AVERAGE|MIN|MAX|LAST|FIRST|TOTAL],<xff>,<steps>,<rows>
#rrd4j:<defname>.items=<list of items for this defname>

i guess:
the .def part defines how the graph is shown.
the . items part needs to have my “BMP_temp” in it.

i dont understand what i need to do with the .archives part.

No, you MAY configure that, you don’t HAVE TO:

As of Openhab 1.7 it is **possible** to configure the later described values.

I did not change anything in openhab.cfg and my rrd4j persistence is working fine.

ok well then i’ve got no idea why it’s not working…

Take a look in your events.log and see if you are actually getting values for your item:

2016-03-02 19:03:22 - BMP_temp state updated to xx.x

If not, start oh in debug mode and you may see whats wrong.

my events.log /var/log/openhab/events.logends with 2016-03-03.
how can that be ?

It seems somehow oh stopped working …

oh is working just fine… i get all my data shown.

but rrd4j is not working although its like 3 steps to make it work…

I guess if you have nothing in your events.log there is something basically going wrong. You need to find that out before you start looking for your rrd4j problem. Start in debug mode and see if you can find the problem.

< gesendet von Samsung Smartphone >

i still got this problem.
could give you guys log files now.

Yes, post it!

here you go.

openhab_log.xml (54.2 KB)

that filde had 80 MB befor i cut it. maybe i deleted importend stuff…

Okay, there is something going wrong … not only with rrd4j persistence.

Did you use a tutorial to install openhab? If yes, which one?

Or let’s say it the other way around:

hey !

i used the official tutorial for linux on the wiki.
since i had massive problems getting mqtt to work i was very happy that it worked with this.

i will reinstall… but then i mqtt wont work again.

Sure it will work :grinning:
Are you using mosquitto on your pi as broker?
If yes I will write a short tutorial to set it up, but not today, it’s late …