🎁📬❄️📦Adafruit Holiday Shipping Deadlines 2019: Please place all UPS 2 Day orders by 11am Monday, December 16 📦❄️📬🎁
0

MQTT ERROR: rejected, not a valid topic format
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

MQTT ERROR: rejected, not a valid topic format

by rum_01 on Sat Nov 30, 2019 3:20 pm

Hi,

I`m new to Adafruit IO.

When I try to subscribe MQTT to my Topic, the Adafruit IO Portal shows the Error "MQTT ERROR: rejected, not a valid topic format"
What`s wrong.

I have a ESP8266 and Platform.io using the Example "mqtt_esp8266_callback"
#include <ESP8266WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"

rum_01
 
Posts: 2
Joined: Thu Nov 14, 2019 4:00 pm

Re: MQTT ERROR: rejected, not a valid topic format

by brubell on Mon Dec 02, 2019 11:22 am

Hi rum_01,

Could you post your complete code below so I can assist you with debugging?

If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

brubell
 
Posts: 649
Joined: Fri Jul 17, 2015 10:33 pm

Re: MQTT ERROR: rejected, not a valid topic format

by rum_01 on Tue Dec 03, 2019 5:14 pm

OK. I did some more Debugging.... and found the problem.
I also used another libary for NTP time sync. I defined the following:
Code: Select all | TOGGLE FULL SIZE
...
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 3600, 60000);
...
}


Don`t know exactly where the problem is... but after removing the definition the subscription for the MQTT IO Adafruit works.

rum_01
 
Posts: 2
Joined: Thu Nov 14, 2019 4:00 pm

Re: MQTT ERROR: rejected, not a valid topic format

by brubell on Tue Dec 03, 2019 5:28 pm

Interesting, thanks for the update and report. I haven't seen this before on the forums. There might be a chance that your device's time wasn't syncing with the Adafruit IO MQTT broker's (server) time.

brubell
 
Posts: 649
Joined: Fri Jul 17, 2015 10:33 pm

Please be positive and constructive with your questions and comments.