Correct Library Versions for sk6812 lights?

I’m trying to add a light strip to my diyhue setup. (I have 2 old ones working fine).

For some reason I can’t get this one to consistently connect to my wifi. I’m wondering if I just am not using the correct combination of library versions. (I have tried many combinations, but haven’t gotten one to work yet.) What library versions should I use for sk6812 lights. I’m using a ESP-12E. ( https://www.amazon.com/gp/product/B01IK9GEQG/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 ) Right now I’m on:

*ESP Boards 2.7.4, Node MCU module ESP-12E


*ArduinoJson 6.17.3
*NeoPixelBus 2.6.2
*WiFiManager 2.0.3-alpha
*Arduino IDE 1.8.15

Depending on the libraries I’ve used and whether I set a static IP I get one of two problems:

  1. I set the wifi information while it is in access mode and reboot. It reverts back to access mode.
  2. I set the wifi info, restart, and it connects to my wifi. I’m able to control it from the hue app and get to the web interface for that one boot. (I think this has only worked if I specify a static IP from the sk6812 code by setting dhcp=false and putting in ip, gateway, and subnet mask.) When I unplug or reboot, and it can’t connect to wifi again. Or if I adjust a parameter like the number of lights, and it won’t connect to wifi again. I’ve noticed on the network setup page (when connected before a reboot), the ip address is often weird. Ex. I code to use 192.168.1.8, but it has an ip with random numbers for each octet. I was wondering if maybe it is storing the wrong IP when it restarts (even though I haven’t clicked save on that page), as the wrong IP is on the network setup page.
    (Also, the light flashes on the esp8266 about every second like it is constantly restarting.)

I thought I’d check if I’m using the correct libraries before further debug. As I said I have two old ones (about 2 years ago) that work fine. I’d use the old code, but here again, I don’t know what libraries I was using back then.

Figured it out. The problem was that I was using 12 lights for lightsCount, and I had
state lights[10];

I guess when colors and dimming were written to lights 11 and 12 it would overrun the array, and write into the IP settings. This is why I kept getting random ip addresses (and maybe other internet settings too). Every time I started changing lights 11 and 12 it started putting out errors and restarting over and over.

Changing state lights[10] to
state lights[12];
fixed it.

In the code, is there a way to dynamically set the lights array length based on lightCount / GUI setting?

1 Like