Skip to content
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

WS2811 RGB LED Stripe mixed up colors #1690

Closed
roesl opened this issue Jan 24, 2018 · 26 comments
Closed

WS2811 RGB LED Stripe mixed up colors #1690

roesl opened this issue Jan 24, 2018 · 26 comments
Labels
enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended

Comments

@roesl
Copy link

roesl commented Jan 24, 2018

Hallo,

i tried to connect a WS2811 LED stripe 12 V and used WS2812 in Tasmota - but the stripes seems to be RBG instead of RGB with B and G mixed up
Is it possible to add configuration for WS2811 stripes

Regards
Georg

@reloxx13
Copy link
Contributor

just solder it right.

@roesl
Copy link
Author

roesl commented Jan 24, 2018

ist a 12 V led stripe with controller WS2811 soldered at the stripe so I cant change the colours
see www.ebay.de/itm/112235821460

@legionGer
Copy link

I think you can just cut the plug off and resolder it.

@roesl
Copy link
Author

roesl commented Jan 27, 2018

Ist a LED stripe - so its necessary to change the RGB org GRB within the Software to RBG but there ist only the Option GRB or RGB but not RBG in the config file for the 2812 ( 2811)

@lobradov
Copy link

lobradov commented Jan 27, 2018 via email

@roesl
Copy link
Author

roesl commented Jan 27, 2018

i dont have to ggogle - when i swith R then R is on when i Switch G then B and when B then G - so its necessary to change firmware

@lobradov
Copy link

lobradov commented Jan 27, 2018 via email

@eogmau
Copy link

eogmau commented Jan 28, 2018

I have WS2811 12v led strip working with latest tasmota on wemos d1. I had to change in xplg_ws2812.ino at line 39 & 312 from NeoRgbFeature to NeoBrgFeature because the color order on those leds is BRG.
I added this led configuration to homeassistant with below config:

  • platform: mqtt
    name: Office Leds
    state_topic: "stat/OfficeLed/POWER"
    command_topic: "cmnd/OfficeLed/POWER"
    rgb_state_topic: "stat/OfficeLed/RESULT"
    rgb_value_template: "{{ value_json.Color }}"
    rgb_command_topic: "cmnd/OfficeLed/COLOR"
    brightness_state_topic: "stat/OfficeLed/RESULT"
    brightness_command_topic: "cmnd/OfficeLed/DIMMER"
    brightness_scale: 100
    brightness_value_template: "{{ value_json.Dimmer }}"
    qos: 0
    optimistic: false
    retain: true
    effect_state_topic: "stat/OfficeLed/SCHEME"
    effect_command_topic: "cmnd/OfficeLed/SCHEME"
    effect_value_template: "{{ value_json.scheme }}"
    effect_list:
    - 0
    - 1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    - 10
    - 11
    - 12
    payload_on: "ON"
    payload_off: "OFF"

@roesl
Copy link
Author

roesl commented Jan 28, 2018

I found in user_config.h following line
#define USE_WS2812_CTYPE 1 // WS2812 Color type (0 - RGB, 1 - GRB, 2 - RGBW, 3 - GRBW)
Maybe i only have to change "1" to "0" to Switch between RBG and GRB ?
But how can I choose "RBG" ? - there is no CTYPE for RBG
Maybe its possible to add NeoRbgFeature to Neopixelbus library ( NeoColourFeatures.h) to change easily the RBG Definitions for all types of stripes ?

@eogmau
Copy link

eogmau commented Jan 28, 2018

Don't change anything apart in user_config.h, leave it to 1 as the modification I have done on xplg_ws2812.ino will use the #define USE_WS2812_CTYPE 1

@ItownTech
Copy link

I met the same problem.

@arendst
Copy link
Owner

arendst commented Mar 17, 2018

Will provide selection for BRG in next pre-release.

Be aware that selections in user_config.h will change from numbers to NEO_RGB, NEO_GRB, NEO_BRG, NEO_RGBW, NEO_GRBW.

@arendst arendst added the enhancement Type - Enhancement that will be worked on label Mar 17, 2018
arendst added a commit that referenced this issue Mar 17, 2018
5.12.0f
 * Add support for WS2812 BRG led configuration to be defined as
NEO_BRG in user_config.h (#1690)
arendst added a commit that referenced this issue Mar 17, 2018
5.12.0f
 * Add compile time support for WS2812 BRG and RBG led
configurations to be defined in user_config.h (#1690)
@arendst arendst added the fixed Result - The work on the issue has ended label Mar 17, 2018
@eogmau eogmau mentioned this issue Jun 5, 2018
@skatun
Copy link

skatun commented Jul 25, 2018

Maybe we can make WS2811 a valid selection type in the config page?
WS2812(RGB800kHz)
WS2811(RGB400kHz)
WS2811(BRG400KHz)
......... and so on, just an idea

Just a final question, if we map a button to one of the GPIO, can this then control the ledstrip(ON,OFF) if the MQTT goes down, i.e manual overide. It would be a nice a feature.

@skatun
Copy link

skatun commented Jul 31, 2018

I just got a few WS2811 led strip of ebay now, and all these are also RBG, so maybe this is the standard way for ws2811? @arendst should we add WS2811 as valid sensor type in the configurator, where the only differnese is what is written in the user config?

curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
5.12.0f
 * Add support for WS2812 BRG led configuration to be defined as
NEO_BRG in user_config.h (arendst#1690)
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
5.12.0f
 * Add compile time support for WS2812 BRG and RBG led
configurations to be defined in user_config.h (arendst#1690)
@codefaux
Copy link

So, trying to pull off a last-second overnight Christmas "decorate the everything with surprise LEDs nobody could know I had until tonight" but apparently the witless folks who made my sets of WS2811 strips used GRB order. Just an FYI that it's out there. Single use-case, I know.

@KDMcMullan
Copy link
Contributor

I've been working with the 24 LED WS2812-24 ring and it works fine. I just swapped it out for a 50x LED WS2811 set and they appear to have Blue as OK, but Red and Green swapped.

I did a trawl and noticed that the WS2812B protocol specifies the transmission order GRB (MSB first) whereas the WS2811 expects RGB (MSB first). As such, I would expect that a WS2811 receiver receiving signals from a 2812 software driver would have Red and Green swapped, which is what I observed.

I haven't found a software explanation for the OP's problem (G and B swapped).

How do I swap R and G? Must I modify the firmware?

@ascillato
Copy link
Contributor

ascillato commented Jan 29, 2020

How do I swap R and G? Must I modify the firmware?

No, you need to change in the my_user_config.h file the order of colors for WS2812 and recompile. If you need help on that, please, address this to the Tasmota Support Chat. Thanks.

@KDMcMullan
Copy link
Contributor

TASMOTA support chat isn't going to be able to help me change my_user_config.h without modifying the firmware! I understand what I have to do. Thank you.

@ascillato
Copy link
Contributor

TASMOTA support chat isn't going to be able to help me change my_user_config.h without modifying the firmware

Sorry, I don't understand what you meant. There is no need to modify the firmware. Color order is already an option in the config file.

@KDMcMullan
Copy link
Contributor

Modifying the config file causes a change to the resultant binary. To the software engineer, this constitutes a firmware modification. Its not worth falling out over: I've got my answer and I'm happy. Thanks again.

@madtitan77
Copy link

@KDMcMullan Does it finally work by just
#define USE_WS2812 // Add Shutter support (+6k code)
#define USE_WS2812_HARDWARE NEO_HW_WS2812 // Hardware type (NEO_HW_WS2812, NEO_HW_WS2812X, NEO_HW_WS2813, NEO_HW_SK6812, NEO_HW_LC8812, NEO_HW_APA106)
#define USE_WS2812_CTYPE NEO_RGB

in user config?

@ReaLogics
Copy link

ReaLogics commented Mar 20, 2020

Hi @arendst

Just curious, couldn't the NeoPixel color sequence (RGB, BGR... etc) instead be configurable in the WiFi interface Generic -> Configure Module -> RGB or BGR... etc... Rather than compiling a fixed sequence in binary for ws2812? Or it could be done with a Console Command to change the color sequence parameter. Maybe this would be a lot of trouble coding wise... don't know.

I have designed a few addressable LED WiFi boards for lighting counter tops. These boards use LED's from China like APA106, WS2811, WS2812d-F8, and others. These can use different RGB sequences than the standard WS2812. As a result, the color sequence needs to be compiled into the binary for these LEDs. OverTheAir updating from Tasmota website then overwrites the compile changes. But, if the changes were done through Console Command or Configuration Module, then update directly from Tasmota would be fine, since config data is not overwritten. Obviously if the color sequence was done by console command, then only one type of addressable LED could be used for that "Generic" module board. If it were done with Generic Module by pin, then difference multiple RGB color types could be used on the same Generic Module board.

@s-hadinger
Copy link
Collaborator

Isn't SetOption37 solving this now? I don't have those kind of leds so I can't test.

@senfkorn
Copy link

I can confirm, Setoption37 does the job

@ReaLogics
Copy link

ReaLogics commented Apr 21, 2020

Sorry for late responds. Before knowing about the SetOption37, I had custom compile Tasmota binary to correct RBG order for my LEDs. After loading unmodified Tasmota.bin, using "SetOption37 25" on my custom WS2812D-F8 BRG LED Ring does the job. Amazing and awesome software @arendst, thank you for making this available open source.

@xzaz
Copy link

xzaz commented Apr 25, 2020

To be clear: SetOption37 7 works for me in combination with WS2811.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended
Projects
None yet
Development

No branches or pull requests