-->
Page 1 of 1

program freezes inside call to delay(1); WDT reset

PostPosted: Mon Jul 24, 2017 2:39 pm
by zoidicus
I successfully deployed the following Azure IOT Hub tutorial (same Adafruit Huzzah hardware too):
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-arduino-huzzah-esp8266-get-started

When I add a call to function IoTHubClient_LL_SendReportedState in my sketch, the call and web request succeeds (the server receives the data), but seconds later the sketch freezes during one of the calls to delay(10). The WDT then resets the module after a few seconds (indicated in serial output). I can only assume this is caused by something screwy that the IOT SDK library did, but the freeze does not occur during the library calls; it occurs inside delay(). There is no serial output indicating root cause. How can I find the offending loop inside delay()?

Re: program freezes inside call to delay(1); WDT reset

PostPosted: Tue Jul 25, 2017 8:57 pm
by QuickFix
Two things I can think of:
  1. You're using delay in an interrupt
  2. Somewhere data gets out of reserved bounds (eg. you're receiving a page of 123 bytes, while only having reserved 122 bytes), resulting in unpredictable results like this
But without actual code one can only guess.