Hi everyone - I’ve tried to follow this tutorial without success. I would typically consider my ability to troubleshoot as pretty good, but have hit a road block with this.
I’m on OpenHAB v2 on a Pine64 setup using OpenHABian. The influxdb plugin is 1.9.0 and the version of influxDB is 1.2.0. This is a new setup that uses z-wave network containing 9 nodes. I’ve done little manual configuration (all thing
and item
configuration has been done through HABmin so they do not appear in /etc/openhab2
), but have successfully written a couple of rules that are working as expected.
The start of the tutorial went well. InfluxDB and Grafana are both installed and the sine wave test was successful. Connecting it to OpenHAB seems to have worked, but values are not appearing in InfluxDB.
I’ve done a few things so far:
- My influxdb.persist file has been stripped back to the bare minimum (the v1 docs says that “a strategies section must be included (with a default defined), or the persistence services will not work.”):
$ cat influxdb.persist
Strategies {
default : everyChange, restoreOnStartup
}
Items {
* : strategy = everyChange, restoreOnStartup
}
- Having logged in to the bundled Karaf console I’ve confirmed that the config (password etc) is being loaded and the addon / ‘bundle’ is loaded using the
bundle:list
and config
commands (config below).
Pid: org.openhab.influxdb
BundleLocation: null
Properties:
db = openhab_db
password = <redacted>
retentionPolicy = autogen
service.pid = org.openhab.influxdb
url = http://127.0.0.1:8086
user = openhab
-
I enabled TRACE level logging on org.openhab.persistence by adding a line to /var/lib/openhab2/etc/org.ops4j.pax.logging.cfg
(the line I added is log4j.logger.org.openhab.persistence = TRACE
).
-
Checked that the InfluxDB addon starts up - the openhab log contains the following lines:
2017-03-13 20:38:20.584 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'influxdb.persist'
2017-03-13 20:38:31.994 [DEBUG] [org.openhab.persistence.influxdb ] - BundleEvent STARTING - org.openhab.persistence.influxdb
2017-03-13 20:38:31.998 [DEBUG] [.InfluxDBPersistenceServiceActivator] - InfluxDB persistence bundle has been started.
2017-03-13 20:38:32.001 [DEBUG] [org.openhab.persistence.influxdb ] - BundleEvent STARTED - org.openhab.persistence.influxdb
2017-03-13 20:38:32.031 [DEBUG] [.internal.InfluxDBPersistenceService] - influxdb persistence service activated
2017-03-13 20:38:33.046 [DEBUG] [.internal.InfluxDBPersistenceService] - database status is OK, version is 1.2.0
2017-03-13 20:38:33.059 [DEBUG] [org.openhab.persistence.influxdb ] - ServiceEvent REGISTERED - {org.openhab.core.persistence.PersistenceService, org.openhab.core.persistence.QueryablePersistenceService}={service.pid=org.openhab.influxdb, db=openhab_db, user=openhab, url=http://127.0.0.1:8086, password=<redacted>, component.name=org.openhab.persistence.influxdb, retentionPolicy=autogen, component.id=175, service.id=298, service.bundleid=201, service.scope=bundle} - org.openhab.persistence.influxdb
- Checked the influxDB log to see if there are any accesses or errors there. This line shows up at the same time as the DEBUG line above indicating that the config is at least somewhat correct:
Mar 13 20:38:33 openHABianPine64 influxd[28258]: [httpd] 127.0.0.1 - - [13/Mar/2017:20:38:33 +0000] "GET /ping HTTP/1.1" 204 0 "-" "okhttp/2.4.0" 0649abaf-082d-11e7-8031-00000000
I’ve also noticed that I can see requests being made to InfluxDB by HABmin when I am trying to use the chart editor. So again the wiring of the influx side seems to be working correctly.
However nothing seems to be stored in InfluxDB (I’m looking for series or measurements in the influxDB console):
$ influx -username admin -host localhost -password ''
password:
Connected to http://localhost:8086 version 1.2.0
InfluxDB shell version: 1.2.0
> use openhab_db
Using database openhab_db
> show series
> show measurements
>
I also note that nothing appears in the influxDB logging any attempt to insert a value. Neither do I see anything in the OpenHAB logs, other than 2017-03-12 21:12:19.895 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'influxdb.persist'
which indicates that it has at least read the file.
On the surface this looks similar to Influxdb: no data in db but unlike that I’m not seeing any storing xxxxx in influxdb
messages - and I’m already specifying a retentionPolicy
configuration to autogen
that exists in the database:
> show retention policies
name duration shardGroupDuration replicaN default
---- -------- ------------------ -------- -------
autogen 0s 168h0m0s 1 true
I’m not sure if there is a way of seeing how the influxdb.persist
file is parsed and used, but it seems to me at the moment that no attempt is being made to write to Influx so perhaps this isn’t being parsed in the way I expect.
I suspect that this is something simple that I’ve missed due to being unfamiliar with OpenHAB. Any further suggestions would be really helpful.