bigtreetech / BIGTREETECH-SKR-mini-E3

BIGTREETECH SKR-mini-E3 motherboard is a ultra-quiet, low-power, high-quality 3D printing machine control board. It is launched by the 3D printing team of Shenzhen BIGTREE technology co., LTD. This board is specially tailored for Ender 3 printer, perfectly replacing the original Ender3 printer motherboard.
1.99k stars 1.98k forks source link

v1.2 RGB Neopixel leds working #123

Open raymond-w2 opened 4 years ago

raymond-w2 commented 4 years ago

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

/**

JWolfJr commented 4 years ago

Working here too.

Akiviech commented 4 years ago

@Taomyn i have exactly the same problem like you had, but can't fix it.

In file included from Marlin\src\feature/leds/leds.h:33:0, from Marlin\src\MarlinCore.cpp:85: Marlin\src\feature/leds/neopixel.h:34:10: fatal error: Adafruit_NeoPixel.h: No such file or directory

Taomyn commented 4 years ago

@Akiviech it means you haven't got the custom Neopixel library anywhere it can find it. Easiest is to manually download it from https://github.com/CommandoreBombardiero/Adafruit_NeoPixel then extract it into the ".platformio\lib" under your profile - it's where VSCode stores the shared libraries.

image

My platformio.ini has

[common]
default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants
lib_deps =
  LiquidCrystal
  TMCStepper@>=0.6.2,<1.0.0
  Adafruit NeoPixel
  U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip
  Adafruit_MAX31865=https://github.com/adafruit/Adafruit_MAX31865/archive/master.zip
  LiquidTWI2=https://github.com/lincomatic/LiquidTWI2/archive/master.zip
  Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/0.8.0.zip
  SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip
  SailfishRGB_LED=https://github.com/mikeshub/SailfishRGB_LED/archive/master.zip
  SlowSoftI2CMaster=https://github.com/mikeshub/SlowSoftI2CMaster/archive/master.zip

and

[env:STM32F103RC_btt_512K]
platform          = ststm32
board             = genericSTM32F103RC
board_upload.maximum_size=524288
platform_packages = tool-stm32duino
build_flags       = !python Marlin/src/HAL/STM32F1/build_flags.py
  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=512
build_unflags     = -std=gnu++11
extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
src_filter        = ${common.default_src_filter} +<src/HAL/STM32F1>
lib_deps          = ${common.lib_deps}
  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
#lib_ignore        = Adafruit NeoPixel, SPI
lib_ignore        = SPI
monitor_speed     = 115200

Hope this helps

kou5oku commented 4 years ago

hmmm Im soooo close!

I even put Delay.h in the Marlin folder in my project and a couple other places!

ERROR:

.pio\libdeps\STM32F103R_bigtree\Adafruit NeoPixel@src-b50f341f40c4e9eea3bc4b3fb872ea95\Adafruit_NeoPixel.cpp:51:10: fatal error: replace with path to Delay.h file: No such file or directory
 #include <replace with path to Delay.h file>

Adafruit_Neopixel.cpp


#include "Adafruit_NeoPixel.h"

#ifdef TARGET_LPC1768
  #include <time.h>
#endif
#include "Delay.h"
#if defined(NRF52) || defined(NRF52_SERIES)
#include "nrf.h"

// Interrupt is only disabled if there is no PWM device available
// Note: Adafruit Bluefruit nrf52 does not use this option
//#define NRF52_DISABLE_INT
#endif

Any idea why it cant find Delay.h? I am using a windows box and I do have an absolute path: C:\Users\me\Marlin\src\HAL\shared\Delay.h

How do I format the path properly?

Thanks!

Taomyn commented 4 years ago

@kou5oku that doesn't look like the same version of Adafruit_NeoPixel.cpp as I can't see CommandoreBombardiero's comment about the change:

#include "Adafruit_NeoPixel.h"

//Locate Delay.h file in your local Marlin copy: Marlin 2.0/Marlin/Marlin/src/HAL/shared/Delay.h
//and enter full path to this file below

#include "C:\Users\F\Marlin-2.0.5.1_SKR_E3_20200317\Marlin\src\HAL\shared\Delay.h"

#ifdef TARGET_LPC1768
  #include <time.h>
#endif

#if defined(NRF52) || defined(NRF52_SERIES)
#include "nrf.h"
Akiviech commented 4 years ago

@Taomyn thank you, you saved me! I forgott to edit lib_ignore

CE44D1DD-29DE-4D26-B9C4-81FE5BEB3099

uniqit01 commented 4 years ago

printer_led Thank you very much for your work guys! It helped me a lot. Its working quite good for now with CommandoreBombardiero fork and others advice except i dont know why i cant change LED brightness in printer Menu. Only value set in config file is working, any other than that = turn lights off, i dont know why, and its doing only with white color. Im just thinking it can be because of missing pwm control support of my leds?

eboblin commented 4 years ago

Sorry everyone, i can't get neopixel stick (8 leds) working with skr mini 1.2. What i have done: 1)in platformio.ini, under [common] lib_deps added https://github.com/CommandoreBombardiero/Adafruit_NeoPixel

2)in platformio.ini, under [env:STM32F103RC_btt_512K] removed Adafruit NeoPixel from lib_ignore (left only SPI)

3)In .pio\libdeps\STM32F103RC_btt_512K\Adafruit NeoPixel\Adafruit_NeoPixel.cpp included full path to \Marlin\src\HAL\shared\Delay.h

4) in Configuration.h `#define NEOPIXEL_LED

define NEOPIXEL_TYPE NEO_GRB

define NEOPIXEL_PIXELS 8

define NEOPIXEL_STARTUP_TEST

`

The firmware compiled. Had to comment out define NEOPIXEL_PIN 4 to compile without loooots of warnings. I'm still confused a bit that pin is never declared.

The fw compiles well, but neopixel stick doest not light up at all. I just connected it to the pins, with no resistors/capacitors. Is it hardware issue? Any clues? Thanks!

Taomyn commented 4 years ago

@eboblin

  1. Download the library and unzip it manually into the VScode libs for your profile, e.g. my Windows set up is "C:\Users{username}.platformio\lib\Adafruit NeoPixel" note the space between "Adafruit" and "Neopixel" is important so then you don't need to edit the [common] section of platformio.ini at all (revert it back to original). You'll need to clean out the one it tried to download into copy under your source, so easiest just to start again keeping a copy of any changed files to refer back to.
  2. This is correct, just leave SPI
  3. Again correct
  4. NEOPIXEL_PIN should be PC7
eboblin commented 4 years ago

@Taomyn I did 1) as you suggested and added NEOPIXEL_PIN PC7. Still nothing. I've found some detail on my neopixel stick: RGBW , SK6812 here's how it looks: https://static.chipdip.ru/lib/190/DOC004190728.jpg it has G, V, and data pins, so connection is quite obvious. here's the 6812 led datasheet: https://static.chipdip.ru/lib/464/DOC002464532.pdf

As description says its RGBW, i tried NEOPIXEL_TYPE NEO_GRBW and NEOPIXEL_TYPE NEO_RGBW also with no luck

Taomyn commented 4 years ago

@eboblin hmmm, odd that I cannot see the data pin on the image or is that what Bx is? You might need to ask on the BTT Reddit

And you definitely connected it to the Neopixel connector as per this?

image

eboblin commented 4 years ago

@Taomyn Data pin is labeled on the other side of the neopixel pcb, and it is connected to the PC7 pin, square to plus and the last is GND, no place for mistakes here. Ok, i'll try asking on BTT reddit. As i've read 6812 and 2812's are (kinda) similar, but this does not clarify why they does not want to cooperate and work properly

CommandoreBombardiero commented 4 years ago

@eboblin It may sound silly, but maybe the problem is related to neopixel power supply selection jumper? My board was shipped with jumper set to external DC-DC 5V module even though I didn't order one. neo

Taomyn commented 4 years ago

@CommandoreBombardiero of course, I'd forgotten about that, I had that exact issue - d'oh

eboblin commented 4 years ago

@CommandoreBombardiero @Taomyn Hurray it worked!!! I measured voltage between gnd and +5v on the board, and there was nothing, but i thought it is because my not-so-good skills and understanding of processes (;

MrRKernelPanic commented 4 years ago

I think I'm soooooo nearly there. I have and 8 Neopixel Ring wired straight to the board. It has a 1000uf Capacitor and a 470 ohm resistor. Initially the LED ring seems to work. They go through self test when powering on and all is good. Red, Green, Blue. But then from the console if I try an M150 command e.g. M150 R128 or B128 they work, but 1 LED is bright white. If I try M150 G128 they all go out, if I try M150 G255 all the LEDs come on white.

I have hooked the Ring upto a Arduino and run simple sketch so I know the setup works.

The heating up and cooling down do seem to be changing colour, although the brightness might need changing.

When printing all the LEDs are on and white. (But I only set the 5th one to be on!)

I have followed the instructions above and am using @CommandoreBombardiero library. I was pretty thorough and purged all the other versions from Platform.io first. (did some backing up of originals). I have the following Platform.io

[platformio]
src_dir      = Marlin
boards_dir   = buildroot/share/PlatformIO/boards
default_envs = STM32F103RC_btt_512K

[common]
default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants
lib_deps =
  LiquidCrystal
  TMCStepper@>=0.6.2,<1.0.0
  Adafruit NeoPixel
  U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip
  Adafruit_MAX31865=https://github.com/adafruit/Adafruit_MAX31865/archive/master.zip
  LiquidTWI2=https://github.com/lincomatic/LiquidTWI2/archive/master.zip
  Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/0.8.0.zip
  SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip
  SailfishRGB_LED=https://github.com/mikeshub/SailfishRGB_LED/archive/master.zip
  SlowSoftI2CMaster=https://github.com/mikeshub/SlowSoftI2CMaster/archive/master.zip

Ensured the board specifics doesn't ignore adafruit

[env:STM32F103RC_btt_512K] platform = ststm32 board = genericSTM32F103RC board_upload.maximum_size=524288 platform_packages = tool-stm32duino build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=512 build_unflags = -std=gnu++11 extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py src_filter = ${common.default_src_filter} +<src/HAL/STM32F1> lib_deps = ${common.lib_deps} SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip USBComposite for STM32F1@==0.91 lib_ignore = SPI monitor_speed = 115200 and have made the following changes in Configuration.h

#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
  #define NEOPIXEL_TYPE   NEO_GRB + NEO_KHZ800 // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
  //#define NEOPIXEL_PIN     PC7       // LED driving pin
  //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
  #define NEOPIXEL_PIXELS 8       // 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 127  // 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  5               // Index of the LED to use
  #define NEOPIXEL_BKGD_COLOR { 128, 128, 128, 0 } // R, G, B, W
#endif

Anyone got any suggestions?

Taomyn commented 4 years ago

@MrRKernelPanic not sure what a "ring" is, but my 7 led strip is configured like this:

// 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)
  #define NEOPIXEL_PIN     PC7       // LED driving pin
  //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
  //#define NEOPIXEL2_PIN    5
  #define NEOPIXEL_PIXELS 7       // 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 255  // 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  0               // Index of the LED to use
  //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W
#endif

I find no mention of "NEO_KHZ800" in my file to know what that does.

Mine is connected directly to the board, no capacitor or resistors, as I kept it below 10 LEDs which I think I read somewhere is the best to keep it simple.

CommandoreBombardiero commented 4 years ago

@MrRKernelPanic There is no "G" in M150 parameters, have a look into documentation: https://marlinfw.org/docs/gcode/M150.html. While printing you have all white LEDs because your static LED is also white. The way static LED works is one LED (5th in your configuration) to be diffrent, constant color than all the other LEDs. You can't just choose one desired LED to light up. For me it looks like everything is ok with your setup, there is just some misconceptions about LEDs behavior under Marlin.

CommandoreBombardiero commented 4 years ago

@MrRKernelPanic one more word about this part "You can't just choose one desired LED to light up". Obviously you can, but you have to edit definition of white color in Marlin file "leds.h" to be (0, 0, 0), so all LEDs are disabled and then only the static LED will be lit while printing.

MrRKernelPanic commented 4 years ago

Thank you so much. So actually it is totally working and I was just entering the wrong codes. So M150 U128 will put all the LEDs green. If I want the LEDs to cycle through the colours when heating etc. But then be on WHITE while printing should I embed the M150 command in the Startup GCode and reallyt he use of STATIC is if you want it in one colour all the time? I appreciate your help and this was quite clearly a case of User Error.

CommandoreBombardiero commented 4 years ago

Static is for setting one particular LED to be untouched by printer events, eg. if all LEDs are changing from blue to red during heating up, static LED will remain unchanged. You don't need extra startup gcode, default behavior of the LEDs is:

MrRKernelPanic commented 4 years ago

Thanks, minor tweaking required. Will give it a go and get back to you. I do appreciate people taking the time to help get these things working. This little board really amazes me. Very happy.

MrRKernelPanic commented 4 years ago

I think we're all good. Colours seem good. However since installing the NeoPixels I seem to have more errors where the Skr Mini board stops responding (freezes) when doing G28 or G29 commands from Octoprint. The board simply refuses to re-connect to Octoprint and an Power On / Off required. I was getting this before applying the Neopixel fix, but I have been having these since I enabled Neopixels in the firmware. Although maybe it's just me. The terminal in Octoprint states it lost connection with the board, 'assuming dead' is the lovely phrase it generates. I think I had one or two of these even when the neopixels weren't connect (they were enabled in firmware though) So perhaps not related to the draw of the Neopixels.

Taomyn commented 4 years ago

@MrRKernelPanic strange I'm using OctoPrint and do G28/G29 regularly without any issues

MrRKernelPanic commented 4 years ago

@Taomyn Quick question, do you also use BLTouch probe?

Taomyn commented 4 years ago

@MrRKernelPanic yes a Creality v3.1 one, connected to the z-endstop port of the board

MrRKernelPanic commented 4 years ago

Hmm I have the official BLTouch also on the Zstop Pins. It is always seems to happen when homing. I think G28. I have safe homing enabled. It will home x and y but then freezes before moving to the centre of the bed to home Z. I am running this board on a heavily modified Anet (AM8) now, it has dual Z motors (wired with a splitter). Could it be to do with this? I wasn't getting these errors before enabling Neopixels. I may try disabling the Neopixels in firmware to test again. Anyone tell me how to check logs etc from Octoprint to narrow down the problem.

Taomyn commented 4 years ago

Splitter doesn't sound like a good idea to me because there are control lines in the cabling for the motors, at least for the Creality printers - current versions of Marlin allow you to enable debugging and feedback data for the TMC drivers.

OctoPrint logs are here:

image

MrRKernelPanic commented 4 years ago

@Taomyn Thanks for that. I took another look through Configuration and Advanced Configuration and realised that since I downloaded the latest build I hadn't changed a few settings. My AM8 runs off a 12v supply but I think the Ender 3 uses 24. I changed this one place and 'tweaked' a couple of other settings to with current to the motors. Since then I've not had the same error. However maybe I should delete this comment as it's gone a bit off topic. Thank you all for your assistance and guidance.

Ompapamowmow commented 4 years ago

Strip of 59 leds powered by an external wall powersupply . https://imgur.com/a/lEBhNcu

So did you hook up only the signal wire to the board since you are using an external power supply? or did you still hook up all 3 wires and just splice the external power supply in?

ahnuts72 commented 4 years ago

Ok I have everything working except printer events.

When i turn printer on goes through test fine then off then start print and nothing. I can turn them on and off in printer menu and change color but nothing when i start a print. This is my setup and I'm using CommandoreBombardiero's library.

// 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)

define NEOPIXEL_PIN pc7 // LED driving pin

//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE //#define NEOPIXEL2_PIN 5

define NEOPIXEL_PIXELS 8 // 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 255 // 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 0 // Index of the LED to use //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W

endif

/**

Ompapamowmow commented 4 years ago

Ok I have everything working except printer events.

Same thing for me, but if I start the print through octoprint the printer events work. They do not work when I print from SD.

ahnuts72 commented 4 years ago

Ok I have everything working except printer events.

Same thing for me, but if I start the print through octoprint the printer events work. They do not work when I print from SD.

Im using the tft35 E3 to print from and it wont work when i start a print from it but I checked and started a print with the sd card in the BIGTREETECH-SKR-mini-E3.

It works if i use marlin mode on the display with sdcard in board socket so i guess the tft35 e3 wont work to start led with print from sd card on display and wont work in touchscreen mode to start with led events.

I can turn them on and off and change colors from display in touchscreen mode.

JuStAdsor commented 4 years ago

Hi guys.

I've made the neopixel LEDs to work, in a pair of 8. No cap or resistor added. However, when I change the thermistor type, all the LEDs go crazy. Do you think that adding a cap and resistor should fix this?

Thanks!

noterms commented 4 years ago

Hi guys. Been googling on what neopixels actually are since i noticed on the board there is a port to connect to for them and after some head scratching i purchased a 1m strip of 60leds WS2812B. From what i am reading here i won't be able to power that many from the board am i correct there?

I don't really much care for any around the z axis but would be nice if i can get away with it just from the 5V ouput of the mini E3. https://www.amazon.co.uk/CHINLY-WS2812B-Individually-addressable-Waterproof/dp/B07TPSB35N/ref=sr_1_3?dchild=1&keywords=WS2812B+led+strip+1m&qid=1592523897&s=lighting&sr=1-3

This is the kit for reference i'll be cutting them from the waterproof sleeving hopefully the connect is fine im not sure what you have to use in order to plug into the board.

Any tips would be great

Thank You

Taomyn commented 4 years ago

@noterms rule of thumb from what I have read is that you can usually get away with up to around 10 LEDs running direct from the board, so my 7 are fine. Above 10, then you need to separately power them, either by separating the power cables to another supply, or with the power jumper on the board set for powering them with a small add-on called the "DCDC5V V1.0 Power Module" which can be seen here: https://www.aliexpress.com/item/4000474224890.html

noterms commented 4 years ago

@Taomyn Thank You! I mananged to find the power module on amazon with prime shipping i'll give it a go.

noterms commented 4 years ago

Guys does anyone know of a pre compiled bin for this? I am using 10 leds i plan to drive them from the board. If this isn't sufficent i'll cut them down to 8. However when i am trying to compile the firmware after making changes i've tried to follow here i just error after error

In file included from Marlin\src\HAL\STM32F1../../inc/../pins/pins.h:502:0, from Marlin\src\HAL\STM32F1../../inc/MarlinConfig.h:32, from Marlin\src\HAL\STM32F1\HAL.cpp:30: Marlin\src\HAL\STM32F1../../inc/../pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h:28:0: warning: "NEOPIXEL_PIN" redefined

define NEOPIXEL_PIN PC7 // LED driving pin

In file included from Marlin\src\HAL\STM32F1../../inc/MarlinConfigPre.h:37:0, from Marlin\src\HAL\STM32F1../../inc/MarlinConfig.h:28, from Marlin\src\HAL\STM32F1\HAL.cpp:30: Marlin\src\HAL\STM32F1../../inc/../../Configuration.h:2209:0: note: this is the location of the previous definition

define NEOPIXEL_PIN pc7 // LED driving pin

In file included from Marlin\src\HAL\STM32F1../../inc/MarlinConfig.h:40:0, from Marlin\src\HAL\STM32F1\HAL.cpp:30: Marlin\src\HAL\STM32F1../../inc/SanityCheck.h:1978:6: error: #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN."

error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN."

Just a snippet of some of the errors it throw at me. I new to compiling firmware so this is a tough one for me. Thank You!

rogery555 commented 4 years ago

Hey everyone, based on this thread I was able to hook up 2 neopixels to my print head and they are currently running and powered off my SKR mini 1.2 board and everything is functioning correctly. I would like to add 12 more and power them with a separate 5v supply. I'm just a bit confused on the wiring and want to make sure I do it correct. Can anyone confirm this diagram I created would work ok? neopixel wiring 2-01

paul-1 commented 4 years ago

That’s how I wired mine. But with the library mods in this thread, I have no resistor

noterms commented 4 years ago

So after a few days and lots of help from discord and other places i managed to get a working library and thus compile a working firmware. However still no neopixels sadly. I've tested them outside of the skr and they function. So i don't know what the problem could be. Any thoughts?

rogery555 commented 4 years ago

That’s how I wired mine. But with the library mods in this thread, I have no resistor

Do you have the neopixel jumper installed still or did you just remove it? I think I have something wired wrong, when I plug in my 5v supply my hot end fan turns on WTF! Also by plugged in its just providing ground, not even turned on providing 5v yet. I need to go back to check everything as Ive had everything from the board disconnected for an unrelated project but am curious about your jumper.

paul-1 commented 4 years ago

If nothing is connected to the +5v pin on the neopixel plug, then the jumper does not matter. I left it in place.

rogery555 commented 4 years ago

If nothing is connected to the +5v pin on the neopixel plug, then the jumper does not matter. I left it in place.

ok thanks, thats what I thought. Is your 5v power supply completely separated from the system? My 5v supply is provided from a buck converter powered from the 24v supply that the printer runs on.

paul-1 commented 4 years ago

Same thing, I’m running 2 RGBW strips, with about 30 leds.

noterms commented 4 years ago

I just don't understand whats wrong here i tested the strip of 8 on pizero and everything functioned (even pushed 45 leds) Here are my settings incase someone sees something i missed

EDIT Switched to demitrix in lib.deps and straight away they function!

Configuration.h

if EITHER(RGB_LED, RGBW_LED)

//#define RGB_LED_R_PIN 34 //#define RGB_LED_G_PIN 43 //#define RGB_LED_B_PIN 35 //#define RGB_LED_W_PIN -1

endif

// 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)

define NEOPIXEL_PIN PC7 // LED driving pin

//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE //#define NEOPIXEL2_PIN 5

define NEOPIXEL_PIXELS 5 // 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 127 // 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 0 // Index of the LED to use

define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W

endif

/**

Platform.io

[platformio] src_dir = Marlin boards_dir = buildroot/share/PlatformIO/boards default_envs = STM32F103RC_btt_512K

[common] default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared> extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants lib_deps = LiquidCrystal TMCStepper@>=0.6.2,<1.0.0 Adafruit NeoPixel@<=1.2.4 U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip Adafruit_MAX31865=https://github.com/adafruit/Adafruit_MAX31865/archive/1.1.0.zip LiquidTWI2=https://github.com/lincomatic/LiquidTWI2/archive/master.zip Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/0.8.0.zip SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip SailfishRGB_LED=https://github.com/mikeshub/SailfishRGB_LED/archive/master.zip SlowSoftI2CMaster=https://github.com/mikeshub/SlowSoftI2CMaster/archive/master.zip

Globally defined properties

inherited by all environments

[env] framework = arduino build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} monitor_speed = 250000

argus0209 commented 4 years ago

So after a few days and lots of help from discord and other places i managed to get a working library and thus compile a working firmware. However still no neopixels sadly. I've tested them outside of the skr and they function. So i don't know what the problem could be. Any thoughts?

did you clear up your errors ?

noterms commented 4 years ago

So after a few days and lots of help from discord and other places i managed to get a working library and thus compile a working firmware. However still no neopixels sadly. I've tested them outside of the skr and they function. So i don't know what the problem could be. Any thoughts?

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.

argus0209 commented 4 years ago

So after a few days and lots of help from discord and other places i managed to get a working library and thus compile a working firmware. However still no neopixels sadly. I've tested them outside of the skr and they function. So i don't know what the problem could be. Any thoughts?

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. I can get marlin to compile but my board won't boot with neopixels enabled. I do however get one green led on power on. This is frustrating.

argus0209 commented 4 years ago

Can someone with neopixels working post there firmware files ?