Reinstalling openhabian no mqtt working

I am trying to re install my openhabian using the latest openhabian 1.7 .The instalation goes as it should and through openhab-config i set my right time,location,linux password and i install MQTT broker Eclipse Mosquitto.Then i stop openhab.service and i restore my configuration using “sudo openhab-cli restore”.After restoring and rebooting my mqtt broker is not connecting at all with the error:

2021-12-22 15:20:55.389 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.1.150'. Next attempt in 60000ms
2021-12-22 15:20:55.396 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.1.150' with clientid 10e00147-187b-47a9-973d-dd737cd27231
==> /var/log/openhab/events.log <==
2021-12-22 15:20:55.393 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:b94727f5' changed from OFFLINE (COMMUNICATION_ERROR): io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /192.168.1.150:1883 to OFFLINE
2021-12-22 15:20:55.405 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:b94727f5' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /192.168.1.150:1883

Any ideas???

Check if the broker is running.

sudo netstat -tulpn | grep -i mosquitto

If it is running the output also will show if it is running on local interface and/or ehternet interface.
To make it running on ethernet interface you need to have a related configuration for this in /etc/mosquitto/mosquitto.conf. This was different in older versions of mosquitto.

thnx i got

openhabian@openhabian:~ $ sudo netstat -tulpn | grep -i mosquitto
tcp        0      0 127.0.0.1:1883          0.0.0.0:*               LISTEN      5855/mosquitto
tcp6       0      0 ::1:1883                :::*                    LISTEN      5855/mosquitto

so i think its running on local.I changed the brokers ip to “localhost” and it got connected.
how can i make it to run on ethernet again?

Check this thread:

I think all parts are there.

thnx mate i got it up and running

1 Like