jasoncoon / esp8266-fastled-webserver

GNU General Public License v3.0
712 stars 358 forks source link

Random Flickering on Leds (using ws2811/UCS1903 12v Led Strip) #170

Closed ArshQazi closed 4 years ago

ArshQazi commented 4 years ago

Hello Everyone, There are random flicker/jitter on leds when there are effects running on it. Only Rainbow ,rainbow solid and Solid colors work nicely other than that all effects/animations have Random colour flickering. Components Used:-

1) Node MCU 2) 12V 10amp Power adapter 3) DC-DC buck converter

1) #define FASTLED_ALLOW_INTERRUPTS 0

Tried implementing this and removed #define FASTLED_INTERRUPT_RETRY_COUNT 0 So my Wifi connection is interrupted and shuts down.

2)also made changes like from

FastLED.delay(1000 / FRAMES_PER_SECOND)

to

delay(1000 / FRAMES_PER_SECOND)

do i need to add level shifter or what is the problem buck

sshcrack commented 4 years ago

I have the same problem

fweiss commented 4 years ago

I'm going to look into this again. I only have a 64 pixel panel with the 6 pin WS8212. What neopixel hardware has the problem been observed on?

jasoncoon commented 4 years ago

Yes, this might be caused by the lack of a level shifter. Regardless of how the NodeMCU is powered (3.3 or 5v) the GPIO pins are 3.3V. This is often just enough for addressable RGB LEDs, but it depends on the specific LEDs, length of the data wire, etc. Newer LED versions (WS2815) seem more tolerant of 3.3v signal than older ones (WS2811). If you try a level shifter, make sure you use a high speed one, such as a 74HCT125 or 74HCT245. See this great article for more details: https://happyinmotion.com/?p=1247

ArshQazi commented 4 years ago

I have tried putting 1000UF and 74HCT245....Still it is flickering.

Solid colors are working fine but when there is animations, it starts flickering and when i put #define FASTLED_ALLOW_INTERRUPTS 0 ...

then effects work perfectly but then i am not able to access the webpage

jasoncoon commented 4 years ago

Ah, then it does seem software related. Have you made any other changes to the code? Tried changing the CPU Frequency from 80 to 160 MHz? Tried FASTLED_INTERRUPT_RETRY_COUNT 1?

ArshQazi commented 4 years ago

FASTLED_INTERRUPT_RETRY_COUNT 1 .... tried this but no luck

CPU Frequency from 80 to 160 MHz? <----- where to change this?

I have not made any other changes ..just wanted to check my leds... (Pixel leds ws2811 works but the ws2811 strip does not work)

and I have UCS1903 strips as well ...same problem ...flickering

jasoncoon commented 4 years ago

Arduino->Tools->CPU Frequency

image

Pixel leds ws2811 works so maybe it's not just a software problem? Can you post pictures and/or a schematic of your setup with the level shifter?

ArshQazi commented 4 years ago

Level shifter Daigram

Okay the level shifter i have shown ...i tried with 74HCT245...but same problem and my leds are ws2811/ucs1903 12v

jasoncoon commented 4 years ago

Any change at 160 MHz?

You said everything works fine (except wifi) with FASTLED_ALLOW_INTERRUPTS 0, so I assume other, non wifi FastLED examples also work fine?

ArshQazi commented 4 years ago

will try with 160 MHz ......will answer you in 2 hrs ...as i am travelling

example:- if i use

define FASTLED_INTERRUPT_RETRY_COUNT 0 :- 0/1 --> all solid colors and solid rainbow works ...other than that nothing works properly (random flicker)

when i use this #define FASTLED_ALLOW_INTERRUPTS 0 --> cannot access any effect because webpage is not loading (wifi disconnects) and the last effect that i left open works well like Pride or anyother animation.

when i use #define FASTLED_ALLOW_INTERRUPTS 1 ----> code will not upload on nodemce ....some error in arduino .

tried with both node mce lolin and amica as well as D1 Mini

ArshQazi commented 4 years ago

and yes i tried ...MClighting and ws2812fx ....both work well without the shifter(all the effects work smoothly...but i am new to this and dont know how to use other libraries..)....but i really like what you have made... <3

jasoncoon commented 4 years ago

Ah, interesting. I wonder if those libraries don't use interrupts like FastLED does? Have you tried WLED? I've heard good things: https://github.com/Aircoookie/WLED

jasoncoon commented 4 years ago

Also, are you using the latest version of the FastLED library (3.3.3)?

ArshQazi commented 4 years ago

was using latest fastled then tried lower versions as well but the same flickering ....

WLed uses fastled or Adafruit library? and can we edit it the way you have done?.

your code is very simple to understand and to operate. for example i just wanted to use the AP mode and didnt wanted it to connect to wifi ...it was very easy to do it .... but other libraries and their codes are bad ...

ArshQazi commented 4 years ago

Hello Jasoncoon ....so i am making project on the ws2811 pixel leds only now ....as strips are not working with 160 MHz as well...dont know what is the problem ...just wanted to thank you for creating such a nice thing :)

jasoncoon commented 4 years ago

Thank you! Sorry if you're still having issues. I have this code running on dozens of Wemos D1 Minis without any problems. I'm closing this issue, but feel free to reopen if needed.