-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Wrong color on first pixel with ESP32 #159
Comments
Did you get your pixels together ? Some pixels are RGB some are GRB. |
Yeah. The 2 pixels are from the same "board". Also, whether I set the LEDs as A-B or B-A, which ever is 0, lights up green for (0, 0, 0). |
I can also confirm the issue for ESP32 - one green pixel. |
It works Ok to me, although it may not completely fix AMoo-Miki's original issue.
|
@lyusupov, your change does make the first pixel go off for (0, 0, 0), but the first pixel still gets the wrong colors. For example (171, 0, 85), which is pink, shows up as white. |
I encounter the same issue occasionally (rarely and not reproducible) using an esp8266 as well. Afterwards setting the color of individual pixel will overwrite the first green pixel just fine. |
I have replaced the library with https://github.com/Makuna/NeoPixelBus.git |
I liked the source code of this library. It is very robust and well done. |
I also got this issue with NodeMCU ESP-WROOM-32 and Adafruit 8x8 RGB matrix. this issue is also the same for my NodeMCU ESP8266 V1.0 (ESP-12E) @xVinny @tueddy your suggested library looks good, but I'm looking for one which can print ASCII strings, have you any recommendation for that? Thanks. Example for code with corruption: Loop: |
Might not be software/timing at all. I have first pixel go green but it's from noise on the DIN signal - I don't even need the ESP connected, can just touch the DIN with a finger and that's enough noise to make the first LED go green. So you may find it was programmed correctly but noise flips it to green quite quickly. I think this is why they recommend 470R series resistor on DIN (close to the neopixel end) and potentially 100k pulldown to GND (again at the neopixel end) to reduce signal noise. |
@tttonyyy, that might not be the case with me though since switching to another library (without any physical change, not even movement) made it work fine. |
I have found a good solution: in my code I call "show()" twice and the problem is solved 99,9% for me (without this solution the first led wrong color always). example: |
There is a "known timing problem" between Neopixel and ESP32. In my case, I have replaced the library with https://github.com/Makuna/NeoPixelBus.git |
I had the same problem with a NodeMCU-43S and a single pixel. I had the problem only when I tried to switch off the pixel with pixels.setPixelColor(0, pixels.Color(0,0,0)); all other values were working correctly. |
I am having the same problem with the builtin pixel on the Adafruit Feather M4 Express. |
The "fix" to duplicate pixel.show() works for me as well. |
I Have the same Problem. duplicate pixel.show() works only half. The Pixel gets green and ~100ms later goes off. Using some animations that means a constant green flashing first pixel. |
Mine seems to give problem when I use with pubsubclient.h. Double show() gets the colour to be correct but get a flash of bright Green occasionally first. |
How to solve this problem? what's the reason of first light flashing green? |
I am facing the same issue. Not sure how to solve it yet., and double call to pixel.show() during an animation didn't help much but to cause some flickering. |
I knew the reason: the first pulse is wrong. |
I've confirmed on the oscilloscope today and you're right. When I turn-on the WiFi on the ESP-WROOM-32, for some reason the first pulse go wrong and kind of mess with everything after it. I am not sure if we can use timed interruption to modulate pulses in ESP32, but it might be a good implementation if it actually works. Looks like the current implementation for ESP32 is using CycleCounter register like bellow: Any suggestions on how to better debug/fix this? |
Maybe we should focus on why only the first pulse has problem. |
I agree. Probably they are different issues as I am still getting first LED with green color after a few tries. On the image we can see a sequence of 16 LEDs signals sent to the first LED (1) and what the second LED get from the first (0). |
Ok so I figured I can skew the start bit, so that whatever is wrong with getCycleCount is done, then the first bit might send correctly. I delayed it half 1.5 periods while(((c = _getCycleCount()) - startTime) < period*1.5); // Wait for bit start (EXTRA WAIT) Seems to be working for now, this might also explain why calling delay(1) before show(); fixes other interrupt issues |
plesae try #253 |
Arduino board: HUZZAH32 (ESP32)
IDE version: platformio 3.5.2a7
I have 2 pixels (Breadboard-friendly RGB Smart NeoPixel) connected in series to the ESP32. No matter what I do, the first led (pixel 0) is green, and if I set a color to it, it shows up different.
I switched the LEDs physically and still pixel 0 is green. FastLED, however, doesn't have this problem and shows the colors correctly.
I have tried with the latest code from this library, as well as with 1.1.3 and 1.1.4 and have the same problem.
The text was updated successfully, but these errors were encountered: