Subscriptions taking up a lot of SRAM

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
aidan_the_tinkerer
 
Posts: 50
Joined: Fri Nov 01, 2019 2:48 pm

Subscriptions taking up a lot of SRAM

Post by aidan_the_tinkerer »

Hi,

I am subscribing to around 25 feeds now and I have found that the lines where I do this like:

Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/onoff");

Take up most of my SRAM. Is there a way around this? Can I store something in PROGMEM instead, like my username?

Thanks,

Aidan

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

Re: Subscriptions taking up a lot of SRAM

Post by adafruit_support_mike »

What microcontroller are you using?

32-bit microcontrollers don’t have a PROGMEM interface, but they do allow you to read and write the Flash array from normal code. Declaring the strings as ‘const’ will keep them out of RAM.

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”