WS2812B (NeoPixel) Integration

I am trying to integrate the WS2812B leds onto my Copter. According to the Copter wiki page . I was supposed to select NeoPixelx servo function for one of my auxiliary outputs.

Unfortunately I couldn’t find such an option in the GCS. (QGC).

Any help would be great! Thanks in advance.

looks like they were never added to the param descriptions, they are outputs 120 - 123

Thanks a lot. I tried setting



And connected the 8 led long strip to Aux Out 1.

I assumed that SERVO1-8 are main out and thereafter Auxiliary ones.

Nothing happens.

I checked the drivers for these at Libraries/AP_Notify/NeoPixel.cpp and found HAL_NEOPIXEL_COUNT = 1.

Is this the issue?

We are using external BEC to power the strip if that helps.

Any help would be great!

Found out that Aux 1 was not set as GPIO. Now I have set the BRD_PWM_COUNT = 0 still no changes.

it may not be 100% working yet,

@MagicRuB any update?

could be this:

I have tested this and, for me, neopixels still don’t work. Looking at the code I think I should get one led flashing the ‘standard’ RGB patterns. I have them set on output 120 and turned on in the bitmask. In this case there on a 1M board so I cant try scripting control.

which board and which PWM output?
Some boards don’t have DMA on all channels

MatekF405 pwm 5.


try adding some printf calls in the NEOPIXEL DMA setup in HAL_ChibiOS/RCOutput.cpp

I’ll see what I can do

1 Like

I have just got round to having another look at this. I hooked up the trusty Saleae. They have just added a WS2812B decoder in the logic beta. I’m getting some repeated data on the output but logic (and the led) don’t think its valid. This is the capture:

I will see if some printf’s give any more insight.

Has anybody got this new functionality to work in 4.0 yet?

I notice that SERVOx_FUNCTION does not display the neopixelx options in the wiki nor in MP, so I assume that the code is not finished or integrated?

I would like to add some WS2812B LEDs to the rear of my craft so I can see its status while it is up in the air …


This looks like a mistake in the SERVOx_FUNCTION parameter descriptions. I’ll fix this up but until then you should be able to manually set the parameter to 120 (for NeoPixel1) to get it working.

Thanks for the report!

I have a Pixhawk 2.4.8 FC which has 8 MAIN outputs and 6 AUX outputs.
I am using AUX5 (which I believe is SERVO13?) to provide the digital data to the WS2812B LED.
I have set SERVO13_FUNCTION to 120 and NTF_LED_TYPES to 455 which includes NeoPixel in the bit-mask of types.

The WS2812B LED (a linear string of 8 LEDs) is powered by a separate +5v source.

I assume that the colour of the WS2812Bs should mimic the main LED on the Pixhawk. But all I get are all 8 LEDs as white, which means that they are not getting any valid data. I am obviously doing something wrong - but what?

I think you need to run a lua script to change LED colors. But I am not sure.

I hope that is not the case as I have no knowledge of Lua …

All that I am trying to achieve is to get the various patterns of the internal LED displayed on a WS2821B LED that I will fit to a part of the drone where it is visible to me while flying.

If I understand the instructions here in the wiki correctly, then all I need to do is what I described above?

But, I am not sure that anyone has managed to get this new functionality working?

1 Like

According to @tridge, the LEDs should show the default pattern. Looks like we have a few people who can’t get it working so I’ve added this to our Copter-4.0 issues list so we don’t forget about it.

Not sure whether it is a stupid question😉,
will this work?

which servo output did you use in the settings for the led output?