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

Help with "Enhancement" #5

Closed
DaveDischord opened this issue Feb 23, 2018 · 2 comments
Closed

Help with "Enhancement" #5

DaveDischord opened this issue Feb 23, 2018 · 2 comments

Comments

@DaveDischord
Copy link

I would like to add a Status Indicator LED that works with certain states. Something simple, such as:
LED Blinking when either not connected to the defined WiFi or Unconnected in AP-mode.
LED Solid when connected to defined Wifi or there's a connection to the AP AND RGB(W) lights are on.
LED OFF when RGB(W) lights are off.

I'm sifting through the code, and have gotten some additions in place, but I'm sure there's either an easier way, or I'm missing a few things, such as, where can I find a flag that something is connected to the AP, and also, a flag that the RGB(W) lights are on/off, so that this 'Status Indicator' can toggle with both hardware button and the web interface power button?

@Aircoookie
Copy link
Owner

Aircoookie commented Feb 23, 2018

That's a nice addition! Might add something similar officially, although it's not a top priority now.

Getting the state of the RGB lights is simple. There is a global byte variable called bri. It contains the master brightness (which you set with the yellow slider). If the RGB leds are off, its value is 0.

Finding out the connection to the defined wifi is not too hard either. If this: (WiFi.status() == WL_CONNECTED) is true, you are connected, otherwise not.

Finally, to see if someone is connected to the AP, you could try and use the method wifi_softap_get_station_num(), it should return the number of clients connected to the ESPs AP, however I never used or tested whether it actually works.

Hope it's easy to implement the features you like and let me know if I can do anything else to help :)

@Aircoookie
Copy link
Owner

Closing since not an issue with WLED and no further discussion required for now. Reopen if necessary :)

Aircoookie pushed a commit that referenced this issue Apr 8, 2020
Add staircase wipe usermod
huksley referenced this issue in huksley/WLED May 25, 2020
Update html_ui.h to reflect changes in index.htm
huksley referenced this issue in huksley/WLED May 25, 2020
Merge formatting changes
N1nja98 referenced this issue in N1nja98/WLED Nov 27, 2020
blazoncek pushed a commit that referenced this issue Jul 18, 2023
arneboe pushed a commit to arneboe/WLED_ORIG that referenced this issue Aug 14, 2023
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