Closed DoiChris closed 5 years ago
Looks like you are building feedNameTemp with a hyphen rather than an underscore.
Adafruit IO Feeds should be declared with feed keys, not feed names.
Try changing the feed from Test20180626_Temp
to Test20180626-Temp
is there any restriction not to use underscore???
@DoiChris The restriction on underscores is specific to how Adafruit IO names feeds based on key identifiers https://learn.adafruit.com/naming-things-in-adafruit-io/introduction
I want to use the mac-address as key for the feed name. Therfore I need to hand over the feed name as a variable, not as fix string.
This works fine: Adafruit_MQTT_Publish temperature = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/Test20180626_Temp");
But this does not compile: String feedNameTemp;
feedNameTemp += "/feeds/"; uint8_t mac[6]; WiFi.macAddress(mac); feedNameTemp += macToStr(mac); feedNameTemp += "-"; feedNameTemp += "Temp";
Adafruit_MQTT_Publish temperature = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME, feedNameTemp);
Even if I try to use a string iteral like this it will not compile:
Adafruit_MQTT_Publish temperature = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "{0}", feedNameTemp);