adafruit / Adafruit_MQTT_Library

Arduino library for MQTT support
MIT License
571 stars 292 forks source link

Subscribe to /# or # topic (feed) #133

Open ReinhardDaemon opened 5 years ago

ReinhardDaemon commented 5 years ago

Hello,

Subscriptions to # topics (feeds) do not seem to work, but regarding to: (https://learn.adafruit.com/adafruit-io/mqtt-api) it should work.

Adafruit_MQTT_Subscribe subInst = Adafruit_MQTT_Subscribe(&mqtt, "test/#"); 
subInst.setCallback(subInstCallback);
mqtt.subscribe(&subInst);

void subInstCallback(char *data, uint16_t len) {
  Serial.println();
  Serial.print("----- subInstCallback:BEG ------");
  Serial.println(data);
  Serial.print("----- subInstCallback:END ------");
}

MQTT is connected, of course and processPackets() is called.

Everything works, when I change the feed from "test/#" to "test/1", for example.

Has someone made the same experience?