[Question] Why subscribe to mqtt topic in the loop() #62
Unanswered
AxelMarquez
asked this question in
dscKeybusInterface Discussion
Replies: 1 comment
-
Hi @AxelMarquez - the PubSubClient needs to re-subscribe to the 'dsc/Set' topic after publishing to another topic so it can listen for commands. If you're curious there are also some examples of this in the PubSubClient library examples. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Good day 😊
Looking at the MQTT examples (HomeAssistant & HomeBridge), the mqtt.subscribe function is called every time dsc.StatusChanged = true in the loop(). But mqtt.subscribe is called as well when mqtt connects/re-connects.
I would assume the subscribe is only needed when connecting/re-connecting, is there a reason to have it in the loop()?
Many thanks for your support and awesome library!
Beta Was this translation helpful? Give feedback.
All reactions