0

[PROGMEM] Out dated information on a tutorial?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

[PROGMEM] Out dated information on a tutorial?

by stonez56 on Wed Dec 26, 2018 10:42 am

This tutorial showed me how to subscribe to messages and it showed the usage of PROGMEM, in this page https://learn.adafruit.com/mqtt-adafruit-io-and-you/more-on-subscriptions
Code: Select all | TOGGLE FULL SIZE
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
// Setup a feed called 'onoff' for subscribing to changes.
const char ONOFF_FEED[] PROGMEM = AIO_USERNAME "/feeds/onoff";
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, ONOFF_FEED);

However, I got error during the Arduino compiling. After I saw another discussion saying not to use PROGMEM, I removed PROGMEM and updated the below format as
Code: Select all | TOGGLE FULL SIZE
Adafruit_MQTT_Subscribe ONOFF_FEED = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/ONOFF_FEED");


Then the error was gone! Maybe the tutorial should be updated?

Stonez

stonez56
 
Posts: 3
Joined: Mon Dec 24, 2018 3:03 am

Re: [PROGMEM] Out dated information on a tutorial?

by brubell on Wed Dec 26, 2018 2:00 pm

Hi Stonez,

Do you know what error your compiler threw, or can you link to the other discussion?

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

Re: [PROGMEM] Out dated information on a tutorial?

by stonez56 on Wed Dec 26, 2018 8:16 pm

Here is the discussion about the not to use PROGMEM and the error is exactly the same with mime https://forums.adafruit.com/viewtopic.php?f=25&t=120948

Error:
Code: Select all | TOGGLE FULL SIZE
Connecting to Adafruit IO...
Exception (3):


Look at the thread posted by adafruit_support_rick:

Code: Select all | TOGGLE FULL SIZE
by adafruit_support_rick on Fri Jul 28, 2017 3:03 pm
PROGMEM doesn't work with the current mqtt library:


Thank you,

Stonez

stonez56
 
Posts: 3
Joined: Mon Dec 24, 2018 3:03 am

Re: [PROGMEM] Out dated information on a tutorial?

by brubell on Thu Dec 27, 2018 12:17 pm

Thanks for the find - I've updated the page to reflect the current MQTT lib.

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

Please be positive and constructive with your questions and comments.