Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single yellow led on startup #6

Closed
StormPie opened this issue Mar 13, 2018 · 7 comments
Closed

Single yellow led on startup #6

StormPie opened this issue Mar 13, 2018 · 7 comments

Comments

@StormPie
Copy link

Hey,

First thing - thank you, I already really enjoyed ws2182fx and this implementation is awesome, so many cool features! I am working on creating a mobile friendly UI for it.

My question: when I power up the device, a single led will turn yellow for a second or so and then it fades into the boot preset, is this intended? If so, can it be changed?

I'm using a NodeMCU ESP8266 and 30 SK6812 Leds.

Thanks!

@Aircoookie
Copy link
Owner

Aircoookie commented Mar 13, 2018

Hi,

thank you so much for enjoying the project and even actively working on it!

Let me explain the LED:
It is in fact not intended behavior. The ESP8266 uses the UART bus to control the LEDs (thats why they need to be connected to gpio2). This is faster and more reliable than controlling them in software. However, on boot, the ESP's underlying OS (FreeRTOS, I believe) sends some random (debug?) data to that UART bus, which can cause some LEDs to turn on to random colors. On one of my lights running WLED, all lights turn white briefly, on another, just the first one turns green and on another, everything stays off. I don't believe that behavior can be changed.

One thing that's possible (which I consider) is turning the LEDs on earlier in the setup process, which currently works something like:

  • Load all user settings from memory (takes a very short time)
  • Connect Wifi and initialize interfaces (takes several seconds)
  • Turn on LEDs

If I'd start the LEDs before WiFi initialization however, effects and fading transitions could severely stutter while the ESP is busy starting stuff up. Nevertheless, I will try it out and if it works out, add it to the 0.6.0 release that will be available in a week or so.

Thank you for working on a mobile friendly UI! It would be really cool if you could share it once you've got stuff working nicely. Let me know if you have a question or if I could help with something else!

@StormPie
Copy link
Author

StormPie commented Mar 13, 2018

Okay yeah awesome, hopefully moving the LED setup earlier in the script could do the trick! If worst comes to worse, I could just add in a relay that blocks all signal to the lights until it's ready.

Once the mobile UI is all looking nice and working well I will be glad to share it 😄at the moment I am mainly focusing on making an easy to use controller for actively playing with the lights, there'd be a stack more to do in /settings, I may have to wait until I have more free time to look into making them mobile friendly!

Keep up the great work!

@Aircoookie
Copy link
Owner

Hey, version 0.6.0 with the improved boot LED behavior is released now. Hope it works nicely for you! Sounds great what you are working on 😄 Thank you, I'll stay tuned!

@StormPie StormPie reopened this Mar 18, 2018
@StormPie
Copy link
Author

Just wanted to reopen this as technically there is still this yellow LED on startup, I've been looking into things like esp8266/Arduino#3047 which seem to have a solution for the debug data.

@StormPie
Copy link
Author

I've looked through for a while and can't find a way to change the output pin, could you help me out with that? 😄

@Aircoookie
Copy link
Owner

Aircoookie commented Mar 18, 2018

On ESP8266, there are two (proper) ways to control the LEDs, UART and DMA. UART only works on GPIO2 and DMA only works on GPIO3 (at least with the NeoPixelBus library I use). Both however seem to cause the LED at startup/flash. See this: https://github.com/Makuna/NeoPixelBus/wiki/FAQ-%2310
You could try DMA however. I never did since UART worked fine for me (except the statup LED😄)
For that you just need to connect the LEDs to GPIO3 and in line 14 of WS2812FX.h replace the NeoEsp8266Uart800KbpsMethod with NeoEsp8266Dma800KbpsMethod. I'd suspect that doing so won't help but it's maybe something worth trying. Sorry that I can't change anything in the code which would prevent the startup behavior😅

@StormPie
Copy link
Author

I have managed to solve this problem by using a level shifter that has the ability to be turned on after the esp has booted which stops the junk data reaching the lights.

Aircoookie pushed a commit that referenced this issue Apr 8, 2020
huksley pushed a commit to huksley/WLED that referenced this issue May 25, 2020
softhack007 added a commit that referenced this issue Sep 8, 2023
this is a band-aid fix for random crashes when switching between presets with multiple segments - crossfade disabled.

!! adding type initializers fixed it for me on -S3, however I still see (less frequent) crashes on esp32, due to heap corruption.

It took me hours to get a meaningful stackdump:

assert failed: heap_caps_free heap_caps.c:360 (heap != NULL && "free() target pointer is outside heap areas")

Backtrace: 0x40084ee1:0x3ffb2570 0x4008e341:0x3ffb2590 0x40094709:0x3ffb25b0 0x4008534a:0x3ffb26e0 0x40094739:0x3ffb2700 0x400e9037:0x3ffb2720 0x400e917c:0x3ffb2740 0x400eaeeb:0x3ffb2760 0x40117ec5:0x3ffb27c0 0x401184ea:0x3ffb2800 0x4013509d:0x3ffb2820

  #0  0x40084ee1:0x3ffb2570 in panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c:402
  #1  0x4008e341:0x3ffb2590 in esp_system_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/esp_system.c:128
  #2  0x40094709:0x3ffb25b0 in __assert_func at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/newlib/assert.c:85
  #3  0x4008534a:0x3ffb26e0 in heap_caps_free at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/heap/heap_caps.c:360
      (inlined by) heap_caps_free at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/heap/heap_caps.c:345
  #4  0x40094739:0x3ffb2700 in free at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/newlib/heap.c:39
  #5  0x400e9037:0x3ffb2720 in Segment::deallocateData() at wled00/FX_fcn.cpp:189
  #6  0x400e917c:0x3ffb2740 in Segment::resetIfRequired() at wled00/FX_fcn.cpp:206
      (inlined by) Segment::resetIfRequired() at wled00/FX_fcn.cpp:203
  #7  0x400eaeeb:0x3ffb2760 in WS2812FX::service() at wled00/FX_fcn.cpp:1216 (discriminator 2)
  #8  0x40117ec5:0x3ffb27c0 in WLED::loop() at wled00/wled.cpp:115 (discriminator 3)
  #9  0x401184ea:0x3ffb2800 in loop() at C:/src/wled00/wled00.ino:20
  #10 0x4013509d:0x3ffb2820 in loopTask(void*) at C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:50

ELF file SHA256: 18c20b536f4c6ef4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants