OPENHAB appears to have stopped communicating with mosquitto

We have power cut recently and when the power came back on I restarted my Raspberry Pi with openhab and MQTT on it. However openhab was failing to start. My first port of call was to do an UPDATE & UPGRADE as I havent done one for a while, However the UPDATE failed with references to invalid signitures. I found a post on the community referencing public key for the APT repos, I followed that and then was able to UPDATE, UPGARDE and start openhab2.

Now my problem is when i try and toggle any switch using the the openhab2 client in the web browser nothing happens, however if I go to the switches IP address and toggle manually I see the messages in an MQTT client.

My items file is OK I havent changed that for months, so I am just wondering what I can check that would give me any hints to the problem.


you are not telling us which version you are using, but some of the older version had issues with MQTT that can be fixed by clearing the cache (stop OH2, enter openhab-cli clear-cache; start OH2)

Openhab is 2.4.0
Mosquitto is 1.4.10

I hope I did the right thing I did openhab-cli clean-cache ; as opposed to clear-cache (clear-cache wasnt an option)

I still appear to have the issue, I am guessing (I may be wrong), but I think its openhab not communicating with mosquitto as I can communicate with the switches with the mosquitto client and vice versa

yes, sorry, openhab-cli clean-cache is the correct term (if you have stopped OH2 before executing the command).
Do you have any errors in your log-file? What is the status of the broker thing?

Is Mosquitto started as a service?

Unfortunatly I am not a LINU guru, so I am not sure if mosquitto is started as a service, howver I am presuming it is because it always starts when the server reboots and has been running ok for a number of months. is there a command i can useto check?

openhab.log file doesnt seem to have any errors, is there another log file that i should be looking at.

By the way mosquitto is running OK from the command line

Then it is started as a service.
Check if it is running with show service mosquitto status

I am guessing that this means it is started.

service mosquitto status
● mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
   Loaded: loaded (/etc/init.d/mosquitto; generated; vendor preset: enabled)
   Active: active (running) since Sun 2019-09-29 15:50:55 BST; 15h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 395 ExecStart=/etc/init.d/mosquitto start (code=exited, status=0/SUCCESS)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/mosquitto.service
           └─441 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Sep 29 15:50:55 openHABianPi systemd[1]: Starting LSB: mosquitto MQTT v3.1 message broker...
Sep 29 15:50:55 openHABianPi mosquitto[395]: Starting network daemon:: mosquitto.
Sep 29 15:50:55 openHABianPi systemd[1]: Started LSB: mosquitto MQTT v3.1 message broker.

If you have openhab 2.4 now you did run the mqtt binding 1 before. After the update openHAB has most probably loaded the actual MQTT (version2) binding.
In this case remove the binding, enable legacy bindings and install the version 1 MQTT binding.
For moving to the version 2 binding of mqtt it needs one more actions and reading.

Thank you that solved the issue. Reverted to MQTT V1

Can you point me in the direction of the documentation to setup MQTT V2.

Via the tab “Addons” on the very top of this page you could come to the MQTT Documentation .