subscribe to multibe channels mqtt

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
bguenthe
Posts: 11
Joined: Fri Jul 22, 2016 3:37 pm

subscribe to multibe channels mqtt

Post by bguenthe » Mon Sep 05, 2016 10:56 am

Hi,

as far as I understand, it's not possible to subscribe to multiple channels in the current mqtt implementation?

Greetings, Bernd

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: subscribe to multibe channels mqtt

Post by SpotlightKid » Mon Sep 05, 2016 11:28 am

What makes you think that?

Looking at the client code, it seems to be possible to just call "subscribe" several times with different topics. Your callback function is called with the topic name (and the msg payload) and needs to implement the dispatching.

bguenthe
Posts: 11
Joined: Fri Jul 22, 2016 3:37 pm

Re: subscribe to multibe channels mqtt

Post by bguenthe » Mon Sep 05, 2016 3:30 pm

correct - it works like a charm. Thanks!

Post Reply