connornishijima / Lixie-arduino

Edge-lit Nixie-like display for Arduino! (Library for 2016 Lixie display, *not Lixie II*)
GNU General Public License v3.0
94 stars 37 forks source link

Advanced feature tour crashes on nodemcu #16

Open efrainregalado opened 7 years ago

efrainregalado commented 7 years ago

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();

  1. 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

      stack>>> 3ffef450: 265dc0fa 00000078 00800000 0000000a
      3ffef460: 33538fae 7f800000 7fe58003 00000063
      3ffef470: 00000052 00000078 3ffee400 00000063
      3ffef480: 00000047 00000078 3ffee400 40203305
      3ffef490: 3fff0b7c 00000078 00000000 03030302
      3ffef4a0: 3b470504 3ffe032f 00000000 402034c8
      3ffef4b0: 00000047 00000078 3ffee400 402034c8
      3ffef4c0: 3fff0a14 00000078 00000078 03030302
      3ffef4d0: 3b470504 3ffe032f 00000000 3ffee4b8
      3ffef4e0: 000000ff 3ffee4c4 3ffee400 402035c4
      3ffef4f0: 402f3b47 0003897b 3ffee4f4 00000000
      3ffef500: 40203464 3fff0a14 00000078 00000001
      3ffef510: 00000000 3ffef550 3f800000 00000000
      3ffef520: 000000ff 00000014 00000014 3ffef593
      3ffef530: 3ffee3b8 3fff0b79 00000078 40202197
      3ffef540: 3ffee3b8 3fff0b79 00000078 40203014
      3ffef550: ffff00ff 0000ff00 3fff0b79 00000077
      3ffef560: 00000033 3ffef590 000000ff 3ffee5d4
      3ffef570: 3fffdad0 00000038 3ffee5b0 ffffffff
      3ffef580: 3ffee3b8 ffffffff 42646618 40201ca5
      3ffef590: ffffff00 0000ff00 000001b9 4010020c
      3ffef5a0: 00000000 00000000 3ffef5d0 4010068c
      3ffef5b0: feaad6ff 00000000 00000000 3ffee5d4
      3ffef5c0: 3fffdad0 00000000 3ffee5cd 40201eee
      3ffef5d0: 00000000 00000000 00000000 feefeffe
      3ffef5e0: 3fffdad0 00000000 3ffee5cd 40203d10
      3ffef5f0: feefeffe feefeffe 3ffee5e0 40100718
      <<<stack<<< ets Jan 8 2013,rst cause:2, boot mode:(3,7)

  2. 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

    stack>>> 3ffef550: 30303030 000000ff 000000ff 402024e3
    3ffef560: 40101568 0005f5c9 3ffee4e8 00000007
    3ffef570: 3ffee3b8 00000d91 000186a0 40202611
    3ffef580: 00000007 00000009 000001b9 4010020c
    3ffef590: 3fffdad0 00000000 3ffef5c0 3ffee5c8
    3ffef5a0: 000001f5 0000016e 3ffee3b8 40201ca7
    3ffef5b0: 3fffdad0 00000000 3ffee5c1 40201df7
    3ffef5c0: 00000000 00000000 00000000 feefeffe
    3ffef5d0: 3fffdad0 00000000 3ffee5c1 40203484
    3ffef5e0: feefeffe feefeffe 3ffee5d0 40100718
    <<<stack<<< ets Jan 8 2013,rst cause:2, boot mode:(3,6)

RomRider commented 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.

RomRider commented 7 years ago

See PR #20

efrainregalado commented 6 years ago

Hey Rom, i updated the library with the yield functions in those places, unfortunately it keeps crashing in the same spot with 10 lixies. Here's the fault:

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⸮⸮⸮/⸮⸮⸮----------------------------------

connornishijima commented 6 years ago

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.

iamchtan commented 6 months ago

Well, it's been 6 years and counting, and we're still waiting for an update