MQTT Broker Addon does not publish messages

Hi,

I can’t remember how many tutorials I now have tried to get a mqtt sensor working (diyprojects[DOT]io/esp8266-dht22-mqtt-make-iot-include-home-assistant, diyi0t[DOT]com/home-assistant-mqtt-tutorial/, https://learn.adafruit.com/set-up-home-assistant-with-a-raspberry-pi/mqtt-setup, to name a few of them…).
I don’t even come to the point where I can configure the sensors…
The plan is very simple, I’ll just have wemosd1 mini lites which will send their DHT22 measurements to the mosquitto broker, and I then want to show these values in my Overview dashboard.

What I’ve done now:

  • Installed HASSIO
  • Installed Mosquitto broker Addon via “Supervisor” (now Version 5.1.0)
    Configuration:
logins:
  - username: mquser
    password: mqpass
anonymous: false
customize:
  active: true
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false
  • Added the following to the Configuration yaml
mqtt:
  broker: core-mosquitto # This will have to be your mqtt broker, Mosquitto addon is recommended.
  discovery: true
  • Restart via Configuration > Server Controls

Now the problem, I connect via mqtt cli (hivemq[DOT]com/blog/mqtt-cli/)

$ mqtt sub -h 192.168.0.220 -u mquser --password mqpass -t home/whz/temp --verbose

Setting value of 'version' to default value: MQTT_5_0
Setting value of 'port' to default value: 1883
Empty identifier will lead to using broker generated client identifier
Command SubscribeCommand{host=192.168.0.220, port=1883, version=MQTT_5_0, user=mquser, useDefaultSsl=false, useWebSocket=falsetopics=[home/whz/temp], qos=[EXACTLY_ONCE], outputToConsole=true, base64=false, jsonOutput=false, showTopics=false} 
Client '[email protected]' sending CONNECT MqttConnect{keepAlive=60, cleanStart=true, sessionExpiryInterval=0, simpleAuth=MqttSimpleAuth{username and password}}
Client '[email protected]' received CONNACK MqttConnAck{reasonCode=SUCCESS, sessionPresent=false, assignedClientIdentifier=auto-53AB30AD-FDE6-D123-B72F-6D523ACCB295, restrictions=MqttConnAckRestrictions{receiveMaximum=65535, maximumPacketSize=268435460, topicAliasMaximum=10, maximumQos=EXACTLY_ONCE, retainAvailable=true, wildcardSubscriptionAvailable=true, sharedSubscriptionAvailable=true, subscriptionIdentifiersAvailable=true}} 
Client '[email protected]' sending SUBSCRIBE MqttSubscribe{subscriptions=[MqttSubscription{topicFilter=home/whz/temp, qos=EXACTLY_ONCE, noLocal=false, retainHandling=SEND, retainAsPublished=false}]}
Client '[email protected]' received SUBACK MqttSubAck{reasonCodes=[GRANTED_QOS_2], packetIdentifier=65526}

Via Supervisor > Mosquitto Broker > Log it looks fine:

1595258461: New connection from 192.168.0.43 on port 1883.
[INFO] found mquser on local database
1595258462: New client connected from 192.168.0.43 as auto-53AB30AD-FDE6-D123-B72F-6D523ACCB295 (p5, c1, k60, u'mquser').

Then I’ll publish a message via cli:

~$ mqtt pub -h 192.168.0.220 -u mquser --password mqpass -t home/whz/temp -m "23.5" --verbose

Setting value of 'version' to default value: MQTT_5_0
Setting value of 'port' to default value: 1883
Empty identifier will lead to using broker generated client identifier
Command PublishCommand{host=192.168.0.220, port=1883, version=MQTT_5_0, user=mquser, useDefaultSsl=false, useWebSocket=false, topics=[home/whz/temp], qos=[AT_MOST_ONCE], message=23.5} 
Client '[email protected]' sending CONNECT MqttConnect{keepAlive=60, cleanStart=true, sessionExpiryInterval=0, simpleAuth=MqttSimpleAuth{username and password}}
Client '[email protected]' received CONNACK MqttConnAck{reasonCode=SUCCESS, sessionPresent=false, assignedClientIdentifier=auto-0B1716CC-370F-74D4-453D-4A039E85B726, restrictions=MqttConnAckRestrictions{receiveMaximum=65535, maximumPacketSize=268435460, topicAliasMaximum=10, maximumQos=EXACTLY_ONCE, retainAvailable=true, wildcardSubscriptionAvailable=true, sharedSubscriptionAvailable=true, subscriptionIdentifiersAvailable=true}} 
Client '[email protected]' sending PUBLISH ('23.5') MqttPublish{topic=home/whz/temp, payload=4byte, qos=AT_MOST_ONCE, retain=false}
Client '[email protected]' received PUBLISH acknowledgement MqttPublishResult{publish=MqttPublish{topic=home/whz/temp, payload=4byte, qos=AT_MOST_ONCE, retain=false}}

The Output in the Mosquitto Broker log seems fine to me again

[INFO] found mquser on local database
1595258462: New client connected from 192.168.0.43 as auto-53AB30AD-FDE6-D123-B72F-6D523ACCB295 (p5, c1, k60, u'mquser').
1595258563: New connection from 192.168.0.43 on port 1883.
1595258563: New client connected from 192.168.0.43 as auto-0B1716CC-370F-74D4-453D-4A039E85B726 (p5, c1, k60, u'mquser').
1595258563: Client auto-0B1716CC-370F-74D4-453D-4A039E85B726 disconnected.

But in the other terminal window, nothing happens, no message to receive.
I tried with the MQTT-Explorer (0.4.0-beta1), and it shows no topic with the user, even that connection works and “Connection health: online” is shown.

Same when I use the homeassistant user and password I get when I choose Supervisor > Integrations > Mosquitto Broker > Configure > Re-Configure.

When I use [Supervisor > Integrations > Mosquitto Broker > Configure > Listen to a Topic > “home/whz/temp” > Start Listening] no message appears after sending the same command via the mqtt cli mentioned above.
When I open two tabs, one for listening and one for publishing, nothing happens.

For a fresh start, I rebooted the System (Supervisor > System > REBOOT) Still the same behaviour.

What to I do wrong?

configuration.yaml

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 50.0
  longitude: 10.0
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Europe/Berlin
  # Customization file
  customize: !include customize.yaml

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Discover some devices automatically
discovery:

mqtt:
  broker: core-mosquitto.local.hass.io # This will have to be your mqtt broker, Mosquitto addon is recommended.
  discovery: true
      
# Sensors
sensor:
  # Weather prediction
  - platform: yr
  
  - platform: systemmonitor
    resources:
      - type: disk_use
        arg: /
      - type: disk_use_percent
        arg: /home
      - type: memory_free
      
  - platform: command_line
    name: CPU Temperature
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    unit_of_measurement: "°C"
    value_template: '{{ (value | multiply(0.001)) | round(1) }}'


device_tracker:
  - platform: fritz
    track_new_devices: true
    
# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

api:

media_player:
- platform: androidtv
  device_class: firetv
  name: FireTV
  host: 192.168.0.52
  adbkey: "/config/adbkey"
  adb_server_ip: 127.0.0.1
  
remote:
  - platform: broadlink
    host: 192.168.0.47
    mac: 34:EA:34:E3:B2:34
    type: rm_mini3_redbean
    
switch:
  - platform: broadlink
    host: 192.168.0.47
    mac: '34:EA:34:E3:B2:34'
    timeout: 15
    switches:
      # Will work on most Phillips TVs:
      tv_wohnzimmer:
        friendly_name: "TV Wohnzimmer"
        command_on: 'JgCMAJaSFDYUNhQ1FBEUERQRFBEUERQ1FDYUNhQRExEUERQRFBEUERQ1FBEUERQRFBEUERQREzYUERQ2FDUUNhQ2FDUUNhQABgKWkhQ2FDYUNRQRFBEUERQRFBEUNRQ2FDYUERMRFBEUERQRFBEUNRQRFBEUERQRFBEUERM2FBEUNhQ1FDYUNhQ1FDYUAA0FAAAAAAAAAAAAAAAA'
        command_off: 'JgCMAJaSFDYUNhQ1FBEUERQRFBEUERQ1FDYUNhQRExEUERQRFBEUERQ1FBEUERQRFBEUERQREzYUERQ2FDUUNhQ2FDUUNhQABgKWkhQ2FDYUNRQRFBEUERQRFBEUNRQ2FDYUERMRFBEUERQRFBEUNRQRFBEUERQRFBEUERM2FBEUNhQ1FDYUNhQ1FDYUAA0FAAAAAAAAAAAAAAAA'
      staubsauger:
        friendly_name: "Roby"
        command_on: 'JgBeAZWQFDUUEBQRFBAUERQQFBETNRQ1FBEUEBQRFBAUERQQFDUUERQQFBEUNBQRFBAUERQQFDUUNRQ1FBEUNRQ1EzUUNRQAA7WUkBU0FBEUERMRFBAUERQQEzYTNhMSERMSExETEhMRExI3EhISExISEjcSExETEhMRExI3EjcTNhMREzYUNRQ1FDUUAAO1kpISNxITERMSExETEhMRExI3EjcSEhITERMSExETExIROBISEhMSEhM2ExETEhMRExITNhM2EzYTERM2FDUUNRQ1FAADtJWOFjUUEBQRFBAUERQQFBEUNBU0FBEUEBQRFBAUERQQFDUUERQQFBEUNBUQFBAUERQQFDUUNRQ1FBEUNRQ0FDUUNRQAA7WUkBQ1FBEUEBQRFBAUERQQFDUUNRQRFBAUEBQRFBAUERQ1FBAUERQQFDUUERQQFBETERQ1FDUUNRQQFDUUNRQ1FDUUAA0FAAAAAAAAAAAAAA=='
        command_off: 'JgBeAZWQFDUUEBQRFBAUERQQFBETNRQ1FBEUEBQRFBAUERQQFDUUERQQFBEUNBQRFBAUERQQFDUUNRQ1FBEUNRQ1EzUUNRQAA7WUkBU0FBEUERMRFBAUERQQEzYTNhMSERMSExETEhMRExI3EhISExISEjcSExETEhMRExI3EjcTNhMREzYUNRQ1FDUUAAO1kpISNxITERMSExETEhMRExI3EjcSEhITERMSExETExIROBISEhMSEhM2ExETEhMRExITNhM2EzYTERM2FDUUNRQ1FAADtJWOFjUUEBQRFBAUERQQFBEUNBU0FBEUEBQRFBAUERQQFDUUERQQFBEUNBUQFBAUERQQFDUUNRQ1FBEUNRQ0FDUUNRQAA7WUkBQ1FBEUEBQRFBAUERQQFDUUNRQRFBAUEBQRFBAUERQ1FBAUERQQFDUUERQQFBETERQ1FDUUNRQQFDUUNRQ1FDUUAA0FAAAAAAAAAAAAAA=='
      staubsauger_aufladen:
        friendly_name: "Roby aufladen"
        command_on: 'JgBeAZSQFDUUERQQFBEUEBQRFBAUNRQ1FBAUERQQFBEUEBQRFDUUNBUQFBEUEBQQFBEUEBQRFBAUNRQ1FDUUNRQ1FDUUNRQAA7KXkBQ0FRAUERQQFBEUEBQRFDUUNRQQFBEUEBQRFBAUEBQ1FDUUERQQFBEUEBQRFBAUERQQFDUUNRQ1FDUUNRQ1FDQVAAO0lZAUNRQQFBEUEBQRFBAUERQ0FDUUERQQFBEUEBQRFBAUNRQ1FBEUEBQRExEUEBQRFBAUERQ1FDUUNRQ0FTQUNRQ1FAADtZSQFTQUERQQFBEUEBQRFBAUNRQ1FBEUEBQRFBAUERMRFDUUNRQQFBEUEBQRFBAUERQQFBEUNBQ1FDUUNRQ1FDUUNRQAA7WUkBQ1FBEUEBQRFBAUERQQFDUUNRQQFBEUEBQRFBAUERQ1FDUUEBQRExEUEBQRFBAUERQQFDUUNRQ1FDUUNRQ1FDUUAA0FAAAAAAAAAAAAAA=='

Supervisor > Mosquitto Broker > Configuration: (Network ports are all in default)

logins:
  - username: mquser
    password: mqpass
anonymous: false
customize:
  active: true
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

The Supervisor > Mosquitto Broker > Log

[17:33:18] INFO: Setup mosquitto configuration
[17:33:18] WARNING: SSL not enabled - No valid certs found!
[17:33:18] INFO: Found local users inside config
[17:33:19] INFO: Initialize Hass.io Add-on services
[17:33:19] INFO: Initialize Home Assistant discovery
[17:33:19] INFO: Start Mosquitto daemon
1595259199: Loading config file /share/mosquitto/acl.conf
1595259199: mosquitto version 1.6.3 starting
1595259199: Config loaded from /etc/mosquitto.conf.
1595259199: Loading plugin: /usr/share/mosquitto/auth-plug.so
1595259199: |-- *** auth-plug: startup
1595259199:  ├── Username/password checking enabled.
1595259199:  ├── TLS-PSK checking enabled.
1595259199:  └── Extended authentication not enabled.
1595259199: Opening ipv4 listen socket on port 1883.
1595259199: Opening ipv6 listen socket on port 1883.
1595259199: Opening websockets listen socket on port 1884.
1595259199: Warning: Mosquitto should not be run as root/administrator.
1595259369: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1595259371: New client connected from 172.30.32.1 as auto-966DDFC5-0754-C6D9-88B0-7169196EB4CB (p2, c1, k60, u'homeassistant').
1595259625: New connection from 192.168.0.43 on port 1883.
[INFO] found mquser on local database
1595259626: New client connected from 192.168.0.43 as auto-10245C81-C8BD-D038-711F-739BA49B3487 (p5, c1, k60, u'mquser').
1595259626: Client auto-10245C81-C8BD-D038-711F-739BA49B3487 disconnected.
1595259685: New connection from 192.168.0.43 on port 1883.
1595259685: New client connected from 192.168.0.43 as auto-34AC40AE-C592-CEFE-20E3-53C5D550D122 (p5, c1, k60, u'mquser').
1595259685: Client auto-34AC40AE-C592-CEFE-20E3-53C5D550D122 disconnected.
1595259827: New connection from 192.168.0.43 on port 1883.
[INFO] found homeassistant on local database
1595259828: New client connected from 192.168.0.43 as auto-D8AF9B89-C7B7-A385-E032-11012F5CE2EE (p5, c1, k60, u'homeassistant').
1595259828: Client auto-D8AF9B89-C7B7-A385-E032-11012F5CE2EE disconnected.
1595259831: New connection from 192.168.0.43 on port 1883.
1595259831: New client connected from 192.168.0.43 as auto-97439B42-FD88-C1C9-71A2-8CA7E9BBDAF1 (p5, c1, k60, u'homeassistant').
1595259831: Client auto-97439B42-FD88-C1C9-71A2-8CA7E9BBDAF1 disconnected.
1595259893: New connection from 192.168.0.43 on port 1883.
1595259893: New client connected from 192.168.0.43 as auto-00F14833-A61A-3254-4252-327F1E2AD4D5 (p5, c1, k60, u'mquser').
1595259893: Client auto-00F14833-A61A-3254-4252-327F1E2AD4D5 disconnected.

Supervisor > System > Core Logprovider:

2020-07-20 17:27:22 WARNING (SyncWorker_0) [androidtv.adb_manager] Couldn't connect to 192.168.0.52:5555 via ADB server 127.0.0.1:5037 because the server is not connected to the device
2020-07-20 17:27:22 WARNING (SyncWorker_0) [homeassistant.components.androidtv.media_player] Could not connect to FireTV at 192.168.0.52:5555 using ADB server at 127.0.0.1:5037
2020-07-20 17:27:22 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 180 seconds.
2020-07-20 17:30:23 WARNING (SyncWorker_10) [androidtv.adb_manager] Couldn't connect to 192.168.0.52:5555 via ADB server 127.0.0.1:5037 because the server is not connected to the device
2020-07-20 17:30:23 WARNING (SyncWorker_10) [homeassistant.components.androidtv.media_player] Could not connect to FireTV at 192.168.0.52:5555 using ADB server at 127.0.0.1:5037
2020-07-20 17:30:23 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 180 seconds.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
2020-07-20 17:30:33 WARNING (Thread-4) [homeassistant.components.mqtt] Disconnected from MQTT server core-mosquitto.local.hass.io:1883 (0)
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] udev.sh: executing... 
[17:33:43] INFO: Update udev information
[cont-init.d] udev.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2020-07-20 17:36:05 WARNING (MainThread) [homeassistant.setup] Setup of person is taking over 10 seconds.
2020-07-20 17:36:05 WARNING (MainThread) [homeassistant.setup] Setup of hassio is taking over 10 seconds.
2020-07-20 17:36:08 WARNING (SyncWorker_19) [androidtv.adb_manager] Couldn't connect to 192.168.0.52:5555 via ADB server 127.0.0.1:5037 because the server is not connected to the device
2020-07-20 17:36:08 WARNING (SyncWorker_19) [homeassistant.components.androidtv.media_player] Could not connect to FireTV at 192.168.0.52:5555 using ADB server at 127.0.0.1:5037
2020-07-20 17:36:09 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 30 seconds.
2020-07-20 17:36:10 WARNING (MainThread) [homeassistant.components.mobile_app.notify] Found duplicate device name dome's Nokia 4.2
2020-07-20 17:36:10 WARNING (MainThread) [homeassistant.components.mobile_app.notify] Found duplicate device name dome's Nokia 4.2
2020-07-20 17:36:10 WARNING (MainThread) [homeassistant.components.mobile_app.notify] Found duplicate device name dome's Nokia 4.2
2020-07-20 17:36:10 WARNING (MainThread) [homeassistant.components.mobile_app.notify] Found duplicate device name dome's Nokia 4.2
2020-07-20 17:36:10 WARNING (MainThread) [homeassistant.components.mobile_app.notify] Found duplicate device name dome's Nokia 4.2
2020-07-20 17:36:10 WARNING (MainThread) [homeassistant.components.mobile_app.notify] Found duplicate device name dome's Nokia 4.2
2020-07-20 17:36:40 WARNING (SyncWorker_10) [androidtv.adb_manager] Couldn't connect to 192.168.0.52:5555 via ADB server 127.0.0.1:5037 because the server is not connected to the device
2020-07-20 17:36:40 WARNING (SyncWorker_10) [homeassistant.components.androidtv.media_player] Could not connect to FireTV at 192.168.0.52:5555 using ADB server at 127.0.0.1:5037
2020-07-20 17:36:40 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 60 seconds.
2020-07-20 17:37:41 WARNING (SyncWorker_14) [androidtv.adb_manager] Couldn't connect to 192.168.0.52:5555 via ADB server 127.0.0.1:5037 because the server is not connected to the device
2020-07-20 17:37:41 WARNING (SyncWorker_14) [homeassistant.components.androidtv.media_player] Could not connect to FireTV at 192.168.0.52:5555 using ADB server at 127.0.0.1:5037
2020-07-20 17:37:41 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 90 seconds.
2020-07-20 17:39:12 WARNING (SyncWorker_7) [androidtv.adb_manager] Couldn't connect to 192.168.0.52:5555 via ADB server 127.0.0.1:5037 because the server is not connected to the device
2020-07-20 17:39:12 WARNING (SyncWorker_7) [homeassistant.components.androidtv.media_player] Could not connect to FireTV at 192.168.0.52:5555 using ADB server at 127.0.0.1:5037
2020-07-20 17:39:12 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 120 seconds.
2020-07-20 17:41:13 WARNING (SyncWorker_16) [androidtv.adb_manager] Couldn't connect to 192.168.0.52:5555 via ADB server 127.0.0.1:5037 because the server is not connected to the device
2020-07-20 17:41:13 WARNING (SyncWorker_16) [homeassistant.components.androidtv.media_player] Could not connect to FireTV at 192.168.0.52:5555 using ADB server at 127.0.0.1:5037
2020-07-20 17:41:13 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 150 seconds.
2020-07-20 17:43:44 WARNING (SyncWorker_13) [androidtv.adb_manager] Couldn't connect to 192.168.0.52:5555 via ADB server 127.0.0.1:5037 because the server is not connected to the device
2020-07-20 17:43:44 WARNING (SyncWorker_13) [homeassistant.components.androidtv.media_player] Could not connect to FireTV at 192.168.0.52:5555 using ADB server at 127.0.0.1:5037
2020-07-20 17:43:44 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 180 seconds.
2020-07-20 17:46:45 WARNING (SyncWorker_4) [androidtv.adb_manager] Couldn't connect to 192.168.0.52:5555 via ADB server 127.0.0.1:5037 because the server is not connected to the device
2020-07-20 17:46:45 WARNING (SyncWorker_4) [homeassistant.components.androidtv.media_player] Could not connect to FireTV at 192.168.0.52:5555 using ADB server at 127.0.0.1:5037
2020-07-20 17:46:45 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 180 seconds.

Any help is much appreciated.

I don’t see anything wrong at first sight. However, your mqtt cli seems to assume the add-on uses protocol 5.0

It does not. The mosquitto add-on uses protocol 3.1.

Thanks for the quick reply. I tried with 3.1

$ mqtt pub -h 192.168.0.220 -u mquser --password mqpass -t home/whz/temp -m "23.5" --verbose
Setting value of 'version' to default value: MQTT_3_1_1
Setting value of 'port' to default value: 1883
Created identifier ('mqtt1tYDUwSg')
Command PublishCommand{host=192.168.0.220, port=1883, version=MQTT_3_1_1, identifier=mqtt1tYDUwSg, user=mquser, useDefaultSsl=false, useWebSocket=false, topics=[home/whz/temp], qos=[AT_MOST_ONCE], message=23.5} 
Client '[email protected]' sending CONNECT MqttConnect{keepAlive=60, cleanSession=true, simpleAuth=MqttSimpleAuth{username and password}}
Client '[email protected]' received CONNACK MqttConnAck{returnCode=SUCCESS, sessionPresent=false} 
Client '[email protected]' sending PUBLISH ('23.5') MqttPublish{topic=home/whz/temp, payload=4byte, qos=AT_MOST_ONCE, retain=false}
Client '[email protected]' received PUBLISH acknowledgement MqttPublish{topic=home/whz/temp, payload=4byte, qos=AT_MOST_ONCE, retain=false}

But the client still does not receive anything :frowning:

$ mqtt sub -h 192.168.0.220 -u mquser --password mqpass -t home/whz/temp --verbose
Setting value of 'version' to default value: MQTT_3_1_1
Setting value of 'port' to default value: 1883
Created identifier ('mqttEgxDSN8B')
Command SubscribeCommand{host=192.168.0.220, port=1883, version=MQTT_3_1_1, identifier=mqttEgxDSN8B, user=mquser, useDefaultSsl=false, useWebSocket=falsetopics=[home/whz/temp], qos=[EXACTLY_ONCE], outputToConsole=true, base64=false, jsonOutput=false, showTopics=false} 
Client '[email protected]' sending CONNECT MqttConnect{keepAlive=60, cleanSession=true, simpleAuth=MqttSimpleAuth{username and password}}
Client '[email protected]' received CONNACK MqttConnAck{returnCode=SUCCESS, sessionPresent=false} 
Client '[email protected]' sending SUBSCRIBE MqttSubscribe{subscriptions=[MqttSubscription{topicFilter=home/whz/temp, qos=EXACTLY_ONCE}]}
Client '[email protected]' received SUBACK MqttSubAck{returnCodes=[SUCCESS_MAXIMUM_QOS_2]}

Let your client listen to #

And set ``

customize: false

In your config.

1 Like
$ mqtt sub -h 192.168.0.220 -u mquser --password mqpass -t "#" --verbose
Setting value of 'version' to default value: MQTT_3_1_1
Setting value of 'port' to default value: 1883
Created identifier ('mqttSncymNdo')
Command SubscribeCommand{host=192.168.0.220, port=1883, version=MQTT_3_1_1, identifier=mqttSncymNdo, user=mquser, useDefaultSsl=false, useWebSocket=falsetopics=[#], qos=[EXACTLY_ONCE], outputToConsole=true, base64=false, jsonOutput=false, showTopics=false} 
Client '[email protected]' sending CONNECT MqttConnect{keepAlive=60, cleanSession=true, simpleAuth=MqttSimpleAuth{username and password}}
Client '[email protected]' received CONNACK MqttConnAck{returnCode=SUCCESS, sessionPresent=false} 
Client '[email protected]' sending SUBSCRIBE MqttSubscribe{subscriptions=[MqttSubscription{topicFilter=#, qos=EXACTLY_ONCE}]}
Client '[email protected]' received SUBACK MqttSubAck{returnCodes=[SUCCESS_MAXIMUM_QOS_2]}

No change with the same publish command. (Publish to # fails, but I guess that is expected)

EDIT: Going to Supervisor > Mosquitto Broker > Configuration and set customze to false says: “Failed to save addon configuration, [object Object]”

logins:
  - username: mquser
    password: mqpass
anonymous: false
customize: false
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

And this option in the configuration yaml leads to: "Invalid config for [mqtt]: [customize] is an invalid option for [mqtt]. Check: mqtt->mqtt->customize. (See /config/configuration.yaml, line 26). "

Edit 2:

customize:
  active: false

does let me save the config

customize:
  active: false

Worked so far! My client now receives the message!

And it now works in the UI as well, thank you so much!

My problems:

  1. Used the wrong Protocol version (5, as mqtt cli default)
    => changed mqtt.version in ~/.mqtt-cli/config.properties to “mqtt.version=3”
  2. Customize needs to be turned off (if you don’t know what you are doing :wink: )
    => Supervisor > Mosquitto broker > Configuration
customize:
  active: false

Note: Set this to the solution as customize: false does not work directly. But the credits have to go to francisp