Welcome! Log In Create A New Profile

Advanced

Neopixel RGBW issue

Posted by Lowtus7 
Neopixel RGBW issue
July 20, 2022 11:23PM
Hello, Im hoping someone can help me with my issue.
I am trying to get my Neopixels set up, However, I am having an issue.

(Bigtreetech Skr pro board)

I have purchased a string of (SK6812) RGBW Neopixels. But I cant seem to get the White element going.

I have had success in getting the RGB elements working correctly, However I cant seem to get the While pixels to go.


What Im trying to achieve:

Get control of all colours, including White (using M150 commands)


What I have achieved:

Control of RGB colours (using M150 commands)(When 'HAS_WHITE_LED' is not selected)

I can get the RGB (NEO_GBR) colours to work perfectly (when 'HAS_WHITE_LED' is not selected), they cycle correctly when the board is powered up (self test), and I have full control using the gcode M150 commands.

However, when I try to specify that the strip has a white led (in neopixel.h) it will compile fine, but when the board is repowered, I get a rainbow effect on the strip. After that, using the M150 commands seem to just change the rainbow effect slightly (not going to a solid colour) and if I issue it the command to turn White, most of the leds turn off, and only a few stay lit at the end of the strip.

I have tried every combination I can think of, but just cant get it to work.

Some things I have tried.

#define NEOPIXEL_TYPE NEO_GRB (in configuration.h)
Along with changing..
#define _NEO_IS_GRB (neopixels.h)
#if _NEO_IS_GRB(NEOPIXEL_TYPE)
#define HAS_WHITE_LED 1

This is when I get the rainbow effect, and no control of White.

Also:


#define NEOPIXEL_TYPE NEO_GRBW
#define _NEO_IS_GRBW(NEOPIXEL_TYPE)
#define HAS_WHITE_LED 1

This 'greys' out the 'HAS_WHITE_LED' definition.


Also:

#define NEOPIXEL_TYPE NEO_GRBW
#define _NEO_IS_GRBW
#if _NEO_IS_GRBW(NEOPIXEL_TYPE)
//#define HAS_WHITE_LED 1

This has the strip work fine with the RGB colours, but obviously not White. (changing to just NEO_GRB in this scenario does the same, control over the RGB colours, but no white).

Does anyone have any suggestions to what I am doing wrong?
Could it just be a setting I have missed?
Compatibility of the SK6812 chip? (setting needs changing for this chip?)

(I have looked at the LEDs under the microscope, and the white element is definitely present)

Any suggestions would be greatly appreciated.

If you need any further info...

Kind regards

Tim
Re: Neopixel RGBW issue
July 21, 2022 12:45AM
You don't play with HAS_WHITE_LED,this is set in code as needed.


"I can get the RGB (NEO_GBR) colours to work perfectly (when 'HAS_WHITE_LED' is not selected), they cycle correctly when the board is powered up (self test), and I have full control using the gcode M150 commands."

this should not work.

You have told it you have G B and R leds, it doesn't know about the 4th led

Ie you have                   GBRWGBRWGBRWGBRWGBRWGBRWGBRWGBRWGBRW
you have told it you have     GBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBR

So when you turn on G  
you get the following         G  W  R  B  G  W  R  B  G  W  R  B


If your getting all G, this mean you do not have the 4th led.

Edited 2 time(s). Last edit at 07/21/2022 01:23AM by Dust.
Re: Neopixel RGBW issue
July 21, 2022 01:18AM
I just tried my SK6812 (NEO_GRBW) on a ramps with current marlin bugfix 2.1.x and it works as expected

#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
  #define NEOPIXEL_TYPE          NEO_GRBW // NEO_GRBW, NEO_RGBW, NEO_GRB, NEO_RBG, etc.
                                          // See [github.com]
  #define NEOPIXEL_PIN                4 // LED driving pin
  #define NEOPIXEL_PIXELS              8 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.)
  #define NEOPIXEL_IS_SEQUENTIAL          // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
  #define NEOPIXEL_BRIGHTNESS         15 // Initial brightness (0-255)
  #define NEOPIXEL_STARTUP_TEST         // Cycle through colors at startup

Brightness is way down so you can look at them without hurting your eyes!!

Im using these modules from aliexpress [www.aliexpress.com]

Edited 2 time(s). Last edit at 07/21/2022 01:25AM by Dust.
Re: Neopixel RGBW issue
July 21, 2022 02:01AM
Thanks for your help. But still no luck. Here are my settings as of now...

From Config.h

// Support for Adafruit NeoPixel LED driver
#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN PC4 // LED driving pin
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
//#define NEOPIXEL2_PIN 5
#define NEOPIXEL_PIXELS 60 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.)
//#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 255 // Initial brightness (0-255)
#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup

From Neopixel.h:

// Defines
// ------------------------

#define _NEO_IS_GRB(N) (N == NEO_RGB || N == NEO_RBG || N == NEO_GRB || N == NEO_GBR || N == NEO_BRG || N == NEO_BGR)

#if _NEO_IS_GRB(NEOPIXEL_TYPE)
#define HAS_WHITE_LED 1 (Grayed out)
#endif

#if HAS_WHITE_LED
#define NEO_WHITE 0, 0, 0, 255 (Grayed out)
#else
#define NEO_WHITE 254, 254, 254
#endif

I have tried changing the neopixel type in neopixel.h from GRB to GRBW, but that does not seem to work either, do any of the settings look wrong to you? Should 'HAS_WHITE_LED' stop being grayed out if the settings are correct?

I am running the strip off 3.3V because I read you can have problems on 5V due to the 3.3 volt logic from the Skr board. Should I try 5v instead?
Or maybe its because I'm running fw ver 2.0.9.2?

Thanks again for your help.
Re: Neopixel RGBW issue
July 21, 2022 02:34AM
The STM32Fxxx MCUs have 5V tolerant I/O. Go ahead and run your strip at 5V.
Re: Neopixel RGBW issue
July 21, 2022 02:51AM
Thanks for your input. Just tried it on 5v, easy swap as the strip is powered from a ATX supply, so just a pin swap. Strip still functions as it was, so no worse! But I still only have control of the RGB elements, not the white.
Re: Neopixel RGBW issue
July 21, 2022 03:20AM
in neopixel.h


#define _NEO_IS_RGB(N) (N == NEO_RGB || N == NEO_RBG || N == NEO_GRB || N == NEO_GBR || N == NEO_BRG || N == NEO_BGR)

#if !_NEO_IS_RGB(NEOPIXEL_TYPE)
  #define HAS_WHITE_LED 1
#endif

no ! in what you posted

for me

#if HAS_WHITE_LED
  #define NEO_WHITE 0, 0, 0, 255     <   this line is enabled
#else
  #define NEO_WHITE 255, 255, 255     < this line is greyed out
#endif

Edited 2 time(s). Last edit at 07/21/2022 03:27AM by Dust.
Re: Neopixel RGBW issue
July 21, 2022 04:03AM
This is what I have...


I have included the 'Includes', are they correct?, I notice it mentioned including 'leds.h' not 'neopixel.h'. But mine seems to show 'Adafruit_neopixel.h'?



#ifndef _NEOPIXEL_INCLUDE_
#error "Always include 'leds.h' and not 'neopixel.h' directly."
#endif

// ------------------------
// Includes
// ------------------------

#include "../../inc/MarlinConfig.h"

#include
#include

// ------------------------
// Defines
// ------------------------

#define _NEO_IS_RGB(N) (N == NEO_RGB || N == NEO_RBG || N == NEO_GRB || N == NEO_GBR || N == NEO_BRG || N == NEO_BGR)

#if _NEO_IS_RGB(NEOPIXEL_TYPE)
#define HAS_WHITE_LED 1 < this line is greyed out
#endif

#if HAS_WHITE_LED
#define NEO_WHITE 0, 0, 0, 255 < this line is greyed out
#else
#define NEO_WHITE 254, 254, 254 < this line is enabled
#endif

Strange!
Re: Neopixel RGBW issue
July 21, 2022 04:10AM
Sorry, I seemed to miss some of the text when I copied the includes, this is how it reads


#ifndef _NEOPIXEL_INCLUDE_
#error "Always include 'leds.h' and not 'neopixel.h' directly." < (This line is greyed out)
#endif

// ------------------------
// Includes
// ------------------------

#include "../../inc/MarlinConfig.h"

#include
#include
Re: Neopixel RGBW issue
July 21, 2022 04:15AM
Thats strange. When I post the 'Includes' portion, it looks fine before I post it, then it seems to remove some of the txt when I post it.

I will just write it out:

The 'Includes':


"../../inc/MarlinConfig.h"

Re: Neopixel RGBW issue
July 21, 2022 04:19AM
It did it again. You must not be able to post anything inside the triangle brackets...

'Includes' without the triangle brackets...

"../../inc/MarlinConfig.h"

Adafruit_NeoPixel.h

stdint.h
Re: Neopixel RGBW issue
July 21, 2022 07:37AM
Can you provide us a link to the neopixel unit you are using? Maybe there's something unusual about it.

Since you've never seen white on I'm thinking that you actually have an RGB string, not a WRGB string.

This is reinforced by the statement
Quote
I can get the RGB (NEO_GBR) colours to work perfectly (when 'HAS_WHITE_LED' is not selected), they cycle correctly when the board is powered up (self test), and I have full control using the gcode M150 commands.

I'm assuming that means you get the expected RGB colors and only RGB colors. If this were a WRGB string then there would be white mixed in.

The LED string is just a bunch of 8 bit shift registers tied in series. Each 8 bit shift register is tied to an individual LED. The colors just keep repeating in the same sequence.

The data stream doesn't actually specify if a particular byte is a particular color, it just specifies the intensity of the LEDs.

If Marlin sends out the sequence 0,0,255,0,0,255,0,0,255,0,0,255 then you'd get the following:
sent |      RGB string      |        WGRB string 
   0 | Red   intensity:   0 | White intensity:   0 
   0 | Blue  intensity:   0 | Red   intensity:   0 
 255 | Green intensity: 255 | Blue  intensity: 255 
   0 | Red   intensity:   0 | Green intensity:   0 
   0 | Blue  intensity:   0 | White intensity:   0 
 255 | Green intensity: 255 | Red   intensity: 255 
   0 | Red   intensity:   0 | Blue  intensity:   0 
   0 | Blue  intensity:   0 | Green intensity:   0 
 255 | Green intensity: 255 | White intensity: 255 
   0 | Red   intensity:   0 | Red   intensity:   0 
   0 | Blue  intensity:   0 | Blue  intensity:   0 
 255 | Green intensity: 255 | Green intensity: 255

This would turn on all the Green LEDs in an RGB string and a rainbow in a WRGB string.
Re: Neopixel RGBW issue
July 21, 2022 10:04AM
A photo of a few leds might also help

On mine for eg the white takes up half the led and is easy to see

eg

Edited 1 time(s). Last edit at 07/21/2022 10:08AM by Dust.
Re: Neopixel RGBW issue
July 21, 2022 07:38PM
Here is a photo of the led strip. As I posted, it looks to me like the White element is clearly visible, in this case it is a warm white strip.
It just doesnt make sense to me why my setup does not act the same as yours, ie the 'greyed out settings not acting the same. Hence why I think its a setup, programming issue.
Im no expert on Marlin, by any means, but I am decent at working things out given enough time and effort, but this one has stumped me.
Can you confirm, just for my own interest, that the Neopixel settings between:

Configuration.h &
neopixel.h

Should list the Neopixel type differently?

ie.

NEOPIXEL_TYPE NEO_GRBW (in configuration.h)

vs

_NEO_IS_RGB (in neopixiel.h)

Should they not be the same?



The fact HAS_WHITE_LED and NEO_WHITE 0, 0, 0, 255 are 'greyed out' has to be part of, or all of the problem.


If I leave the settings for Neopixel.h as they are, ie, _NEO_IS_RGB

And change the neopixel type in Configuration.h to NEO_RGB

HAS_WHITE_LED 1
&
NEO_WHITE 0, 0, 0, 255

Both become active, ie not 'greyed out'

Edit# I tried to upload an image of the Led strip (1Mb) but it says the 'entity' is too large, even though it is only 1Mb. Tried a different browser also, but the same result. so I'm not sure what's going on with that, any ideas?
I have included a google drive link with the photo, hopefully that works for you.
[drive.google.com]
Re: Neopixel RGBW issue
July 22, 2022 12:58AM
I have included a link to google drive, with my whole configuration, if anyone is willing/able to have a look, it would be greatly appreciated.

[drive.google.com]


Also, does anyone have an idea why I cant attach anything in the forum? I have tried a couple of different browsers, but the same happens. It just shows a error (404 from memory) and says something like the entity is too large, no matter what size the file is. Weird.

Thanks in advance.
Re: Neopixel RGBW issue
July 22, 2022 01:52AM
Both links are "You need access"
Re: Neopixel RGBW issue
July 22, 2022 04:03AM
Re: Neopixel RGBW issue
July 22, 2022 04:26AM
Yes...

Leds do look like 4 colour leds
Re: Neopixel RGBW issue
July 22, 2022 04:56AM
why have you edited the default neopixels.h



Most impotanly why did you remove the "!" from line 47? This is required

The line should read if led type is not a RGB type led then #define HAS_WHITE_LED 1


You have the reverse

Edited 2 time(s). Last edit at 07/22/2022 04:57AM by Dust.
Re: Neopixel RGBW issue
July 22, 2022 05:46AM
Success!
What a legend, Thanks!

It all boiled down too not having the ! in my code. I must have accidentally deleted it somehow and not noticed.
The reason I had it set to GRB not RGB is because I had just been trying out everything I could think of, and that was just the last thing I had tried, I had it set to RGB previously, but as that was not working (due obviously to not having the '!' In the code), I was just trying other things. This Is the first time I have had Neopixels in a build.
I have to thank you for your time, I really do appreciate everybody's effort, you guys are great.

The reason I edited the neopixel.h file in the first place, was because I couldn't get them to work properly when I first set them up (editing just the configuration.h file) . I'm thinking maybe it was because I had them running off 3.3V (now changed to 5v), and the White led maybe didn't have enough voltage? and then I just started chasing my tail. Changing the neopixel.h file, and accidentally deleting the '!' somehow by mistake.

Now all is well, thanks to you guys!

Just one more thing. Any ideas why I cant upload any attachments to the forum? Not a big deal, hopefully I don't need any more assistance ,lol. But if you have an idea, it may be helpful in the future. It doesn't matter what size the attachment is, it just says the entity is to large, as I say, no biggie, just interested in what the problem could be.

Once again, Thanks
Hope your days going well.

Tim
Re: Neopixel RGBW issue
July 22, 2022 07:05AM
I always go the ATTACH FILE route. Drag & drop doesn't work for me.

The only times I've had problems is when I exceed the guideline (8 Mcool smiley or forget to click on ATTACH.
Re: Neopixel RGBW issue
July 22, 2022 07:36AM
Im not doing the drag and drop method either.

Im clicking 'Attach a file', select the file I want, then click attach.

This is the message I get...

413 Request Entity Too Large

As you can see from the photo linked in Google drive (of the neopixels) it is only 1Mb in size, that is the exact same photo I tried to link earlier. So I don't know what's going on.

Tried a couple of browsers too, but I get the same message. (Chrome & Vivaldi)
Re: Neopixel RGBW issue
July 22, 2022 09:01AM
trying your 1mb image I also get 413 Request Entity Too Large

Fixed, server setting. default was 1m total, upped to 8



Edited 1 time(s). Last edit at 07/22/2022 09:49AM by Dust.
Re: Neopixel RGBW issue
July 22, 2022 07:50PM
Nice!
Glad it was an easy fix.

Thanks again for your help.
Sorry, only registered users may post in this forum.

Click here to login