Hi,
I’m trying to get persistence with influxdb working. So far no data ends up in the database (SHOW MEASUREMENTS returns nothing). The logs seems normal.
I might be overlooking something.
Any suggestions would be appreciated.
Thanks.
Openhab 1.8.2 running on a RP with Jessie minimal
Files in addons folder:
org.openhab.binding.dsmr-1.8.2.jar
org.openhab.binding.iec6205621meter-1.8.2.jar
org.openhab.binding.zwave-1.8.2.jar
org.openhab.io.habmin-1.7.0-SNAPSHOT.jar
org.openhab.persistence.influxdb-1.8.2.jar
openhab.cfg:
############################ InfluxDB Persistence Service #############################
influxdb:url=http://localhost:8086
influxdb:user=openhab
influxdb:password=openhab
influxdb:db=openhab
openhab log:
2016-04-18 09:34:51.315 [DEBUG] [xDBPersistenceServiceActivator] - InfluxDB persistence bundle has been started.
2016-04-18 09:34:51.478 [DEBUG] [i.i.InfluxDBPersistenceService] - influxdb persistence service activated
2016-04-18 09:34:53.907 [DEBUG] [i.i.InfluxDBPersistenceService] - database status is OK, version is 0.12.1
2016-04-18 09:35:01.205 [TRACE] [i.i.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 4492.9609375
2016-04-18 09:35:01.208 [TRACE] [i.i.InfluxDBPersistenceService] - found fractional part
2016-04-18 09:35:01.211 [DEBUG] [i.i.InfluxDBPersistenceService] - got DecimalType value 4492.9609375
2016-04-18 09:35:01.214 [TRACE] [i.i.InfluxDBPersistenceService] - storing P1_eDeliveryTariff1 in influxdb value 4492.9609375, P1_eDeliveryTariff1 (Type=NumberItem, State=4492.9609375)
First I thought that there might be an error with the DB - but then I enabled the trace log of the influxdb persistance service. It told me, that data was written successfully.
And now the crazy shit: The InfluxDB Server doesn’t receive any request - not even a network request (checked with tcpdump). So there seems to be a problem with the persistence plugin - but how to fix this?
I have installed Openhab and Inluxdb on a RasPi 2.
I use Openhab 1.8.3 and the corresponding influxdb addon.
I installed the v0.13 influxdb ARM .deb package from the influxdata download page. I haven’t touched the influxdb.cfg file, that means the default config is used.
I see the same messages as the initial poster coyote and no data is stored in the database.
Does anyone have any idea what I could do to narrow down the problem?
I think I have found something. If you look at coyote’s post, in the last line, you see the POST request to the /write endpoint. There you can see that the request includes “rp=default”.
However, I defined for my openhab database a different retention policy, called openhab_retention and set this as the default policy.
So playing around with curl I noticed that if the POST request contains the “rp=” parameter to a retention policy which is not the default policy for the specified database, then nothing is written into the database.
So I’m not sure if this is a bug in influxdb or if openhab (or the influxdb persistance addon) does not use influxdb’s http api correctly.
However, it would be nice if somehow, the retention policy, which is submitted from openhab to influxdb via the POST request could be changed in a config file.
Can anyone think of a quick fix for this issue? … ok apart of using only the “default” retention policy in influxdb.
unfortunately, the 1.9.0. snapshot does not work either.
I still think that the origin of the problem is caused by openhab specifying/setting the retention policy in the POST request to “default”.
I checked InfluxDBPersistenceService.java and if I understand the code correctly, then, I see two issues there.
there is no possibility for the user to specify a retention policy, since the “activate” method only parses for the attributes (user, password, db and url).
in the “store” method, when influxDB.write is called, the retention policy is hard-coded as “default”.
So I think either there should be a way to change the name of the retention policy via openhab.cfg or perhaps the persistence service should just avoid using it.
thanks a lot for the quick response and a new snapshot.
Thanks to your modification I was able to change the retention policy name and now I see that values are populated/written in database.
This modification fixes the problem!!! - at least in my case.
BTW, it’s somewhat off-topic, and I not sure if you are the right person to address this finding. While I was tracing the tcp communication, I saw that in the POST request, which is coming from openhab/influxdb addon, there is perhaps an obsolete parameter. The POST request contains “consistency=one”, however I could find this parameter in the latest v0.13 influxdb HTTP API.
Once again, excellent work with the retention policy and I look forward having it in the next openhab release
Just for completeness: In my case, the user accessing the Database didn’t have the permission to write to the database. But the log files didn’t report any connection error.