MQTT works in the shell but not in openhab (new topic)

Hey there, I am migrating to my new raspi 4 and I have a similar problem.
Mosquitto is working in the shell, but nothing happens, when toggling a switch in BasicUI. The output of “cat /etc/openhab2/services/mqtt.cfg” is:

mosquitto.url=tcp://192.168.1.187:1883
mosquitto.clientId=openHAB2
mosquitto.user=domeninini
mosquitto.pwd=********
mqtt:broker.retain=true
mqtt:broker.async=false

and the content of “/var/lib/openhab2/config/org/openhab/mqtt.config” is


broker.async="false"
broker.retain="true"
mosquitto.clientId="openHAB2"
mosquitto.pwd="*********"
mosquitto.url="tcp://192.168.1.187:1883"
mosquitto.user="domeninini"
service.pid="org.openhab.mqtt"

MQTT Binding is installed, then a new thing is added manually (MQTT Broker) with the following features:
(upload://88l9kAWQqIsSzxLkVFhU14DkOat.png)

My openhab version is 2.4.0-1.
What else could cause the problem ?

Why 2 topics? anyway. You are using 2.4 so no need for the mqtt.config all that configuration is done with the broker thing. Documenation is hard to read of you are a beginner and lacks examples. https://www.openhab.org/addons/bindings/mqtt/
Luckily there is a usefull blog about mqtt:
https://www.openhab.org/blog/2018-12-16-mqtt-arrives-in-the-modern-openhab-2-x-architecture.html

Without log files, it is hard to tell you what is wrong. The item declaration is also missing. Did you subscribe to the topic from the shell? just to check if any message is posted to the topic?

I solved it ! I was confused with the versions of mqtt. With installing the v1 instead of the v2, everything works as before. Thank you !

As V1 is deprecated and not longer supported it would make sense to migrate to V2.