I'm developing a small tool against Adafruit IO. My board is an ESP8266 board (NodeMCU 1.0), and I'm using the Adafruit MQTT library for it - not the IO-specific library.
Everything works really well! This is great.
However, I've tried to add support for your /get subtopic, to set the initial value of an output on my board on boot. Like so:
Code: Select all
Adafruit_MQTT_Subscribe swingvalue = Adafruit_MQTT_Subscribe(&mqtt, SWINGBOT_FEED);
Adafruit_MQTT_Publish swingGet = Adafruit_MQTT_Publish(&mqtt, SWINGBOT_GET);
...
mqtt.subscribe(&swingvalue);
swingGet.publish("\0");