Skip to content

First and last LED show wrong color #583

Closed as not planned
Closed as not planned

Description

@xcruell

Hello,
i recently made a ceiling light with ws2811 leds, but theres one little problem..
The first and last LED show the wrong color, and not only the wrong one, they only show green and blue.
I made a video to demonstrate the issue. You can clearly see, that the first led turns blue, when blue is near the end of the strip. Its like it gets the color from the wrong spot, if that makes sense.

When i up the NUM_LEDS count by one, i can workaround the issue for the last led, because it would show up on the new non existing last one. But i cant do that with the first LED.

The code i used: https://pastebin.com/aSqQedi6
Video demonstration: https://youtu.be/PHB16HLMtdo
Im running the code on my arduino nano.
For some reason i cant run any FastLED sketch with more than ~73 leds on my esp8266/32s

I hope that someone can help me out :)

Activity

  1. focalintent commented on Mar 24, 2018

    @focalintent
    Contributor

    What version of the library are you using? There was an old off by one error in the ws2812 output code on avr - but that was a long time ago. Also is the nano you're using running at 5v or 3.3v? I have sometimes seen issues with WS2811's where some data gets lost, usually related to poor level shifting.

    As for the esp8266/32 - have you tried adjusting whether or not interrupts are allowed or the retry count - https://github.com/FastLED/FastLED/wiki/Interrupt-problems

  2. xcruell commented on Mar 24, 2018

    @xcruell
    Author

    Hey!
    Im using 3.1.6. My Nano is running at 5v.
    Maybe thats the issue with the esp8266, since the digital pins output 3.3v.

    I tried both, allow interrupts and retry count without success on the esp.

  3. peter-vasut commented on Oct 3, 2018

    @peter-vasut

    I can confirm that esp8266s pins output 3.3V. With my WS2812B, it sometimes worked fine, but sometimes LED strip couldn't figure where byte stream starts and all colors got shifted by one. Buying Logic level converter from 3.3V to 5V solved this particular issue for me. (I still have other problems with esp8266 and WS2812B.)

  4. xcruell commented on Oct 5, 2018

    @xcruell
    Author

    Im actually using a level shifter now.
    I had to because i got flickering problems with my 235 WS2811 and with 70+ of WS2812B.
    But the shifted start still remails. Isnt there a way to "sync" the first and last LED ?

  5. Blink515 commented on Oct 5, 2018

    @Blink515
  6. xcruell commented on Oct 5, 2018

    @xcruell
    Author

    Yes they can.
    I got them on white atm, no difference what so ever.
    The main problem really is the "shifted start point".
    The last LED is basically the first one showing the pattern.
    But the first LED is the first wired up to the esp.
    I dont have this problem with other libraries, only FastLED.

  7. focalintent commented on Oct 5, 2018

    @focalintent
    Contributor

    3.1.6 is fairly old at this point - you should grab the most recent version and see if that fixes the problem. Also your pastebin has expired so I can’t see what the code is that you have.

  8. xcruell commented on Oct 5, 2018

    @xcruell
    Author
  9. added
    type: bug
    area: core
    status: stale
    status: triage
    on Apr 16, 2026
  10. zackees commented on Aug 1, 2026

    @zackees
    Member

    Closing as not reproducible — this is a 2018 report against FastLED 3.1.6/3.2.1 with both reproduction links now dead (the pastebin expired while the thread was still active, and @focalintent said as much at the time). Current FastLED is many major versions past it, and there's nothing here that can be verified or fixed as written.

    Writing down what the thread established, since the symptom is common and this issue still turns up in searches.

    The symptom was a one-position frame shift, not a color-mapping bug. @xcruell described it precisely: "the last LED is basically the first one showing the pattern," and bumping NUM_LEDS by one moved the artifact off the end. That is the strip mis-framing the data stream — pixel data landing one position off — rather than FastLED computing wrong colors.

    Causes worth checking, roughly in order:

    1. Level shifting. WS2811/WS2812 want a data line near their supply voltage. A 3.3 V MCU driving a 5 V strip is marginal, and @peter-vasut confirmed in this very thread that a 3.3→5 V shifter fixed exactly this shifted-by-one symptom. @xcruell added one and it helped the flickering but not the shift, which points elsewhere — but it remains the first thing to rule out.

    2. Reset/latch gap. The strip re-frames on a long LOW. If that gap is too short — usually from something else on the bus, or an interrupt landing mid-frame — the strip never resynchronises and every pixel sits one slot off. On ESP8266/ESP32 specifically, see the Interrupt problems page @focalintent linked.

    3. WS2811 drives three LEDs per chip. If the physical strip groups LEDs in threes, the mapping between "LED index" and "physical LED" is not 1:1, and off-by-one reasoning gets confusing fast. Worth confirming which variant is in hand.

    4. First-pixel signal integrity. The first pixel sees the rawest edge on the whole bus. A ~200-330 Ω series resistor at the data pin and a short lead help; a long unterminated run into pixel 1 does not.

    @xcruell's "I don't have this problem with other libraries" is the one loose end nobody chased, and it's the detail that would have made this actionable. Different libraries use different reset gaps and edge timings, so a strip that is marginal on one can be stable on another — which is consistent with a signal-integrity or latch-timing problem rather than a FastLED logic error, but nobody proved it either way.

    If you still see this on a current FastLED, please open a fresh issue with the FastLED version, board, chipset, LED count, whether a level shifter is in use, and a sketch pasted inline rather than linked — links rot, as this thread demonstrates. That'll get a real diagnosis instead of a seven-year-old thread.

    Thanks @peter-vasut and @Blink515 for the diagnostics, and @focalintent for the original triage.

  11. moved this from Triage to Done in FastLED Trackeron Aug 1, 2026
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

    area: corestatus: stalestatus: triagetype: bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions