This post is concerned with the code specifically in the Adafruit geofencing sample at https://github.com/openhomeautomation/a ... ing_io.ino. Specifically it has the following block of code, which just sets up the mqtt variables in PROGMEM.
Code: Select all
// Adafruit IO configuration
#define AIO_SERVER "io.adafruit.com" // Adafruit IO server name.
#define AIO_SERVERPORT 1883 // Adafruit IO port.
#define AIO_USERNAME "your-adafruit-io-name" // Adafruit IO username (see http://accounts.adafruit.com/).
#define AIO_KEY "your-adafruit-io-key" // Adafruit IO key (see settings page at: https://io.adafruit.com/settings).
const char MQTT_SERVER[] PROGMEM = AIO_SERVER;
const char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;
const char MQTT_PASSWORD[] PROGMEM = AIO_KEY;
// Setup the FONA MQTT class by passing in the FONA class and MQTT server and login details.
Adafruit_MQTT_FONA mqtt(&fona, MQTT_SERVER, AIO_SERVERPORT, MQTT_USERNAME, MQTT_PASSWORD);
AT+CIPSTART="TCP","","1883"
However if I don't use PROGMEM and declare the mqtt with the next line everything works great.
Code: Select all
Adafruit_MQTT_FONA mqtt(&fona, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY);
I don't see any special methods reading the data here, so I am not quite sure how this is supposed to work. It would be great if it did, because my sketch is a little tight on memory. Has anybody else had problems with this code.
-Michael