0

Limit to widgets on Dashboard?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Limit to widgets on Dashboard?

by jdswope on Sat Dec 30, 2017 8:22 pm

I'm running a SIMPLE program (based on one of the io.adafruit examples) that simply registers a feed like:
"AdafruitIO_Feed *green = io.feed("Green");" and sets the message handler: "green->onMessage(handleMessage);"
This works perfectly for 5 feeds, but not for more than 5. My sixth and other feeds are completely ignored. I started commenting them out in the code then, changing which feeds I commented out. Every feed works as long as there are no More than 5 feeds at a time.

I'm using an Adafruit Feather Huzzah ESP8266 with the Arduino IDE with no errors during loading.
Any ideas?

John

jdswope
 
Posts: 4
Joined: Mon Apr 03, 2017 2:59 pm

Re: Limit to widgets on Dashboard?

by abachman on Tue Jan 02, 2018 3:17 pm

Hi John!

You've hit the default limit built into the Adafruit MQTT Library that IO uses for communication. Right now, 5 is set as the default limit for subscriptions as a constant in the Adafruit_MQTT.h file, visible here https://github.com/adafruit/Adafruit_MQTT_Library/blob/master/Adafruit_MQTT.h#L109.

If you go into your Arduino/libraries directory and find the Adafruit_MQTT_Library folder you can try changing that value to whatever you need. Because increasing the value allocates more memory for storing subscriptions, 5 was picked as a reasonable default for most uses / hardware platforms. It is worth noting, though, that subscribing to a lot of feeds and doing any delay heavy or timing sensitive work may cause your device to miss some feed data occasionally if feeds are updating close together. Make sure to test before you deploy anything permanent.


- adam

abachman
 
Posts: 191
Joined: Mon Feb 01, 2010 12:48 pm

Re: Limit to widgets on Dashboard?

by jdswope on Thu Jan 04, 2018 9:58 pm

Hi abachman!
Thanks again for the insights!

jdswope
 
Posts: 4
Joined: Mon Apr 03, 2017 2:59 pm

Please be positive and constructive with your questions and comments.