However, I do not have a /etc/openhab2/services/mqtt.cfg, (I did a manual install, so everything is in a local directory) I tried to find that file and located it in conf/services/mqtt.cfg, is that the one?
I still don’t know where the subscibe/publish lines go … I am following the howto in the following link: mqtt howto
I had a look at the log and I see I am having authentication issues with my broker.
My broker uses only username, no password, so I provides just the username in mqtt.cfg, plus the broker.url of course, but still no authentication.
I am using a mosquitto broker … not sure what else to do …
# Define your MQTT broker connections here for use in the MQTT Binding or MQTT
# Persistence bundles. Replace <broker> with an ID you choose.
# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a random default is generated.
# Optional. True or false. If set to true, allows the use of clientId values
# up to 65535 characters long. Defaults to false.
# NOTE: clientId values longer than 23 characters may not be supported by all
# MQTT servers. Check the server documentation.
# Optional. User id to authenticate with the broker.
# Optional. Password to authenticate with the broker.
And here is the relevant part of mosquitto.conf: (I only added this line)
# Place your local configuration in /etc/mosquitto/conf.d/
# A full description of the configuration file is at
log_dest file /var/log/mosquitto/mosquitto.log