Skip to content

ws2812_effects expects GRB led strip, so RGB led strip colors are off #2537

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

Closed
NorthernMan54 opened this issue Oct 31, 2018 · 13 comments
Closed
Labels

Comments

@NorthernMan54
Copy link

Make sure you read and understand http://nodemcu.readthedocs.io/en/dev/en/support/.
Use one of the two templates below and DELETE THE REST.

8<------------------------ BUG REPORT -----------------------------------------

Expected behavior

ws2812_effects like halloween, fire display correct color

Actual behavior

ws2812_effects halloween displays as blue and green

Test code

Provide a Minimal, Complete, and Verifiable example which will reproduce the problem.

-- add code here

I looked at the source and it appears to hard coded as GRB, rather than having an option to declare RGB or GRB.

int g1 = 50 * state->brightness / 255;

NodeMCU version

Which branch are you on? If you know the Git revision then add it here as well.

I presume master as of Sept 15, 2018

NodeMCU custom build by frightanic.com
branch: master
commit: c708828
SSL: false
modules: bit,color_utils,crypto,file,gpio,mdns,net,node,pwm,sjson,tmr,uart,websocket,wifi,ws2812,ws2812_effects
build created on 2018-10-15 23:42
powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9)

Hardware

Describe which ESP8266 device you use and document any special hardware setup
required to reproduce the problem.

Nodemcu connected to RGB LED Strip

https://github.com/NorthernMan54/homebridge-mculed/blob/master/nodemcu/README.md

8<------------------------ END BUG REPORT -------------------------------------

@HHHartmann
Copy link
Member

There are also other types of color coding like for the APA102 module it is ABGR. "A" being the Intensity Level.
Would be nice to be able to use the effects for all kind of LED strips.
Maybe also rename the Module then.

@marcelstoer
Copy link
Member

Maybe @skycoders is willing to pick this up.

@skycoders
Copy link
Contributor

@HHHartmann @NorthernMan54 can you tell me which stripes you use? I have thought about the APA102 stripes but that requires some more abstraction and refactoring. With respect to WS2812 stripes, I have not seen ones which use a different coloring scheme so far, so I'd be interested in knowing which one you are using. Providing a configurable color order for the WS2812 protocol should be rather easy to do.

@NorthernMan54
Copy link
Author

NorthernMan54 commented Oct 31, 2018 via email

@skycoders
Copy link
Contributor

ok, I have never seen stripes with that order but there are other reports for e.g. FastLED where people faced the same issue. I will see what I can do, time is a bit limited at the moment... keep you updated.

@NorthernMan54
Copy link
Author

NorthernMan54 commented Nov 2, 2018 via email

@HHHartmann
Copy link
Member

@NorthernMan54 May I ask how you worked around this issue? I'm facing the same problem now.

@konradhuebner
Copy link

@HHHartmann sorry I just don't find the time to generalize this. The easy way is to simply set the colors different. The API assumes that the pixel order processed by the strip is GRB, what most WS2812 strips do. If your strip requires RGB order, then simply swap the colors when handing them over to the effects API. It should then result in the correct colors being shown

@HHHartmann
Copy link
Member

Thanx for the reply. Your suggestions works where a color can be given, But not for the fire effect. But I looked at the code and found that the fire mode is the same as the flicker mode with preset parameters for color and flicker amount.

@NorthernMan54
Copy link
Author

NorthernMan54 commented Jul 16, 2019 via email

@stale
Copy link

stale bot commented Jul 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 11, 2020
@HHHartmann
Copy link
Member

Will be fixed by #3122 and #3158

@stale stale bot removed the stale label Jul 11, 2020
@NorthernMan54
Copy link
Author

Tks @HHHartmann

@stale stale bot removed the stale label Jul 11, 2020
@stale stale bot closed this as completed Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants