adafruit / Adafruit_MQTT_Library

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

MQTT ERROR: rejected, not a valid topic format - When connecting to AdafruitIO #163

Closed rum-neutralo closed 4 years ago

rum-neutralo commented 4 years ago

Adafruit_MQTT_Subscribe slider = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/slider");

When i run: mqtt.subscribe(&slider); the Adafruit.IO MQTT Errors show "MYUSERNAME/errors" => rejected, not a valid topic format ?

rum-neutralo commented 4 years ago

Seams to be a Problem together with another library WiFiUDP ntpUDP; NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 3600, 60000); ...

Having removed the ntpUDP and NTPClient the subscription works

mkraats commented 4 years ago

I'm still seeing this in my sketch and I'm not using the ntpUDP and NTPClient libraries. How did you determine it was a problem with WiFiUDP ? My sketch uses MDNS which uses WiFiUDP though. I commented that out but I still get the same strange error "not a valid topic format".

brentru commented 4 years ago

Resolved by @mkraats on the forums

Ah, one should always be careful after dusting off old code. Apparently, I had used:

define AIO_MYFEED "myfeedname"

But now, only:

define AIO_PM25 "/feeds/groupname.feedname"

Seems to work.