adafruit / Adafruit_IO_Arduino

Arduino library to access Adafruit IO from WiFi, cellular, and ethernet modules.
Other
210 stars 107 forks source link

Example causes crash on esp32 #111

Closed ryleymcc closed 4 years ago

ryleymcc commented 4 years ago

Hello all, I'm using an esp32 feather huzzah from adafruit. I'm trying to run one of the examples called "group_sub" but I'm getting repeated crashes on all my esp32's. The other examples I've tested work fine. It seems to be something going on with the group message handler as every other example works? In the code I'm running I haven't even entered my wifi credential or adafruit io info but it shouldn't crash. My problem is probably obvious to someone I would just assume that the examples have been already proven to work.

Here is the report I get from the serial port.

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:8896 load:0x40080400,len:5816 entry 0x400806ac Connecting to Adafruit IOGuru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled. Core 1 register dump: PC : 0x400d1dc4 PS : 0x00060430 A0 : 0x800d1818 A1 : 0x3ffb1f60
A2 : 0x3ffbad70 A3 : 0x3f4012b0 A4 : 0x400d1788 A5 : 0xfefefefe
A6 : 0x00000001 A7 : 0x00000000 A8 : 0x800d1a0d A9 : 0x3ffb1f40
A10 : 0x3ffc1070 A11 : 0x3f401296 A12 : 0x3ffbec00 A13 : 0x00000003
A14 : 0x00000001 A15 : 0x00000000 SAR : 0x00000018 EXCCAUSE: 0x0000001c
EXCVADDR: 0xfefefefe LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

Backtrace: 0x400d1dc4:0x3ffb1f60 0x400d1815:0x3ffb1f80 0x400d503b:0x3ffb1fb0 0x40088b9d:0x3ffb1fd0

here is the code for the example. `// Adafruit IO Group Subscribe Example // // Adafruit invests time and resources providing this open source code. // Please support Adafruit and open source hardware by purchasing // products from Adafruit! // // Written by Todd Treece for Adafruit Industries // Copyright (c) 2018 Adafruit Industries // Licensed under the MIT license. // // All text above must be included in any redistribution.

/** Configuration ***/

// edit the config.h tab and enter your Adafruit IO credentials // and any additional configuration needed for WiFi, cellular, // or ethernet clients.

include "config.h"

/**** Example Starts Here ***/

// set up the group AdafruitIO_Group *group = io.group("example");

void setup() {

// start the serial connection Serial.begin(115200);

// wait for serial monitor to open while(! Serial);

// connect to io.adafruit.com Serial.print("Connecting to Adafruit IO"); io.connect();

group->onMessage("example.count-1", one); group->onMessage("example.count-2", two);

// wait for a connection while(io.status() < AIO_CONNECTED) { Serial.print(".");

delay(500);

}

// we are connected Serial.println(); Serial.println(io.statusText());

// force IO to update our MQTT subscription with the current values of all feeds group->get(); }

void loop() {

// io.run(); is required for all sketches. // it should always be present at the top of your loop // function. it keeps the client connected to // io.adafruit.com, and processes any incoming data. io.run();

}

// this function is called whenever a 'counter-1' message // is received from Adafruit IO. it was attached to // the counter-1 feed in the setup() function above. void one(AdafruitIO_Data *data) { Serial.print("received example.count-1 <- "); Serial.println(data->value()); }

// this function is called whenever a 'counter-2' message // is received from Adafruit IO. it was attached to // the counter-2 feed in the setup() function above. void two(AdafruitIO_Data *data) { Serial.print("received example.count-2 <- "); Serial.println(data->value()); }`

brentru commented 4 years ago

Please try installing the ESP32 stack trace decoder, and pasting the output from there: https://github.com/me-no-dev/EspExceptionDecoder

That will help tell us where it's getting stuck.

ryleymcc commented 4 years ago

Please try installing the ESP32 stack trace decoder, and pasting the output from there: https://github.com/me-no-dev/EspExceptionDecoder

That will help tell us where it's getting stuck.

Here is the output.

PC: 0x400d1dc4: AdafruitIO_Group::onMessage(char const, void ()(AdafruitIO_Data*)) at C:\Users\Ryley\Documents\Arduino\libraries\Adafruit_IO_Arduino\src\AdafruitIO_Group.cpp line 317 EXCVADDR: 0xfefefefe

Decoding stack results 0x400d1dc4: AdafruitIO_Group::onMessage(char const, void ()(AdafruitIO_Data)) at C:\Users\Ryley\Documents\Arduino\libraries\Adafruit_IO_Arduino\src\AdafruitIO_Group.cpp line 317 0x400d1815: setup() at C:\Users\Ryley\Documents\Arduino\libraries\Adafruit_IO_Arduino\examples\adafruitio_12_group_sub/adafruitio_12_group_sub.ino line 37 0x400d503b: loopTask(void) at C:\Users\Ryley\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\cores\esp32\main.cpp line 14 0x40088b9d: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143

brentru commented 4 years ago

Fixed in #115.