[CLOSED] Getting crazy with MQTT

Hi all, I’m trying to configure my mqtt part on my system.
Actually i’m runnig a home assistant ( 0.107.7) on a raspbian server (buster).
I’ve installed Mosquitto broker (5.1) with the following configuration:

logins:
  - username: XXXX
    password: YYYY
anonymous: false
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

I’ve created a user XXXX in the configuration > users with adminstrator grants, and I’ve activate the mqtt integration as mqtt broker

On the other side I have a tasmota device which is up and running on my network (I can ping it from the server)
in the configuration I inserted all the mqtt part, but if I go in the console, I get the following message:

13:30:24 MQT: Attempting connection...
13:30:24 MQT: Connect failed to 192.168.1.10:1883, rc -2. Retry in 10 sec

Do I miss something?

Ah, BTW I’ve also installed the tasmoadmin on my server, and it sees well the devices and I can interact with them!

Could you help me pls

First test : see if your mqtt is configured right.

Go to developer tools -> mqtt
under listen to a topic, enter # and click start listening
now under publish a packet, enter what is in the image and click publish

Do you see any reply in the screen ?

This is what I get

Message 0 received on tele/tasmotacucina/LWT at 2:13 PM:

Online

That is not the message from the test, but a message from your tasmota device. So clearly your tasmota device connects.

but on the console of this device I continue to get the following message

14:18:02 MQT: Connect failed to 192.168.1.10:1883, rc -2. Retry in 10 sec
14:18:02 UPP: Multicast (re)joined

and also I can add that, nothing appeared on the MQTT part even if it is still litening :frowning:

I’ve also stoped and started the listening part and I get just a multitude of
image

But nothing on the console of the tasmota device ?!?!?!

Multicast rejoined ?

I hope you did enter the ip of your mqtt broker, and not some mDNS name.

What do you expect to see on the console ? Your tasmota is sending tele messages, so it is connected.

This I see on one of my consoles :

13:56:20 MQT: lichtwaskot/tele/HASS_STATE = {"Version":"6.6.0(release-sonoff)","BuildDateTime":"2019-07-06T13:10:20","Core":"2_3_0","SDK":"1.5.3(aec24ac9)","Module":"Sonoff RF","RestartReason":"Power on","Uptime":"21T02:47:52","WiFi LinkCount":4,"WiFi Downtime":"0T00:00:18","MqttCount":5,"BootCount":146,"SaveCount":626,"IPAddress":"10.0.0.191","RSSI":"100","LoadAvg":19}
13:56:33 MQT: lichtwaskot/tele/STATE = {"Time":"2020-03-27T13:56:33","Uptime":"21T02:48:05","Heap":15,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"SNOW","BSSId":"10:FE:ED:AF:44:7A","Channel":10,"RSSI":100,"LinkCount":4,"Downtime":"0T00:00:18"}}
14:01:20 MQT: lichtwaskot/tele/HASS_STATE = {"Version":"6.6.0(release-sonoff)","BuildDateTime":"2019-07-06T13:10:20","Core":"2_3_0","SDK":"1.5.3(aec24ac9)","Module":"Sonoff RF","RestartReason":"Power on","Uptime":"21T02:52:52","WiFi LinkCount":4,"WiFi Downtime":"0T00:00:18","MqttCount":5,"BootCount":146,"SaveCount":626,"IPAddress":"10.0.0.191","RSSI":"100","LoadAvg":19}
14:01:32 MQT: lichtwaskot/tele/STATE = {"Time":"2020-03-27T14:01:32","Uptime":"21T02:53:04","Heap":15,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"SNOW","BSSId":"10:FE:ED:AF:44:7A","Channel":10,"RSSI":100,"LinkCount":4,"Downtime":"0T00:00:18"}}
14:06:19 MQT: lichtwaskot/tele/HASS_STATE = {"Version":"6.6.0(release-sonoff)","BuildDateTime":"2019-07-06T13:10:20","Core":"2_3_0","SDK":"1.5.3(aec24ac9)","Module":"Sonoff RF","RestartReason":"Power on","Uptime":"21T02:57:51","WiFi LinkCount":4,"WiFi Downtime":"0T00:00:18","MqttCount":5,"BootCount":146,"SaveCount":626,"IPAddress":"10.0.0.191","RSSI":"100","LoadAvg":19}
14:06:32 MQT: lichtwaskot/tele/STATE = {"Time":"2020-03-27T14:06:32","Uptime":"21T02:58:04","Heap":15,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"SNOW","BSSId":"10:FE:ED:AF:44:7A","Channel":10,"RSSI":100,"LinkCount":4,"Downtime":"0T00:00:18"}}
14:11:19 MQT: lichtwaskot/tele/HASS_STATE = {"Version":"6.6.0(release-sonoff)","BuildDateTime":"2019-07-06T13:10:20","Core":"2_3_0","SDK":"1.5.3(aec24ac9)","Module":"Sonoff RF","RestartReason":"Power on","Uptime":"21T03:02:51","WiFi LinkCount":4,"WiFi Downtime":"0T00:00:18","MqttCount":5,"BootCount":146,"SaveCount":626,"IPAddress":"10.0.0.191","RSSI":"100","LoadAvg":19}
14:11:32 MQT: lichtwaskot/tele/STATE = {"Time":"2020-03-27T14:11:32","Uptime":"21T03:03:04","Heap":15,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"SNOW","BSSId":"10:FE:ED:AF:44:7A","Channel":10,"RSSI":100,"LinkCount":4,"Downtime":"0T00:00:18"}}
14:16:19 MQT: lichtwaskot/tele/HASS_STATE = {"Version":"6.6.0(release-sonoff)","BuildDateTime":"2019-07-06T13:10:20","Core":"2_3_0","SDK":"1.5.3(aec24ac9)","Module":"Sonoff RF","RestartReason":"Power on","Uptime":"21T03:07:51","WiFi LinkCount":4,"WiFi Downtime":"0T00:00:18","MqttCount":5,"BootCount":146,"SaveCount":626,"IPAddress":"10.0.0.191","RSSI":"100","LoadAvg":19}
14:16:32 MQT: lichtwaskot/tele/STATE = {"Time":"2020-03-27T14:16:32","Uptime":"21T03:08:04","Heap":15,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"SNOW","BSSId":"10:FE:ED:AF:44:7A","Channel":10,"RSSI":100,"LinkCount":4,"Downtime":"0T00:00:18"}}
14:21:19 MQT: lichtwaskot/tele/HASS_STATE = {"Version":"6.6.0(release-sonoff)","BuildDateTime":"2019-07-06T13:10:20","Core":"2_3_0","SDK":"1.5.3(aec24ac9)","Module":"Sonoff RF","RestartReason":"Power on","Uptime":"21T03:12:51","WiFi LinkCount":4,"WiFi Downtime":"0T00:00:18","MqttCount":5,"BootCount":146,"SaveCount":626,"IPAddress":"10.0.0.191","RSSI":"100","LoadAvg":19}
14:21:32 MQT: lichtwaskot/tele/STATE = {"Time":"2020-03-27T14:21:32","Uptime":"21T03:13:04","Heap":15,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"SNOW","BSSId":"10:FE:ED:AF:44:7A","Channel":10,"RSSI":100,"LinkCount":4,"Downtime":"0T00:00:18"}}
14:26:22 MQT: lichtwaskot/tele/HASS_STATE = {"Version":"6.6.0(release-sonoff)","BuildDateTime":"2019-07-06T13:10:20","Core":"2_3_0","SDK":"1.5.3(aec24ac9)","Module":"Sonoff RF","RestartReason":"Power on","Uptime":"21T03:17:54","WiFi LinkCount":4,"WiFi Downtime":"0T00:00:18","MqttCount":5,"BootCount":146,"SaveCount":626,"IPAddress":"10.0.0.191","RSSI":"100","LoadAvg":19}
14:26:35 MQT: lichtwaskot/tele/STATE = {"Time":"2020-03-27T14:26:35","Uptime":"21T03:18:07","Heap":15,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":27,"POWER":"OFF","Wifi":{"AP":1,"SSId":"SNOW","BSSId":"10:FE:ED:AF:44:7A","Channel":10,"RSSI":100,"LinkCount":4,"Downtime":"0T00:00:18"}}


This is my configuration on the tasmota device.

On the console I don’t expect to recive

14:27:34 MQT: Connect failed to 192.168.1.10:1883, rc -2. Retry in 10 sec

But a connection establieshed (or something like this)
and find in the mosquito brocker log something like


1585303369: New connection from 172.30.32.1 on port 1883.
1585303369: New client connected from 172.30.32.1 as auto-DB605836-EE54-A07F-1581-382937132F8F (p2, c1, k60, u'homeassistant').
1585303852: Saving in-memory database to /data/mosquitto.db.
1585305653: Saving in-memory database to /data/mosquitto.db.

but with the IP of my tasmota device

Try this one :

in the tasmota console, enter Setoption19 1 and see if HA finds your device. It should, because clearly there is a connection.

the device restarted, but…


00:00:00 CFG: Loaded from flash at FA, Count 107
00:00:00 Project tasmota Luce - dx Version 8.1.0(tasmota)-2_6_1
00:00:00 WIF: Connecting to AP1 retOnaMC in mode 11N as tasmotacucina-0443...
00:00:08 WIF: Connected
00:00:08 HTP: Web server active on tasmotacucina-0443 with IP address 192.168.1.12
00:00:08 UPP: Multicast (re)joined
14:35:51 MQT: Attempting connection...
14:35:51 MQT: Connect failed to 192.168.1.10:1883, rc -2. Retry in 10 sec
14:35:52 UPP: Multicast (re)joined
14:36:02 MQT: Attempting connection...
14:36:02 MQT: Connect failed to 192.168.1.10:1883, rc -2. Retry in 10 sec
14:36:03 UPP: Multicast (re)joined
14:36:13 MQT: Attempting connection...
14:36:13 MQT: Connect failed to 192.168.1.10:1883, rc -2. Retry in 10 sec

Do you see the device in HA ?

not here and not in the devices list or in the entities…

this is why I’m getting crazy :’-(

You see tele/ messages passing by, but the rest does not work…

Googling on “tasmota Multicast (re)joined” seems to lead to 2 problems/solutions :

  • bad flash, could be repaired by flashing again
  • problems with the Wifi connection, could be repaired by rebooting your router.

ok, I will try to reinstall everything from scratch. thank you anyway .

If your going to flash again, try 8.2

I hate IT, I’ve reinstalled everything, with the same config, and now it works ;-(

thank you @francisp for your support anyway

Don’t tell that to someone who worked in IT for over 25 years :slight_smile:

you mean like I did? :wink: :smiley:

I usually find that happens when you stick your tongue out to the right whilst installing, rather than the left.

:rofl:

1 Like