Setting up Mosquitto with openhabian 4.1

I have been running openhabian 2.5 for several years with no problems. I’m just setting up openhabian 4.1 on a Rpi 3B+. I can see my TP-Link devices and have them added to Things. I have 2 ESP8266 devices that provide remote temperature and humidity readings. They use MQTT in their settings. I have installed Misquitto from the openhabian-config screen and via the Addon-Store. I am using the configuration settings from my version 2.5. Unfortunately, I cannot get the MQTT Broker to connect.
I’m trying to read as much as I can understand but a lot of this information is way over my head.
I’m getting a Not Authorized message. I entered the password when I loaded MQTT from the openhabian-config screen. At this point, I’m not sure what to do next. Any help would be greatly appreciated.

2024-03-26 20:57:44.689 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.1.103' with clientid fb9e7e82-92ec-4318-a1a2-8e4f2ae2641c
==> /var/log/openhab/events.log <==
2024-03-26 20:57:44.683 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:38c63fb5bf' changed from OFFLINE (COMMUNICATION_ERROR): CONNECT failed as CONNACK contained an Error Code: NOT_AUTHORIZED. to OFFLINE
2024-03-26 20:57:44.700 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:38c63fb5bf' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): CONNECT failed as CONNACK contained an Error Code: NOT_AUTHORIZED.
2024-03-26 20:58:43.960 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:38c63fb5bf' changed from OFFLINE (COMMUNICATION_ERROR): CONNECT failed as CONNACK contained an Error Code: NOT_AUTHORIZED. to REMOVING
2024-03-26 20:58:43.968 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:38c63fb5bf' changed from REMOVING to REMOVED
2024-03-26 20:58:43.981 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:38c63fb5bf' changed from REMOVED to UNINITIALIZED
2024-03-26 20:58:44.008 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:38c63fb5bf' changed from UNINITIALIZED to OFFLINE
2024-03-26 20:58:44.039 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:38c63fb5bf' changed from OFFLINE to UNINITIALIZED (HANDLER_MISSING_ERROR)
2024-03-26 21:

this does not work under 4.1, the *.cfg file is not used here. you will have either to configure your things and items in mainui or via file, here an example of my
things-file:

Bridge mqtt:broker:my_broker "MQTT Broker" @ "MQTT" [
    host="localhost",
    port="1883",
    secure=false,
    username="<YOUR_USERNAME>",
    password="<YOUR_PW>",
    clientID="<YOUR_ID>"
] {
    Thing topic stove "MQTT - Ofen" @ "MQTT" {
        Channels:
            Type number : temp [
                stateTopic="stove/temp/state"
            ]
            Type colorHSB : led [
                stateTopic="stove/led/state",
                commandTopic="stove/led/set"
            ]
            Type string : visualize [
                stateTopic="stove/visualize/state"
            ]
    }
}

… and my items-file:

Number iEWoK_Ofen_temp "Abgastemperatur[%d]" <fire> (iG_Ofen) { channel="mqtt:topic:my_broker:stove:temp" }
Color iEWoK_Ofen_led "Status-LED" <rgb> { channel="mqtt:topic:my_broker:stove:led" }
String iEWoK_Ofen_visualize "Statusmeldung[%s]" <info> { channel="mqtt:topic:my_broker:stove:visualize" }

Please be aware that there is a difference between openHABian and openHAB.
Current version of openHABian is 1.9 (Releases · openhab/openhabian · GitHub).

If setting up mosquitto via openhabian-config, There will be some credentials per default. Default user is openhabian and password is asked during installation. If you don’t remember which password you chose, you can create new credentials by reinstall (in fact this will only add a new line or change the existing line in the passwd file - located in /etc/mosquitto/). The password itself is hashed, so no luck in looking up in the passwd file.

You can now choose any username during installation of mosquitto. I changed that some time ago to avoid confusion with z2m-installation. Nobody complained yet so I guess it works without problems. You just have to make sure to use the same user for e.g. zigbee2mqtt.

Yepp, therefor Default user. :slight_smile: