-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
74 LED WS2812B strip is flickering when connected to ESP8266 with Wi-Fi enabled #306
Comments
Try adding |
@msurguy the problem with that is it then blocks the handling of wifi responses in a timely fashion. @krzychb - what happens if you add Out of curiosity - where are you seeing flickering - is it at the beginning of the strip, the end of the strip, or across the entire strip? (Note: I just ran an installation using esp8266's with 150 led tm1809 (similar timing issues as ws2812) with wifi on with no problems - and i was using wifi as both a heartbeat sync and to broadcast OSC data to nearly a dozen esp8266's). |
Thanks, @focalintent! Sure enough, adding Thank you again for quick help 👍 Krzysztof |
Seems like same issue as i had. Just a heads up. Not allowing interrupts will result in watchdog resets. On my project, roughly 1 reset every 5-10 minutes. |
Ok - yeah, what's happening here is the interrupts firing are cutting off the writing out of the frame data. If you're hitting watchdog resets, grab the latest version of the code and try re-allowing interrupts - I did some timing adjustments on the retries (and upped the number of retry attempts). |
I just run about 100 min testing of Fire2012 on ESP8266 with simple web server enabled (to set up fire simulation parameters) using latest FastLED code from GitHub - 1b546b3 I am happy to confirm that I do not see any watchdog resets. |
@krzychb You might want to let it run over night to be on the safe side, i had wdt resets after about 12 to 36 hours with bitbanging and wifi but haven't tried the latest version yet. |
I will definitely give the latest changes a try when i find some time. However you have to take into consideration that there might be a difference between having a webserver idling and a project where there is constant traffic. In mine i send 8 byte packages to my esp 24-60 times a second. |
@TheAustrian @Lightning303 |
I just tested the latest github and it looks like the interupts are causing flickering for me. |
Ohh forgot to wrote im using WS2812B leds.. also without interupts it reset on me :( . |
As suggested by @TheAustrian I let the ESP8266 run over night and got the following result: Time to do some troubleshooting 😄 |
I run first round of testing of the three applications described in original issue report loading each of them on a separate ESP8266 module. Test started on 29-May-2015 at about 11:00 CET and took about 30 hours. Each application was posting it's The number or self resets over the test period is summarized below:
The cause of resets may be s/w, h/w or both. To eliminate h/w as the source of issue, I will move the s/w around using the same three modules in sequence below.
Later today I will stop Test 1 and move to Test 2. Any comments are welcome. Krzysztof |
Is that with interrupts enabled or disabled? |
Actually, I might have an idea of what's going on (if this is happening with interrupts enabled) - I think the resets might be getting caused by the clock count register rolling over - if it doesn't roll over at 32 bits, but instead at something lower, some of the math that I use for timing would result in really long spins. I can see about putting some extra guards in around that when I get home tomorrow. |
I have disabled interrupts to avoid strip flickering:
Thank you for review of his issue. |
I have moved the s/w around between modules after 22:00 (10:00 p.m.) CET yesterday as visible (reset of This indicated to me potential issue with s/w. Therefore I attempted to compare code of all three libraries looking for differences how low level control of WS2812B is implemented. Is my understanding correct that control of WS2812B by FastLED for ESP8266 is done using bit banging? Is there UART or DMA method implemented by FastLED for ESP8266? I will keep this test running for another 12 hours or so and then do third swap of modules. If anybody is interested, the charts are available on-line under https://emoncms.org/dashboard/view?id=29419. Any comments are welcome. |
It is done by bit banging - and I have no plans to support the dma/usart style unless I can get it to cover all the three wire chips FastLED supports - but I do know what's causing your resets and should hopefully have a fix today or tomorrow. |
Thanks, @focalintent. |
… and kicking off the watchdog timer on the esp8266 - see comments in #306
@krzychb grab the latest master@HEAD - this should get rid of your every 500 minute or so restarts :) |
@focalintent can't wait to test the changes once I am back home today afternoon. Update: |
I have loaded two ESP modules with latest commit 96704ee – ESP B used in previous testing, and a brand new ESP E. I have also reloaded EspNeoPixelBus application to ESP D - another brand new module. The testing started at 20:40 CET on 2-Jun-2016 and took about 2100 minutes. The summary of results is below.
The new module ESP E behaved suspiciously. It stopped posting data on Emoncms.org and I had to reset it manually two times. It used on average about 2kB more flash than ESP B loaded with identical application. I decided to remove it from testing. The good news is the EspFastLED_1 application on module ESP B run without any resets throughout the whole test. With previous version of FastLED librarry application restarted on average 3 times during such period. All modules are now restarted by cycling power and testing continues. Previously tested ESP A module is brought back to testing instead of suspicious ESP E. To be continued… 😄 |
To drive correctly a led strip in an ESP8266 board you need to use a hardware module. NeoPixelBus can use the I2S or UART1 modules. UART1 has a 128 bytes buffer, enough to store about 11 pixels. This gives enough time to the WiFi interrupt handler to keep the thing running. I2S uses Direct Memory Access so every pixel is written out asynchronously. I also contributed to NeoPixelBus an async mode for UART1, which uses interrupts to feed the UART1 asynchronously so the CPU can compute the next frame while the hardware module does its job. |
You don't need to - I have multiple projects that are using esp8266's with WS2812 style leds without using hardware - partly because, for me, parallel output is more important (and parallel output + shorter strips + interrupt's being enabled allows FastLED to work with this - I need to clean up the parallel output a bit more, then I should be able to publish that for everyone to use). |
I can reliably drive an 800 led strip with NeoPixelBus and output 30 frames per second. 2 parallel outputs is fine: you can put the ESP8266 in the middle of a led strip. But I see no point for more than 2 parallel outputs for two reasons:
PD: I just want to point you towards a solution. I don't want to start a flamewar. |
@coryking im unable to light up at all my 5 led WS2811 strip with your fork. if i just comment out maybe its because im not using a 3v3 <-> 5v level shifter? but should it matter on a strip so short? and yes, im using pin 3:
edit: compilers seems to imply RGBW controller even if i havent defined
maybe that's the culprit? |
I've only tested this /w the SK6812 RGBW strips and the strip below, which
claims to be a WS2812b:
https://www.amazon.com/gp/product/B00VQ0D2TY
Could be timing? I kinda doubt it is a level-shift issue....
…On Fri, Jan 5, 2018 at 5:16 AM, lance36 ***@***.***> wrote:
@coryking <https://github.com/coryking> im unable to light up at all my 5
led WS2811 strip with your fork.
i installed it right into Arduino IDE removing the official FastLED
if i just comment out //#define FASTLED_ESP8266_DMA it works just like
before
maybe its because im not using a 3v3 <-> 5v level shifter? but should it
matter on a strip so short?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#306 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAgHqoJ4XRnNDZBOw_BuBsKCOIErlp5aks5tHiCvgaJpZM4IgVDm>
.
|
Yeah same. tried it this morting on a 5m (98 IC) strip with a level shifter and had the same result. i got a "workbench" set-up with a 5 led strip attached if you wanna take a guess... |
stupid question -- are you using the right pin?
The DMA stuff can only use GPIO3, which on my boards is the "RX" pin. In
fact, it will completely ignore whatever pin you pass into FastLED...
…On Fri, Jan 5, 2018 at 2:32 PM, lance36 ***@***.***> wrote:
I kinda doubt it is a level-shift issue....
yeah same, what u mean timing? i seem to be unable to even light up my
strip on the blink example.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#306 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAgHqvxls1Z-aMa45fN6ec4HgYN-IuXSks5tHqLggaJpZM4IgVDm>
.
|
Turns out, i was using buttery-smooth. great work. |
Perfect. Glad to hear it!
…On Fri, Jan 5, 2018 at 4:20 PM, lance36 ***@***.***> wrote:
Turns out, i was using D3 and not RX afterall...
buttery-smooth. great work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#306 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAgHqnVRLxzK6yvqX055CCDHmsn05_wwks5tHrxmgaJpZM4IgVDm>
.
|
Hi guys - if someone is still visiting this thread...
do not forget to initialize The If you declare the function prototype Sorry wiseguys for this newbie talk :-) |
This is very interesting! I will have to try that out for sure. I had so much trouble to make all my different test LED strips display patterns correctly. I was thinking about off-loading the uC <-> LED strip communication to a simple Arduino but then again it adds to the hardware and requires two firmwares etc. etc. ... anyway, sounds great what you've written. :-) |
Hi @andgeno. Good to know someone is listening :-) |
@tonys0 Glad you kept messing with it and thank you for sharing what worked for you. Good stuff. |
Hi @marmilicious, "messing" is the right word for it. No documentation on ESP8266 circuit and firmware and no documentation on WS8212 real schematics and electrical specifications. And if exists, it does not make sense (except maybe for some Chinese of course). To this, I must add usual Murphys law (secretly broken jumpers, missing groundings, things suddenly starting/stopping to work just by connecting the osciloscope probe, the GND level shift with USB - serial device etc.) The most frustrating thing was, that when it sometimes worked with one sketch it did not with another. I could never rely on it. |
By the way - has someone here tested the ESPixelStick ??? |
I am going to just clear up a general comment made here. Esp8266 is able to sustain a solid signal for ws2812 (compatible) but you must use hardware features to do so; just like on the esp32 (and a lot of ARM chips as well). The issue for esp8266 is that there are only two hardware methods, i2s and uart, and each is tied to specific pins (there is no pin muxer); giving you a total of only three channels (i2s, uart0 an uart1) possible if you give up on serial support completely. NeoPixelBus supports all these as asynchronous sends. The number of LEDs is a memory and time constraint (the comm protocol takes time to send thus long strips will have lower update frequency). The FastLEds use of RMT hardware on esp32 allows it to split the update across multiple bus and increase the update frequency. And yes, having long lead wires between the uC and the first LED can be a problem, especially on a 3.3v uC when the LED expects a 5v signal. |
Hi Michael @Makuna. But I am really happy to have the opportunity to get in touch with you, great man. Can you suggest to me, how do I solve the conversion from Glediator protocol (USB serial) to the WS8212B with an ESP-01 ? Where do I find the document saying that the DMA is not on ESP-01 ? Can I use the TX1 for UART1 output (IO2) method while using RXD for serial input? What do you mean by "asynchronous UART" method opposed to "normal UART" method? Isn't UART asynchronous by definition? |
Can anyone reopen this "Closed" thread, since it is obviously visited and the issue is not solved ? |
For what it's worth I have done multiple installations with ESP8266's and ~150 WS2812 leds using wifi for communication/synchronization and no flickering issues (I almost always use level shifters, and power injection and such) -- including one that had ~32 esp8266's sharing a wifi network for synchronization/communication - and this is with using the stock FastLED software - so this isn't a constant issue - and I think it's an issue of wider hardware/software/wiring/power/etc... and beyond the scope of a FastLED issue to be fixed at just the library level. |
That said - where I see people run into major problems is where they are effectively using FastLED as a frame buffer, where they are pushing full frames of LED data over wireless or serial (or less frequently, ethernet) - and this is decidedly a mode of use that is not a priority for FastLED development - my focus and interest has almost always been for on-device generation of animation and LED data (in my own installations, I use wifi for sync and command and control - I'm not slinging full frames around). For situations where folks just want a frame buffer that's driven by computer, there are dedicated solutions that are designed just for that (pixel pusher, fade candy), and I will admit that it is not a style of use I've ever prioritized for FastLED. |
Hi Daniel @focalintent and welcome to the closed thread. |
Wrong, on so many accounts. Everything I build runs dynamically generated and responsive animations on MCU. If I'm using the wifi connection for anything, it's for synchronization/high level control across multiple devices. If what you want is to send frames from a computer for display on a cube or a matrix then FastLED is the wrong platform to be using. You should be using pixel pusher, fade candy, octows2811, or a setup similar what you've stumbled onto with gladiator. This is a use case that I have repeatedly made the conscious, explicit decision to not focus on supporting with FastLED.
And the reboot cycling is setup/code/environment specific (and there have been fixes added in the two years since this was opened that mitigated the ones that can be at the FastLED level) - my esp8266 projects only reboot when I hit the reset button (or flash new code to them). |
Hi, can you describe your situation in more detail? How do you feed the pixel-data to the ESP8266 or is the pixel-data generated from the ESP8266? Do you use WiFi or serial communication? Which method do you use for NeoPixelBus? How is the physical connection between the ESP8266 and WS8212 ? |
following on to what @focalintent stated I have focused NeoPixelBus to support updating even with WiFi, I have limitiation due to it, but it will work without crashing. I will link to my Wiki for esp8266 specifics and I will discontinue on the topic here. You can chat on the NeoPixelBus gitter channel if you have questions about it. |
Hi Daniel, I can respect your conscious, explicit decision not to prioritize "slinging full frames around". Just tell me, how do you create an animation with 32 devices, that (I suppose) display one complete picture, without sending at least parts of the frame around? I can see, that the power of FastLED is in creating animation in the device. But there must be a way to send the displayed objects between the devices...(?) Your personal preference not to sling full frames around should not prevent you from using the hardware in devices, that are offering DMA. Believe me, there are many people, who would appreciate having a solution like NeoPixelBus integrated into FastLED. Even if you like "banging" there are certainly other useful tasks for the CPU that can be performed, while the hardware takes care of sending the pixels to the strip uninterrupted. Why don't you join your forces and experiences with Michael instead of trying to convince each other about the advantages and limitations of each other's work? Isn't that what Github is for? Another thing. ESP8266 is a risc processor, isn't it. What I do not see is how are the principles of risc processor applied in the code. You still write |
So yeah - this is still happening - now I'm only on 46 LEDs and get resets even when all LEDs are off... Has there been any progress / consensus on solving this as yet? |
Release 3.3.3 - flickering with interrupts enabled, watchdog resets within minutes if interrupts disabled. |
I have been testing 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 😞
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
• EspAdafruit_NeoPixel
• 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
The text was updated successfully, but these errors were encountered: