I got MQTT working, and can successfully connect to the broker on another machine, but both Influxdb and MySQL cant get a connection.
Influxdb
2019-05-26 01:21:23.314 [ERROR] [.internal.InfluxDBPersistenceService] - database connection failed
retrofit.RetrofitError: No route to host (Host unreachable)
--- [ Cut all the other errors away ] ---
2019-05-26 01:21:23.329 [ERROR] [.internal.InfluxDBPersistenceService] - database connection error No route to host (Host unreachable)
2019-05-26 01:21:23.329 [ERROR] [.internal.InfluxDBPersistenceService] - database connection does not work for now, will retry to use the database.
Influxdb config
# The database URL, e.g. http://127.0.0.1:8086 or https://127.0.0.1:8084 .
# Defaults to: http://127.0.0.1:8086
# url=http(s)://<host>:<port>
url=http://192.168.1.100:8086
# The name of the database user, e.g. openhab.
# Defaults to: openhab
# user=<user>
user=openhab
# The password of the database user.
# password=
password=password
# The name of the database, e.g. openhab.
# Defaults to: openhab
# db=<database>
db=openhab
MySQL (using MariaDB)
2019-05-26 01:21:26.387 [ERROR] [sql.internal.MysqlPersistenceService] - mySQL: Failed connecting to the SQL database using: driverClass=com.mysql.jdbc.Driver, url=jdbc:mysql://192.168.1.100:3306/openhab_selina?serverTimezone=Europe/Copenhagen, user=openhab2
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
MySQL config
# the database url like 'jdbc:mysql://<host>:<port>/<database>' (without quotes)
url=jdbc:mysql://192.168.1.100:3306/openhab_selina?serverTimezone=Europe/Copenhagen
mysql:sqltype.string=VARCHAR(20000)
# the database user
user=openhab2
# the database password
password=password
# the reconnection counter
reconnectCnt=99
# the connection timeout (in seconds)
waitTimeout=14400
# Use MySQL Server time to store item values (=false) or use openHAB Server time (=true).
# For new installations, its recommend to set "localtime=true".
# (optional, defaults to false)
#localtime=true
I have tested both Influx and MySQL, and they are running, and receiving data from another Openhab installation, running in a VM.
Hey there, last week I also did this task and created a GitHub Repo for easy use.
I noticed some problems, you need to run the docker containers in network_mode: host otherwise openHAB won’t be able to detect devices in your network for example Phillips Hue etc.
Isn’t the problem in that other thread something completely different? The reason for the exec binding not working, is pretty obvious, because it is running inside docker.
In my case openhab cant get any connection, with the influxdb and mysql binding. The MQTT binding does work, and can connect to the rest of the network.
version 2.2.0…
Considering the stable version is 2.4.0 and there is 2.5.0 already, this 1 click easy setup is kinda bad.
I never used Unraid, but I have googled a bit and it seems most Unraid users prefer a GUI over shell.
The influxdb and mysql are also dockers. I can reach them from anywhere else on the network, and my openhab installation in a VM is also putting data into them.
Should be able to connect to influx from inside the docker
Now I am not getting any errors… But it still isnt working either
2019-05-27 07:00:39.778 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Copenhagen'.
2019-05-27 07:00:39.786 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '0,0'.
2019-05-27 07:00:39.788 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'da_DK'.
2019-05-27 07:00:39.953 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder
2019-05-27 07:00:39.966 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2019-05-27 07:00:41.596 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'aircondition.items'
2019-05-27 07:00:41.638 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'workroom.items'
2019-05-27 07:00:41.651 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'common.items'
2019-05-27 07:00:41.826 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mysql.persist'
2019-05-27 07:00:41.839 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'influxdb.persist'
2019-05-27 07:00:42.628 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2019-05-27 07:00:42.789 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'nygade.sitemap'
2019-05-27 07:00:42.889 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'mqtt.things', using it anyway:
Provide a thing type ID and a thing ID in this format:
<thingTypeId> <thingId>
Provide a thing type ID and a thing ID in this format:
<thingTypeId> <thingId>
2019-05-27 07:00:42.891 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mqtt.things'
2019-05-27 07:00:43.167 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.1.100:8080
2019-05-27 07:00:43.169 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.1.100:8443
2019-05-27 07:00:43.262 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2019-05-27 07:00:43.411 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.1.30' with clientid paho172348801358278 and file store '/openhab/userdata/mqtt/192.168.1.30'
Why did you create textual MQTT Things and not via PaperUI? Also you messed something up there.
Well let’s take a look at your influxdb.persist file
This is my crude, I don’t care, log everything file.
// Persistence Strategien haben einen Namen und eine Definition
Strategies {
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
// Wenn bei einem unten definierten Item keine Strategie angebeben ist,
// wird die Default-Liste angewendet
default = everyChange
}
/*
* Each line in this section defines for which item(s) which strategy(ies)
* should be applied. You can list single items, use "*" for all items or
* "groupitem*" for all members of a group item (excl. the group item itself).
*/
Items {
// Speichere die Daten aller Items jeden Tag (veryDay), bei jeder Änderung (everyChange) und
// ordne den Items bei einem Neustartand den letzten Wert zu (restoreOnStartup)
* : strategy = everyChange, everyDay
}