Adafruit IO Arduino Library HTTP API "/get" documentation error

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.
Locked
User avatar
chicoDaMan
 
Posts: 3
Joined: Thu Aug 03, 2017 1:23 pm

Adafruit IO Arduino Library HTTP API "/get" documentation error

Post by chicoDaMan »

Hi - I'm using the Adafruit IO Arduino library with ESP32, MQTT and the Adafruit IO dashboard data display system.

I'm trying to obtain some retained values from my feeds. The Adafruit method for this is described in the Adafruit IO HTTP API in the section "Using the */get topic":

https://io.adafruit.com/api/docs/mqtt.h ... -get-topic

However, that document is missing a key piece of information.

In the documentation (linked above) it says the following:

"If you’re using the Adafruit IO Arduino library, you can add /get support to your project in one line of code:"

....but where that line of code should be displayed, it's blank.

After the blank space, it goes on to correctly describe how to do this with the Adafruit IO CircuitPython library in one line of code, but I need the one line of code that lets me do it with the Adafruit IO Arduino library.

Can anyone tell me what the missing line is? Thanks....

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit IO Arduino Library HTTP API "/get" documentation error

Post by adafruit_support_mike »

Hmm.. I'll pass that along to the documentation team.

User avatar
brubell
Learn User Page
 
Posts: 2010
Joined: Fri Jul 17, 2015 10:33 pm

Re: Adafruit IO Arduino Library HTTP API "/get" documentation error

Post by brubell »

Hi, we've added this code snippet to the page:

Code: Select all

```
// ... 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, triggering
  //    the handleMessage handler function
  counter->get(); // ask Adafruit IO to resend the last value
}
```
Thank you for bringing this to our attention!

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

Return to “Internet of Things: Adafruit IO and Wippersnapper”