Black Lives Matter - Action and Equality.
0

Managing Groups of Feeds programmatically
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.

Managing Groups of Feeds programmatically

by tgmcnaughton on Fri May 08, 2020 3:58 pm

I have multiple particle photons, each logging multiple feeds to AIO and I want to organize them into groups programmatically.
I have working code that gets the 'deviceName' from the particle cloud at runtime, and creates multiple feeds named like: deviceNfeedM (eg: device1feed1, device1Feed2 ....)
This works great, but all feeds go by default under a group named by my username. I would like the feeds from each device to go to a group based on the particular deviceName.
The following works to create (if necessary) or append to 4 different feeds "deviceA1, deviceA2 ...";

Code: Select all | TOGGLE FULL SIZE
void loop()
{
    i = (i+1) % 16;
    int feed = i%4;
    if (init) {
        strcpy(tmp,deviceName);
        testFeedx  = AIOClient.getFeed( strcat(tmp,String(feed) ) );
        testFeedx.send( String( i ) );
    }
    delay(4000);
}


At the website, I can "Create a new group" (say "deviceA") and then manually "add feed to group". The new key is like: "deviceA.deviceA1"
I tried something like:
testFeedx = AIOClient.getFeed( "deviceA.deviceA1" );
But no luck.

How do I do create and manipulate groups programmatically?

tgmcnaughton
 
Posts: 4
Joined: Sat Mar 10, 2012 10:13 pm

Re: Managing Groups of Feeds programmatically

by brubell on Tue May 12, 2020 10:41 am

Hi, which library are you using on the Particle to communicate with Adafruit IO?

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

Re: Managing Groups of Feeds programmatically

by tgmcnaughton on Tue May 12, 2020 12:06 pm

I'm using the particle web IDE (not desktop) - with:

Adafruit_IO_Particle ver 1.0.1

(it says - "version locked at 1.0.1").

tgmcnaughton
 
Posts: 4
Joined: Sat Mar 10, 2012 10:13 pm

Re: Managing Groups of Feeds programmatically

by brubell on Fri May 15, 2020 10:16 am

tgmcnaughton wrote:I'm using the particle web IDE (not desktop) - with:

Adafruit_IO_Particle ver 1.0.1

(it says - "version locked at 1.0.1").

It doesn't look like the library has group functionality, only feed functionality:
https://github.com/AronRubin/Adafruit_I ... rticle.cpp

The Adafruit IO Arduino library (https://github.com/adafruit/Adafruit_IO_Arduino/) is more feature-complete and has groups functionality.

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

Please be positive and constructive with your questions and comments.