Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Consistent errors updating a feed
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.

Consistent errors updating a feed

by ron_g on Fri Apr 01, 2016 2:15 pm

I am using Adafruit_IO_Feed's send() to update a series of feeds once every 5 minutes. When I first start the sketch all of the feeds update successfully. However on the second iteration of updates the update of the first feed always fails. The other 4 succeed every time. When connected via serial monitor I see this message come out on the failed feed
Failed to connect to service!


I have tried re-ordering which feed is first and it does change things. Whatever the first feed is always fails. Below is the code for the first two feed updates. The one for lux always works the first time and always fails every time after that.
Code: Select all | TOGGLE FULL SIZE
...
Adafruit_IO_Feed luxFeed = aio.getFeed("outdoor_lux");
Adafruit_IO_Feed batteryFeed = aio.getFeed("outdoor_battery_voltage");
...
  if (luxFeed.send(lux)) {
    Serial.print(F("Wrote lux to feed: ")); Serial.println(lux, DEC);
  } else {
    Serial.println(F("Error writing lux"));
  }
  if (batteryFeed.send(measuredvbat)) {
    Serial.print(F("Wrote battery voltage to feed: ")); Serial.println(measuredvbat, DEC);
  } else {
    Serial.println(F("Error writing battery voltage"));
  }


Is there something I need to call to 'prime the pump' to get it to work?

ron_g
 
Posts: 156
Joined: Tue Apr 05, 2011 6:21 pm

Re: Consistent errors updating a feed

by ron_g on Fri Apr 01, 2016 3:36 pm

PS as a workaround I created a dummy feed and send() to it. Always fails, but I don't care as the real feeds all work. Seems like a waste though.

ron_g
 
Posts: 156
Joined: Tue Apr 05, 2011 6:21 pm

Please be positive and constructive with your questions and comments.