0

Max feed count per sketch
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.
Please be positive and constructive with your questions and comments.

Max feed count per sketch

by mcwresearch on Sun Jan 03, 2021 9:10 am

I am troubleshooting an Arduino (v. 1.8.13) sketch used by a Feather ESP8266 Huzzah. In Arduino, I recently updated the board from ESP8266 v.2.4.2 to v. 2.7.4 and the Adafruit_IO_Arduino library from 3.0.0 to 4.0.2.

A copy of the sketch I am currently using to recreate the error is here: https://github.com/OilSlick/web_gateway ... ateway.ino The config.h file that you don’t have access to only contains wifi and AIO connection instructions.

The problem I am having is that if I enable one more AdafruitIO_Feed (I have several commented out in the sketch), I will predictably get an exception from the ESP8266. I currently have configured 20 feeds, 3 of which are pub/sub, 17 are pub only. With just one more feed, the Huzzah throws an exception.

Any help is much appreciated.

Thank you,

Michael

mcwresearch
 
Posts: 13
Joined: Wed Nov 23, 2016 4:52 am

Re: Max feed count per sketch

by brubell on Mon Jan 04, 2021 11:45 am

Hi, it's difficult to track down an error like this without meaningful output.

Could you please install the ESP exception decoder:
https://github.com/me-no-dev/EspExceptionDecoder

When your sketch gets an exception/stack error, copy and paste the error into the exception decoder.

Then, paste the output to this thread so I can review it.

Thanks!

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

Re: Max feed count per sketch

by mcwresearch on Mon Jan 04, 2021 7:17 pm

Below is the output.

Exception 28: LoadProhibited: A load referenced a page mapped with an attribute that does not permit loads
PC: 0x40220f96: br_ssl_hs_client_run at src/ssl/ssl_hs_client.c line 1871
EXCVADDR: 0x00000e94

Decoding stack results
0x402208e1: br_ssl_hs_client_run at src/ssl/ssl_hs_client.c line 1528
0x4021ef90: jump_handshake at src/ssl/ssl_engine.c line 1081
0x4021f475: br_ssl_engine_recvrec_ack at src/ssl/ssl_engine.c line 1206
0x40204ee2: BearSSL::WiFiClientSecure::_run_until(unsigned int, bool) at /Users/mwright/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp line 540
0x402023ec: Adafruit_MQTT_Client::connectServer() at /Users/mwright/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp line 34
0x40205091: BearSSL::WiFiClientSecure::available() at /Users/mwright/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp line 386
0x402044f2: BearSSL::WiFiClientSecure::connected() at /Users/mwright/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp line 260
0x40203120: ESP8266WiFiSTAClass::status() at /Users/mwright/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp line 634
0x40208e48: Adafruit_MQTT_Client::connected() at /Users/mwright/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp line 48
0x40201524: AdafruitIO::mqttStatus(bool) at /Users/mwright/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO.cpp line 437
0x402015bf: AdafruitIO::status() at /Users/mwright/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO.cpp line 368
0x402010bd: setup() at /Users/mwright/Documents/Arduino/web_gateway/web_gateway.ino line 67
0x40207158: loop_wrapper() at /Users/mwright/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/core_esp8266_main.cpp line 194

mcwresearch
 
Posts: 13
Joined: Wed Nov 23, 2016 4:52 am

Re: Max feed count per sketch

by brubell on Wed Jan 06, 2021 12:00 pm

The exception is thrown when you configure 21 feeds?

Could you file an issue over on https://github.com/adafruit/Adafruit_IO_Arduino/issues?

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

Re: Max feed count per sketch

by mcwresearch on Wed Jan 06, 2021 9:39 pm

I have created issue #146: https://github.com/adafruit/Adafruit_IO_Arduino/issues/146

The exception seems to be relatively consistent at 20+ feeds. I just commented out one feed—for a total of 19 feeds— and uploaded the sketch and after about ten minutes, I have not received an exception yet.

But note that the reason I found this issue was because I was troubleshooting general lockups on the device that are seemingly random; it may lock up after several weeks or only after several hours. I haven't found a pattern there yet. The device doesn't normally remain connected to my laptop, so troubleshooting the lockups is difficult and is something I've been working on for months (I started tracking it in August but have been fighting with it for longer than that). The device is normally deployed and working as a web gateway for several other LoRa devices. Because it is 'in production' I have resisted taking it offline for long periods to troubleshoot it, until now.

The device has been used in production for years. As I've continued to add LoRa devices to my home network, I've started seeing more lockups with the Huzzah. I don't know if those random lockups are caused by increased AIO feeds or a problem with my code or a combination of both. It's difficult to troubleshoot the device after a lockup when it isn't connected to a Serial output. However, with very simple code (and without the LoRa featherwing configured at all) I am able to force this specific exception with relative consistency: with ~20+ feeds configured.

I would also like to note that the exception output always contains the line number of my sketch that contains the following line, a loop which I copied from the "multiple feeds" example sketch provided with the library):
Code: Select all | TOGGLE FULL SIZE
while(io.status() < AIO_CONNECTED) {


The line number may change if I add or remove code before that line, but the exception output always contains that line from my code.

Thanks again for your help and let me know what else you might need from me.

mcwresearch
 
Posts: 13
Joined: Wed Nov 23, 2016 4:52 am

Please be positive and constructive with your questions and comments.