0

Huzzah esp8266 + MQTT, publish while subscribed?
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Huzzah esp8266 + MQTT, publish while subscribed?

by flimshaw on Thu Nov 19, 2015 6:49 pm

Is it possible to publish a message on MQTT while subscribed to another channel? As an example, I want to send a button press on MQTT, and in the background receive light on/off messages via MQTT. My first thought was subscribing with a long timeout, and publishing from within a pin change interrupt handler, but that crashes and understandably so. Is it possible to do live bidirectional communication with MQTT? Should I be maybe looking into another kind of socket connection instead?

flimshaw
 
Posts: 7
Joined: Thu Nov 13, 2014 12:28 am

Re: Huzzah esp8266 + MQTT, publish while subscribed?

by jwcooper on Fri Nov 20, 2015 12:06 pm

You should be able to subscribe and publish with mqtt and the esp8266.

Here is an example of a publish and subscribe:
https://github.com/adafruit/Adafruit_MQ ... sp8266.ino

jwcooper
 
Posts: 788
Joined: Tue May 01, 2012 9:08 pm

Please be positive and constructive with your questions and comments.