0

MQTT /get topic - drops packets on 8266 MQTT libary
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

MQTT /get topic - drops packets on 8266 MQTT libary

by infov0re on Fri May 18, 2018 6:10 am

Hello -

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 | TOGGLE FULL SIZE
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");


The subscribe channel works fine. However, whenever I publish a null to swingGet, assuming it'll trigger a message on the subscription channel... the MQTT library informs me it's "Dropped a packet". So: something is clearly being chucked back from the MQTT subscription, but unlike all the regular message, it's leading to an issue. Do you have any idea why this might be?

infov0re
 
Posts: 3
Joined: Thu May 17, 2018 6:44 pm

Re: MQTT /get topic - drops packets on 8266 MQTT libary

by infov0re on Wed Jun 13, 2018 6:00 pm

Solved via viewtopic.php?f=56&t=136462 - that thread has more details, but basically, ensure the publish to the 'get' topic happens when you have a connection to Adafruit IO; inside the MQTT_Connect abstraction function is a good idea.

infov0re
 
Posts: 3
Joined: Thu May 17, 2018 6:44 pm

Please be positive and constructive with your questions and comments.