Hello IO community! Over the last few weeks we’ve released some changes to Adafruit IO that should be useful to everyone using the platform.

IO+ Yearly Billing

We’ve added the option to pay for IO+ on an annual basis at a reduced rate of $99 per year. So instead of paying $10 each month–$120 total for a year of service–you can pay $99 once and get the same year of IO+ features.

If you’re already an IO+ subscriber (thanks for your support!) and you want to switch, you can change to yearly billing on your profile page when you’re logged in to Adafruit IO. We’ve also added an Adafruit IO+ 1 Year Subscription Pass to the Adafruit shop, so you can buy one for yourself and gift a subscription to a friend!

Profile page with billing cycle change highlighted

MQTT /get and the case of the missing retain flag

MQTT is a tremendously useful protocol for building small connected devices and is relatively simple to understand and implement (if implementing networking protocols is your thing). Unfortunately, a few features of the Adafruit IO platform make it difficult for us to support the entire MQTT 3.1+ protocol specification in our broker. I’m going to talk briefly about one particular feature: the publish retain flag.

In the MQTT protocol, setting the retain flag on a published message asks the MQTT broker (server) to store that message. Then any new clients which connect and subscribe to that topic will immediately receive the retained message. Retain makes writing basic MQTT-only Internet of Things clients easier, without it, a client that connects and subscribes to a feed topic has to wait until a new value is published on the feed to know what state it should be in. In the case of slowly updated feeds, there could be hours between updates which means a device that disconnects and reconnects (for example, due to power cycling or sleeping) might lose the current value for a long time between updates.

Among other factors, our scale, our mix of MQTT & HTTP APIs, the speed at which we’re taking in new data, and the fact that we’re already storing almost every message that is sent mean that a “simple” feature like retain becomes difficult to support without making MQTT service performance worse for everyone.

Since we don’t actually store data in the broker but at a lower level and can’t support PUBLISH retain directly, we’re proposing a different solution for the retaining problem: the /get topic modifier.

The way it works is that for any given Adafruit IO MQTT feed topic (groups coming soon), subscribe to the feed topic, then add /get to the topic and publish anything to that new topic (our Arduino library uses the null character: '\0') . IO will immediately publish, just for that client, the most recent value received on the feed.

For example, if I have a Feather HUZZAH subscribed to a counter feed: abachman/f/counter, and I want to get the latest value when I connect, I could publish to abachman/f/counter/get and immediately receive a message on abachman/f/counter with the last value that feed received.

The feature is live on Adafruit IO and in version 2.7.3 of the Adafruit IO Arduino library which was released today. If you’re already using the library, you can add /get support to your project in one line of code.

// ... from the adafruitio_01_subscribe example sketch
AdafruitIO_Feed *counter = io.feed("counter");

void setup() {

  // 1. start IO connection
  io.connect();

  // 2. prepare MQTT subscription with handler function
  counter->onMessage(handleMessage);

  // 3. wait for successful connection
  while(io.mqttStatus() < AIO_CONNECTED) {
    delay(500);
  }

  // 4. send /get message, requesting last value
  counter->get(); // ask Adafruit IO to resend the last value

}
// ....

You can see the get() function in action in the example sketches in the updated Adafruit IO Arduino library.

Platform Upgrades

Early in the afternoon of April 18, we swapped out about 60% of the servers that are running IO and deployed an upgrade one of the primary software frameworks IO is built on (Ruby on Rails). Because framework upgrades are part of the boring, behind the scenes parts of software development and maintenance, you shouldn’t notice any change to IO except that data is processed about 4% faster on average. :D

No data in transit was lost, but there was a period of about 5 minutes of delayed MQTT data processing. A few early bugs were caught and fixed, so there may be some devices that were sending data successfully that failed for a brief time.


Get in touch with us on the Adafruit IO forums or ping @adam.io on Discord if you have any questions.