Open efrainregalado opened 7 years ago
I was able to track down this problem of being a WDT reset because something is taking too long to execute, thus the need to use the yield() function.
So in the Lixie.cpp file, I did this in the progress function:
void Lixie::progress(float percent, CRGB col1, CRGB col2){
uint16_t index = NumLEDs-(int)(NumLEDs*(percent/100.0));
for(uint16_t i = 0; i < NumLEDs; i++){
if(i <= index){
leds[i] = col2;
}
else{
leds[i] = col1;
}
leds[i] = enforce_brightness(leds[i]);
yield(); // <--- Added
}
FastLED.show();
yield(); // <-- Added
}
Found the idea here : https://forum.arduino.cc/index.php?topic=449573.msg3092997#msg3092997
On mine, there is no problem with the rainbow function probably because I'm only using 4 digits. But I think you can apply the same method and it will work.
See PR #20
And here's millis() shown with lix.rainbow():
Soft WDT reset
ctx: cont sp: 3ffef2f0 end: 3ffef610 offset: 01b0
stack>>> 3ffef4a0: ffffffff 00000000 0000000a 3fffd848
3ffef4b0: acdb36e1 00000008 00000013 00000030
3ffef4c0: 0000000c 40203978 3ffee410 3fff0a24
3ffef4d0: 000000c8 000000c8 3ffee410 40203819
3ffef4e0: 3fff0c7c 000000c8 00000000 01000000
3ffef4f0: d6ff0101 000003aa 00000000 00000009
3ffef500: 000000c8 000000c8 3ffee410 402039dc
3ffef510: 3fff0a24 000000c8 000000c8 01000000
3ffef520: d6ff0101 3ffe03aa 00000000 3ffee3c8
3ffef530: 000000c7 40203978 3ffee410 402027b8
3ffef540: 00aad6ff ffff0000 3ffe0100 3ffee5a0
3ffef550: 00000000 00000000 00000000 00000000
3ffef560: 000000c2 00000000 0000003d 00000009
3ffef570: 00000255 30303030 ff050904 40202baf
3ffef580: 401019e4 01a07dc2 3ffee504 00000007
3ffef590: 3ffee3c8 00000004 00000000 40202d00
3ffef5a0: 00000007 00000009 00000167 4010020c
3ffef5b0: 3fffdad0 00000bb8 3ffef5e0 3ffee5e4
3ffef5c0: 000001f5 00000104 3ffee3c8 40201f0b
3ffef5d0: 3fffdad0 00000bb8 3ffee5dd 40202165
3ffef5e0: 00000000 00000000 00000000 feefeffe
3ffef5f0: 3fffdad0 00000000 3ffee5dd 4020424c
3ffef600: feefeffe feefeffe 3ffee5f0 40100718
<<<stack<<< ⸮⸮⸮PV⸮⸮ET⸮⸮⸮⸮T⸮⸮⸮⸮u⸮U+UZ⸮⸮UT⸮⸮⸮TQT⸮UQ⸮⸮jP⸮,⸮⸮⸮UP⸮⸮TZT⸮(E⸮⸮⸮⸮QUE⸮jQUE⸮V⸮R⸮⸮⸮/⸮⸮⸮----------------------------------
I just ran the exception through a ESP decoder tool, and got this:
0x40203978: ieee754_pow at ?? line ? 0x40203819: __ieee754_pow at ?? line ? 0x402039dc: ieee754_sqrt at ?? line ? 0x40203978: ieee754_pow at ?? line ? 0x402027b8: pow at ?? line ? 0x40202baf: __ieee754_pow at ?? line ? 0x401019e4: ppEnqueueRxq at ?? line ? 0x40202d00: ieee754_pow at ?? line ? 0x4010020c: _umm_free at C:\Users\USER\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266\umm_malloc/umm_malloc.c line 1287 0x40201f0b: String::reserve(unsigned int) at ?? line ? 0x40202165: loop_wrapper at C:\Users\USER\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/core_esp8266_main.cpp line 110 0x4020424c: copysign at ?? line ? 0x40100718: cont_norm at C:\Users\USER\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/cont.S line 109
I'm assembling another batch of 20-30 tonight, so I'll be able to tie 10 together and try some things out. I'll keep you updated! However, I don't have a NodeMCU for testing, more of a Wemos D1 Mini guy. Hopefully that shouldn't matter, they're both ESP-12 based controllers.
Well, it's been 6 years and counting, and we're still waiting for an update
Run vanilla script on 6 lixie and 10 lixie arrays with the same results on two different nodemcus: all but two functions work great... prog_bar() and rainbow_count();
prog_bar();
always crashes as the progress bar reaches the 4th digit:
⸮Your Lixies can also show a rudimentary progress bar... Soft WDT reset ctx: cont sp: 3ffef2a0 end: 3ffef600 offset: 01b0
rainbow_count() This one dies at a different time, but always crashes before finishing
And here's millis() shown with lix.rainbow(): Soft WDT reset ctx: cont sp: 3ffef3a0 end: 3ffef5f0 offset: 01b0