Joe_Schalk
Thu, 30 Nov 2017 14:25:09 +0000
FastLED Archive

I could not get the flicker to stop on a ESP8266 with arduinoOTA wifi enabled until I followed the advice of a github post. I tried the wait_time to 9-18, I tried the FASTLED_ALLOW_INTERRUPTS 0, I could not get the flicker to leave my pixels on a 150 foot string with 150 pixels. The flicker was random pixels too, all throughout the string, not just at the end. I noticed green more than anything else, and the flicker would be random changes in the brightness, and sometimes a color change. The patern was static, repeatedly calling the show function every second created different patterns though. So I took the advice of a fellow github member and implemented the spi function in the 8266 from another library.

If you search for dersimn, you will see a post discussing adding the neopixelbus library for the output only. Its about 15 lines of code that are understandable. In a nutshell, you take the led light array that is created by fastled library and copy that to the led light array that neopixelbus looks at, then instead of using the “FastLED.show();”, you use the Neopixelbus show command “strip.show();”. @dersimn has done all the hard work for us and here is his writeup below as well as a link to the original post:
--------------------------------------------------------------------------------------------------------------
@dersimn writes in part:

The NeoPixel library will work fine, with the small restriction that you won’t be able to use Serial input anymore, since GPIO3 is the same pin as RXD0.

I ended up replacing just the output procedure by the NeoPixel library, since the FastLED has some pretty cool and easy features for animation.
So starting from a working FastLED-based code, just alter the parts from something like this

void setup() {

// …

FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
}

void loop() {

// …

FastLED.show();
FastLED.delay(1000/FRAMES_PER_SECOND);
}

to

#include <NeoPixelBus.h>
NeoPixelBus<NeoGrbFeature, NeoEsp8266Dma800KbpsMethod> strip(NUM_LEDS);

// …

void setup() {

// …

strip.Begin();
strip.Show(); // Set to black (^= off) after reset
}

void loop() {

// …

static uint32_t fireTimer;
if (millis() > fireTimer + 1000 / FRAMES_PER_SECOND)
{
fireTimer = millis();

RgbColor pixel;
for (int i = 0; i < NUM_LEDS; i++)
{
  pixel = RgbColor(leds[i].r, leds[i].g, leds[i].b);
  strip.SetPixelColor(i, pixel);
}
strip.Show();

}
}

assuming you defined the leds array like this CRGB leds[NUM_LEDS];

github.com/FastLED/FastLED

74 LED WS2812B strip is flickering when connected to ESP8266 with Wi-Fi enabled

opened 02:22PM - 17 May 16 UTC

closed 06:23AM - 18 May 16 UTC

krzychb

I have been testing [Fire2012.ino](https://github.com/FastLED/FastLED/blob/maste…r/examples/Fire2012/Fire2012.ino) sketch with latest FastLED library (saved directly from GitHub) using WS2812B strip with 74 and 144 LEDs together with ESP8266. Fire2012.ino works as expected when Wi-Fi of ESP8266 is off. If Wi-Fi is on, the strip is flickering :disappointed: Has anybody tested ESP8266 in similar scenario? Do I miss something in configuration? ESP8266 is all about Wi-Fi and I would like to set Fire2012 parameters (brightness, cooling and sparking) wirelessly. I do not observe flickering for Fire2012.ino sketch when implemented with Adafruit_NeoPixel and NeoPixelBus libraries. Here are my test sketches: • [EspNeoPixelBus](https://github.com/krzychb/EspFire2012/tree/master/EspNeoPixelBus) • [EspAdafruit_NeoPixel](https://github.com/krzychb/EspFire2012/tree/master/EspAdafruit_NeoPixel) • [EspFastLED](https://github.com/krzychb/EspFire2012/tree/master/EspFastLED) I really appreciate mature, feature rich and well documented code of FastLED and looking how to use it directly with ESP8266 without patching it with additional code. Krzysztof

4 posts - 1 participant