sinricpro / esp8266-esp32-sdk

Library for https://sinric.pro - simple way to connect your device to Alexa, Google Home, SmartThings and cloud
https://sinric.pro
Other
236 stars 125 forks source link

ws2812b issue #234

Closed FortuneVisual closed 2 years ago

FortuneVisual commented 2 years ago

Hello, so I'm using a NodeMCU to run ws2812b leds, and for some reason the first led automatically is always purple. I turn the leds off and the first led still remains purple. The rest of the leds work perfect its just the first one. its as if the blue and red is always on no matter what. if anyone can help me make the first led work like the rest it would be great. Thank you. IMG_0331 IMG_0330 IMG_0329 IMG_0332

sivar2311 commented 2 years ago

The example is using gpio 3 (RX) - because that's the only gpio with DMA support on ESP8266. Do you use the example provided in this repository?

A "stuck" pixel might also be a hardware defect of your string (first pixel controller died)

FortuneVisual commented 2 years ago

I did use the example provided but GPIO 3 (RX) gave me the same results. Just to make sure I changed it back to GPIO 3 and tried it with a new strip and had the same result(first led is purple).

My guess is that it has to do with the fastLED library combined with SinricPro library, as I rewrote the code to work with the Adafruit Neopixel library and the problem with the first led was fixed. Now the only issue with the Neopixel library is that once I try to run all my LEDs (755 leds) the code glitches and keeps restarting. its not a power related issue as if I change "NUM_LEDS" to say 20 leds, the code works fine.

This glitch dosent happen using the FastLED library. When I put "NUM_LEDS" to "755" the code runs completely, but the first led still remains purple or some other color.

Also I tested the first pixel with a simple fastLED code to cycle rainbow colors with the NodeMCU. This would test if it was the NodeMCU fault or the pixel controller. And the code ran great.

So its not the controller nor the LED pixel controller. It only happens when I put both SinricPro.h and FastLED.h together that I get that problem(first LED being stuck).

sivar2311 commented 2 years ago

I think i remember there is an issue with the FastLED library and the latest arduino core. To track this down, can you try a sketch only using FastLED without using SinricPro? (Try one of the FastLED examples and check if the error is still there)

sivar2311 commented 2 years ago

I just took a quick look into FastLED's issues and found this one: https://github.com/FastLED/FastLED/issues/1322#issuecomment-980801182

It looks like that the issue is caused by the FastLED library.

FortuneVisual commented 2 years ago

I ran the colorPallet example code found in the FaslLED exaples and there was no problem

sivar2311 commented 2 years ago

Hm, the libraries should not intefere each other (except the sketch runs out of memory, but this should be visible in a different manner).

What version of the FastLED library do you use? The last time i tried, i had to downgrade FastLED to an older version to make it run on an ESP8266.

FortuneVisual commented 2 years ago

I used 3.4.0 for FastLED

sivar2311 commented 2 years ago

Please try some older versions and see if the issue still happens. I think to remember that i had to use the verison 3.2 or 3.18 to avoid this issue.

sivar2311 commented 2 years ago

Sidenote: The WS2812 example was created when version 3.1 of FastLED library was the latest one.

Did you notice the #define FASTLED_ALLOW_INTERRUPTS 0 mentioned in FastLED#1322 (see above)

I think you need to add this to your current sketch.

FortuneVisual commented 2 years ago

okay, so I tried almost all the versions of FastLed and I kept getting an error -

Error compiling for board NodeMCU 1.0 (ESP-12E Module).

so I updated it back to 3.4.0 and added the line -

define FASTLED_ALLOW_INTERRUPTS 0

and the first led is now white not purple but its still stuck

sivar2311 commented 2 years ago

It looks our example doesn't match the newer versions of FastLED and needs to be updated.

Error compiling for board NodeMCU 1.0 (ESP-12E Module).

This could be a relationship between the used arduino core version and the used FastLED version. Unfortunately, i cannot answer this because this belongs to the FastLED library.

so I updated it back to 3.4.0 and added the line -

define FASTLED_ALLOW_INTERRUPTS 0

and the first led is now white not purple but its still stuck

I would call this a step into the right direction, because something changed. The only question is, what is the right setup (#defines etc) to make this work again.

FortuneVisual commented 2 years ago

im going to keep working on it and doing more research if I find anything that helps ill post it. but thank you anyways I appreciate it.

sivar2311 commented 2 years ago

Thank you! Please let me know - I will update the example based on your result. :)

stale[bot] commented 2 years ago

This issue has gone quiet. Spooky quiet. We currently close issues after 14 days of inactivity. It’s been at least 7 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder, the best way to fix this or any other problem is to provide a detailed error description including a serial log. Thanks for being a part of the SinricPro community!

stale[bot] commented 2 years ago

Hey again! It’s been 14 days since anything happened on this issue, so our friendly robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else. As a friendly reminder, the best way to fix this or any other problem is to provide a detailed error description including a serial log. Thanks again for being a part of the SinricPro community!

daniel-11-pires commented 2 years ago

Hello, try to downgrade the board library esp8266 to 2.7.4, i had the same issue and it worked for me