0

I am using ESP8266 SMING framework as a MQTT client and using node.js mosca MQTT broker.

I noticed that sometimes, topics are not subscribed successfully. How can I get the list of topics that have been successfully subscribed to the mosca mqtt broker? This way, I can force a re-subscription attempt if the previous attempt failed.

If the list of topics cannot be retrieved, I will accept any answers that can work around this intermittent subscription problem.

guagay_wk
  • 26,337
  • 54
  • 186
  • 295

1 Answers1

0

This does not answer your question directly but offers a work-around. There is no API function in Sming's MQTT library that retrieves the list of subscribed topics.

Inside Sming's sample example MqttClient_Hello, run a timer function that will fire, say 5 seconds, after the mqtt connection is established.

void resubscribe()
{
    mqtt.subscribe("Your topic");
}
guagay_wk
  • 26,337
  • 54
  • 186
  • 295