-
Notifications
You must be signed in to change notification settings - Fork 2k
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
v1.2 RGB Neopixel leds working #123
Comments
I put the 3 pixels under my hero me and are somewhat working, colors are off. After the startup_test the first pixel is not lit. When the hot end heats up the colors are all wrong. Once the hotend is to temperature the first led is blue and the other two are white though. Was putting up with it. I just need to add a high ohm resister on the dataIn line and change NEOPIXEL_TYPE? Any help is appreciated, been putting up with it but would rather it work the way its supposed to. |
I didn't install the LED strips yet, so I can only guess, but if your colors are off, you can try to change the NEOPIXEL_TYPE. Maybe NEO_KHZ800 or NEO_RGB. And for the first LED behaving differently, maybe you defined NEOPIXEL_BKGD_LED_INDEX? This seems to affect only one LED. |
I did try NEO_RGB, and the colors were worse. I think its weird that after power up they should be blue and the first led is off. I just tried compiling with NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800), and it failed. The output didn't like the + sign. |
Also, the NEOPIXEL_BKGD_LED_INDEX is still commented out. |
I'm a dummy the NEO_GRB + KHZ800 shouldn't be in parentheses! That's what I get for being lazy and copy and pasting. |
This was my issue also, wrong colors and partial functioning RGB leds. |
Just compiled with the above changes, getting ready to test it out. Just have to solder in the resistance change. |
Thanks for posting your findings, I went with 14.4k and is pretty close. Red is red blue is blue and so on, I think orange and yellow are slightly off. I can live with it, I really just care about the extra light when printing. Thanks again! |
Interesting! thanks for this! Did you use a cap at all? Such as adafruit recommend? |
Not on this one, on all my other addressable led projects I do though. I do have a set of 4 tea lights I printed and use for a halloween scene with a flickering sketch that I did not use any caps on. Was on all of October with no ill affect. |
I was able to get LEDs working with a little different route. Have you noticed any issues with inconsistent colors though? I'm curious is the resistor is the key here. I will try to get a video of the effect, but say during the warm up cycle, most pixels are purple like they should be, but a few will be yellow or red instead. |
|
@demitrix I placed an extra ground wire from the SKR-PSU connection to the metal chassis and connected my 5v LED PSU ground to the chassis also. There are multiple users mentioning inconsistent ground problems, probably pointing to a bad ground plane design. |
Here are the changes I used when I first got my strip working. Configuration.h The NEOPIXEL_PIN is defined in a separate file no need to define it here. @raymond-w2 I am using the DCDC5V addon and getting 5v/gnd from the board itself. Perhaps this is an issue as well. I have a 4kOhm resistor laying around I may toss on the data in to see if it helps. I believe using NEO_GRB + NEO_KHZ800 is redundant if you look at Marlin\src\feature\leds\neopixel.cpp Adafruit_NeoPixel Marlin_NeoPixel::adaneo1(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800) |
@demitrix Using the onboard DCDC5V is only possible with a small amount of leds, I'm using a strip of 59. |
I only have 20 LEDs so within range. I have up for the time being. They work sometimes but colors are inconsistent, I believe it's BTTs implementation of STM32F1 in the neopixel library to be honest |
I have made some progress in my suspicions. After some light reading about bit banging and microcontrollers and WS2812B strips I was convinced that BTTs timing was off. I just uploaded a second version my modified NeoPixel library and have much better accuracy on my LEDs. I have increased the number of nops to increase the delay between GPIOs being high and low. Some of the ranges used by BTT are far off. Really need someone with an oscilloscope to measure the data pin and confirm the timings.
|
So I just realized tonight when adding mesh bed leveling that my second try at this never actually flashed. The above edit to Adafruit_NeoPixel.cpp gets the RGB functionality much much closer than it was with BTTs version. anyone else using RGB feel free to try it out and see if it improves your RGB colors. Here is the hotend heating sequence. Still a few glitches. |
Hi, Wanted to see if anyone made any progress here. Here's the REALLY strange thing. LED control works PERFECTLY under Klipper firmware, so there's something specific to Marlin / the Bigtree Neopixel library that's borked. Here's my Marlin config:
Library config in platformio.ini:
Under Klipper I can address any of the 3 LED's on the hot end and get the exact color I ask for, so I know the SKR Mini E3 1.2 is capable at the hardware level. Perfectly working Klipper config:
My gut instinct tells me that even though we're setting it to GRB (no W) it's still treating it like a GRBW LED type. I'm using this exact strip: https://www.aliexpress.com/item/32886914735.html (60 leds/meter) Perhaps an examination of what he's doing differently (that works) with Klipper would help: https://github.com/KevinOConnor/klipper/blob/master/src/neopixel.c UPDATE: On a whim I changed the amount of LEDs in Configuration.h from 3 (what I actually have on the hot end) to 8 just to see if it would make a difference. Unbelievably its working almost perfectly! Before if I set the LEDs to "off" they would still be lit, just dimmer. Now they actually turn off. Also the color presets menu is working about 98% correctly with Demitrix's modified library. There must be a bug in how it tries to "index" the individual LED's. Video: https://imgur.com/a/2dzzqXF |
I've also been trying to get my neopixel strip of 15 LEDs working. I have them plugged in directly to the neopixel port for power and data and using the same configuration.h and platform.ini as above, but my LED strip only turns on as white. I can't get the LEDs to change color, the startup test, through gcode, or through the LCD menu. Any suggestions? |
@wees Are you using the modified library by Demitrix? I had WAY better results with it. Also you might have to play with the number of LEDs in Marlin. When I set to what I actually have it doesn't work, I had to go higher. (I have 3, had to set to 8, 15 also works) Also if you have 15 you have to supply additional power, I don't think the board can drive that many without the 5v add-on board. |
@Scope666 I am using Demitrix's library now. I thought that would be the golden ticket but no luck. I'll try setting a higher number of pixels. I did try a lower number thinking maybe it was a power issue and it did disable the additional LEDs, but the color is still white. Well RGB white, my strip isn't rgbw just to clarify. |
How are you disabling the additional LEDs, aren't they all connected together in the strip? Doing it at the software level I don't think would be enough. My strip is also GRB only, no "W" This one: https://www.aliexpress.com/item/32886914735.html (60/meter) Edit: they say not to use more than 8: |
By disabling I mean in the software. I have a total 15 LEDs in my strip and when I set the number to 5, only 5 LEDs lit up. Edit: Hmm I didn't see that recommendation. All of the LEDs are lit up, but I'll try 8 |
Something is definitely off, I haven't touched this in a while been working on other things, however I noticed that each time I flash a firmware the results were different. Even with no changes to the Neopixel config, I am not sure whats going on. It looks like Klipper is using an actual timer to time the Neopixel signals, where as Marlin (well not Marlin but BTTs implementation of Neopixel) is just bitbanging the port and using nops as a "timer" to set the delay in signal. This can vary wildly in relation to the timing that the LEDs require. Hopefully one day someone with more experience (mine being none) experience with STM controllers can rewrite the library to use the proper timer or maybe Adafruit will add STM32 support someday. If anyone were to have access to an oscilloscope that could measure the signals from the Neopixel pin on the SKR we'd be closer to knowing how far and which direction the timing if off by. I was just trying to make an educated guess with my changes. |
I would suggest maybe cutting off and wiring 3 only, to replicate my setup. You can always install them on the hot end, and then add more later to the top bar. (my plan) Hopefully you can get to a known working setup with the 3, and then troubleshoot from there. |
@demitrix For sure, Klipper definitely nailed it. It was spot on perfect the first time I tried it, and I could individually set each LED to any color I wanted. The Marlin guys / BTT should take a look at his code. Is there any way to reverse engineer how Klipper is doing it to get the timing correct that way? |
Yeah I just popped over to that repo and it looks like it using an actual timer library. Maybe one day if I get bored I might dig back into this. I am in the process of moving my Ender to an enclosure and designing an electronics case for everything. So the RGB LEDs hit the backburner as I will probably light the enclosure with just white LEDs. |
Had some time this morning to play around with my config. Changing to 8 LEDs didn't change anything. They all stayed white. On a whim, I changed the NEO_GRB to NEO_GRBW and my LEDs did change colors, although not the correct colors. Very strange because I'm 99% sure my LEDs do not include a W pixel. I did order the 5vDCDC board and the neopixel strip Scope666 posted above so maybe it's just my LED strip. The fact that my LEDs do respond to gcode, but don't display the correct colors leads me to believe my LED strip is out of compliance or some other standard. |
did you clear up your errors ? |
Yes there was a linting setting in vscode that caused those i can't recall it now. But changing to demitrix library helped a great deal in fixing my issue. Something is off with the default library for neopixels. |
I have the same errors so if you recall the fix please let me know. |
Can someone with neopixels working post there firmware files ? |
Its not that easy, since there are too many machine options. First.....Please make sure you pull the latest Marlin Bugfix....... What are problems are you seeing? How are your LEDs wired? What kind of LEDs do you have? |
My issues was fixed with a reboot of my computer. Here is my config to help people in the future. thanks everyone! Firmware = https://github.com/bigtreetech/Marlin Platformio.ini: [platformio] The 'common' values are used for most Marlin builds[common] configuration.h: // Support for Adafruit Neopixel LED driver // Use a single Neopixel LED for static (background) lighting /**
|
Hello, thank you for all these posts. I would like to operate just 1 LED 5V to create a light to know when it is hot, cold and other. I know how to do it with GCODE, but I don't quite understand how to connect. I have 4 wires on my led strip and I'm not sure which PIN to put these cards on, if I need a resistor or something. I don't want to burn my card. Thank you |
Thanks, where in the skr E3 mini i connect ? And i change files pins ? |
Ok, so I jumped the gun a bit and was not paying attention. Yes it compiles, yes the LEDs switch on, no they cannot be controlled by the printer. They remain full lit white at all times. Have tried with the PIN set to PC7 and without. So I reverted to the the old "fixed" version of the library from https://github.com/CommandoreBombardiero/Adafruit_NeoPixel and now it's back to RGB normality. Looks like BTT have broken something somewhere, so I'm going to fork the CommandoreBomardiero version for myself to include the correct changes to one of the files so it works on my environment even when VSCode has to download it again. |
I'm getting absolutely zero reaction. no matter the library. |
Neeevermind. The strip is broken. |
If you are still having probs try this solution |
i cannot seem to get this to work on a SKR mini e3 v1.2 , so many different ways of doing this, and nothing works.
configuration.h
in Adafruit_Neopixel.cpp i added after
but that always seam to fail finding the file when changed to the 512k env. Also changed the jumper for external power to motherboard power. |
@Mickroz what actually fails? You don't post any kind of messages you're getting. There's other things you need to do to get it to compile for the mini E3. |
Ok, let me take you through my steps:
at 1 time i had seen the leds turn red/green/blue/white very fast, but never after that again, i cannot control the color via octoprint too. |
@Mickroz The compiler is telling you exactly what's wrong. You were suppose to literraly replace the <> content at line 51 by your Delay.h file path. As far as I understand, you've created seperate include directive, so just delete the line |
@Mickroz I don't see anywhere where you actually replace with part with <> in |
Ah wait, now i see, im in the wrong file, im editing Adafruit Neopixel/Adafruit_NeoPixel.cpp and that line is in Neopixel/Adafruit_NeoPixel.cpp, argh, dunnow why i haven't seen that before :( |
YES, now it builds correct 👍 it flashes good aswell, but no leds |
Good day. I fight all day with the settings for NEOPIXEL and SKR Mini E3 V1.2 // Support for Adafruit Neopixel LED driver //Changed by RaymondW #define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup // Use a single Neopixel LED for static (background) lighting In file included from Marlin\src\feature/leds/neopixel.h:34:0, STM32F103RC_btt_512K FAILED 00:00:20.447 Terminal will be reused by tasks, press any key to close it. Very thanks..... |
still can't seem to get the leds light up, gonna try a new strip, see if that will work. |
still no go, both led strips do work on my raspberry pi when using python neopixel library and the 5v pin on the rpi, but not on this board. |
@Mickroz i had my rgb working on 2.0.5.x i upgraded to 2.0.7.2 and they no longer work ive tried everything but nothing so i think im going back to 2.0.5.x again |
Ok, but there are people who have it working, so i don't understand why this fails. |
You're welcome to look at my still working code here https://github.com/Taomyn/Marlin it's updated many times per week off the latest bugfix-2.0.x |
abacabie commented on 28 Oct 2020 Search for NEOPIXEL_LED in platformio.ini, you will find it under "Feature Dependencies" and overwrite "Adafruit NeoPixel@1.5.0" with "https://github.com/CommandoreBombardiero/Adafruit_NeoPixel" when you compile this it will fail, go to the .pio folder in marlin and open the folder that downloaded the CommandoreBombardiero library, open the "Adafruit_NeoPixel.cpp" and find the line that reads "#include " , its near the top, you need to overight and point to the "Delay.h" file that is in marlin, for me it looks like "#include "C:\Users\ray\Desktop\Marlin-2.0.x\Marlin\src\HAL\shared\Delay.h"", from #436 you dont need to do the insanity check part turned out that the leds were working all along a wire has just snapped at solder point near my nozzle on the leds so thats why it stopped working after upgrading lol |
thanks, will do.
this is exactly what i did. |
Hi Everyone, I have a partially working Neopixel setup. There are a few issues I have not been able to figure out, perhaps someone knows the answer to this. I am using the CommandoreBombaderio edit of NeoPixel on a completely fresh pull of the 2.0.7.2 repo from BTT. I have wired in 400 ohms worth of resistance and a 1000 uf cap. The test sequence works. Heating the nozzle and bed sort of works. I get a sequence of lights ranging from blue to violet then the very last 3 of 29 LEDs will turn red and my print begins. I can select a color of LED in the settings menu, but I cannot turn off the LEDs nor switch to a different color. I can send an M150 command such as M150 B255 and turn on a blue light, but I cannot get M150 B0 to work. So while Gcode works to turn on the LEDs, it does not work after turning on a LED then trying to switch color or turn them off. Any ideas to get this working properly? |
After some trial and error I got my RGB leds to work.
Strip of 59 leds powered by an external wall powersupply .
https://imgur.com/a/lEBhNcu
Sharing my solution here as I spent way to much time on this...
On the WS2812B Din the normal resistor should be 300 to 500 Ohm.
I changed it up to 12580 Ohm (several resistors in series) and now the signal is coming trough :)
/edit
After a bit mote tinkering best value was 14K Ohm
Software settings :
Platformio.ini
https://github.com/bigtreetech/Adafruit_NeoPixel
Configuration.h
`// Support for Adafruit Neopixel LED driver
#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
//#define NEOPIXEL_TYPE NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
//edit by RaymondW
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800)
#define NEOPIXEL_PIN PC7 // LED driving pin
//Changed by RaymondW
#define NEOPIXEL_PIXELS 59 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 55 // Initial brightness (0-255)
#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
// Use a single Neopixel LED for static (background) lighting
#define NEOPIXEL_BKGD_LED_INDEX 25 // Index of the LED to use
#define NEOPIXEL_BKGD_COLOR { 0, 0, 0, 255 } // R, G, B, W
#endif
/**
*/
#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED)
#define PRINTER_EVENT_LEDS
#endif`
The text was updated successfully, but these errors were encountered: