Skip to content

WS2812B on ESP8266: LEDs 'leaking through' #309

Closed

Description

@bombarie

I know that the developments of FastLED on the ESP8266 are probably still experimental but here's something I ran into.

I'm using a Wemos D1 ESP8266 breakout in Arduino 1.6.8, using the version 2.2.0 ESP8266 board definitions. The data pin of the WS2812B strip is in port D2 of the Wemos D1 (which maps to GPIO4 on the ESP8266).

I have a 5v WS2812B strip of 30 leds but just to fool around with my program I had only 5 in use in my Arduino program. I noticed that the first 5 leds will eventually 'bleed through' to the next 5, and there it stops bleeding through, ie it won't hop on to the next 5. It appears to be clocked through verbatim, so led 6 will be the same as led 1, led 7 the same as led 2, etc.

Anything particular I could do to fix this? I've tried different ways of defining pin order (ie RAW_PIN_ORDER or D1_PIN_ORDER) and tried different pins on the ESP8266 too.

Incidentally I tried the NeoPixel library just to compare and it works on the ESP8266 and doesn't exhibit this bleeding through error. Surprised it works on the ESP8266. Anyway, just wanted to mention that to share all that I've done.

Activity

  1. focalintent commented on May 29, 2016

    @focalintent
    Contributor

    It might be a case of writing to the leds too quickly - so when writing a frame instead of leds[0] being read by the first led the data is still getting passed through the chain. It's also possible that the code I have for catching/working woth interrupts is rewriting frames too quickly. (The neopixel library fully blocks interrupts (which also means it doesn't bother with attempting to rewrite the frame if necessary because of an interrupt). I'm traveling right now and won't be able to really look at this until Tuesday.

  2. bombarie commented on May 29, 2016

    @bombarie
    Author
  3. focalintent commented on Jun 2, 2016

    @focalintent
    Contributor

    @bombarie try pulling master@head - I made a couple changes that might help with the bleeding that you're seeing.

    It's a side effect of work that I've done to allow interrupts - if I catch that an interrupt has run too long, then I need to re-write the entire frame, or at least attempt it. If I'm not pausing long enough before starting that re-write, however, the new frame will be interpreted by the WS2812's as starting from the end of the last frame. Oops :) I've tried adjusting the timing there a little bit. Also, you can disable the interrupt retry attempts by putting:

    #define FASTLED_INTERRUPT_RETRY_COUNT 0 
    

    before your #include <FastLED.h> line.

  4. focalintent commented on Jun 8, 2016

    @focalintent
    Contributor

    Ok, I've fixed the leaking through issue here. Running an overnight test (this is part of something else) and should have the fix for this, and general esp8266 + interrupt issues, checked in tomorrow morning.

  5. bombarie commented on Jun 10, 2016

    @bombarie
    Author

    Thanks for fixing this issue @focalintent and apologies for not having been able to test this yet, I haven't been around my ESP8266 this week. I'll test is anyway once I do and will report if anything odd turns up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions