Skip to content

MQTT Subscribe command adds /# at the end of the topic #12858

Answered by sfromis
serifis84 asked this question in Q&A
Discussion options

You must be logged in to vote

According to the MQTT specifcation, what Tasmota does is not incorrect, and does not hinder you from subscribing to one specific topic, unless that topic is also a prefix of longer topic strings. Here's a specific example:

For example, if a Client subscribes to “sport/tennis/player1/#”, it would receive messages published using these topic names:

  • “sport/tennis/player1”
  • “sport/tennis/player1/ranking”
  • “sport/tennis/player1/score/wimbledon”

If you have a broker not working this way, it looks like a flaw in how wildcards are implemented in that broker. I've verified that mosquitto_sub indeed matches topic masks ending with /# with messages not having that last level.

Replies: 4 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
9 replies
@barbudor
Comment options

@arendst
Comment options

@arendst
Comment options

@noerich777
Comment options

@ascillato
Comment options

Answer selected by ascillato2
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
9 participants
Converted from issue

This discussion was converted from issue #12772 on August 10, 2021 22:36.