WS2812B Support

Hi there,

I would like to know if the BlinkStick Pro supports the WS2812B chip. I have noticed strange behavior when trying to set all LED to the same color - I was not able to set them to a predictable state.
For example:

blinkstick --set-mode 2
blinkstick --channel 0 --index 5 red

Results in:

first execution: 2 - red
second execution: 2 - blue, 3 - red, 4 - red

I wasn’t able to do so with a python script either.

As you stated in WS2812 module with blinkstick pro

Yes, it’s possible to connect the LED strip to BlinkStick Pro. The communication to WS2812B is compatible with WS2812S.

It sounds like the WS2812B should be supported too. Is this right?

I would also like to know if there is a new BlinkStick Client that supports the mode 2 - WS2812 in general.

Thank you very much.
Kind Regards Daniel

Yes, WS2812B should be supported and I have them connected and working in a strip of 64 LEDs. Have you tried sending LED frames instead of setting colors individually? There should also be a delay of about 20ms between individual pixel color changes if they are set with indexes and not LED frames.

The new client application with support of individual pixels is almost complete. Beta will be released this week.

1 Like

Have you tried sending LED frames instead of setting colors individually?

Do you mean the use of BlinkStickPro.set_color() that stores the channel and color values in data? - yes I also tried this:

class Main(blinkstick.BlinkStickPro):
    def oneLED(self): 
        self.set_color(0, 1, 0, 0, 255)
        time.sleep(0.02)
        self.send_data_all()
# Change the number of LEDs for r_led_count
main = Main(r_led_count=60, max_rgb_value=255, delay=0.002)
if main.connect():
    main.oneLED()
else:
    print "No BlinkSticks found"

But the result is the same as executing with the cli (as described above):

blinkstick --channel 0 --index 5 red

I also have some issues to understand the example

  1. BlinkStickPro.send_data_all() actually sends the color values from the attribute data over to the blinkstick. Why is it placed before setting the colors? That doesn’t make sense to me.
  2. BlinkStickPro.send_data_all() is not necessary at all since BlinkStick.set_color() sends the color immediately (unlike BlinkStickPro.set_color ).

It would be nice if you could clarify the use of these 2 approaches I see here (
a) immediately send data and
b) store data in a frame and send them at once)

Could you upload a pic of the LEDs you are using?

Now to answer your questions.

  1. The first send_data_all() turns off all LEDs. It just sends an array of all 0, but as long as the array is already initialized, there is no need to set the values before that.
  2. The function send_data_all is designed to send the data when the LED frame is ready. So for the BlinkStickPro class the normal operation is like this:

a) prepare the frame by setting any colors you want for any LEDs, for example set LED1 to red, LED2 to green and LED3 to blue.
b) call send_data_all to send the whole LED frame at once and then wait for 20ms for BlinkStick to send the data to LEDs.

When BlinkStick is sending data to LEDs it can’t communicate over USB.

If you use BlinkStick.set_color, then you always have to wait at least 20ms before you can send another color, because of the same reason.

The first send_data_all() turns off all LEDs. It just sends an array of all 0, but as long as the array is already initialized, there is no need to set the values before that.

Well, now this makes perfect sense to me. It was just an unexpected usage of this function.

The function send_data_all is designed to send the data when the LED frame is ready. So for the BlinkStickPro class the normal operation is like this:
a) prepare the frame by setting any colors you want for any LEDs, for example set LED1 to red, LED2 to green and LED3 to blue.
b) call send_data_all to send the whole LED frame at once and then wait for 20ms for BlinkStick to send the data to LEDs.

So knowing this let’s modify my example to this:

class Main(blinkstick.BlinkStickPro):
    def someLED(self): 
        # set all led off
        self.send_data_all()
        # set 3 led
        self.set_color(0, 0, 0, 0, 255)
        self.set_color(0, 1, 0, 255, 0)
        self.set_color(0, 2, 255, 0, 0)
        # send the data
        self.send_data_all()
        # wait - just in case a statement is added below
        time.sleep(0.02)
# Change the number of LEDs for r_led_count
main = Main(r_led_count=60, max_rgb_value=255, delay=0.002)
if main.connect():
    main.someLED()
else:
    print "No BlinkSticks found"

But the output looks like this - so really weird:
Image

Could you upload a pic of the LEDs you are using?

Image
There is no Label “WS2812B” on the strip but the product description of the seller I got the strip from said so.
Could you share some code that is verified to work with WS2812B?

Do the specs of the LEDs tell the data transfer speed they are designed for?

Can you do the following quick test:

    # set all led off
    # self.send_data_all() <<== comment out this line

Unplug the LED strip and then plug it back in to set all colors to black. Then run the sample script. Can you please tell me how many LEDs light up?

Do the specs of the LEDs tell the data transfer speed they are designed for?

In product description of the seller the transfer speed reads as follows:

The data transfer rate is 800 kbps and can not be converted to 400 kbps (low speed ) because pin 7 ( SET ) for the controller is not figure out.

Can you do the following quick test:

When I unplug the LED strip from BlinkStick and plug it back, so the first LED turns short off and then it lights steadily in white.
When I run the script it has exactly the same effect.

If I should unplug the strip from electric current, so after plugging back and run the script it has the same effect like such as I have described above.

I now recall a similar issue with another user. This type of behavior was caused by poor performance of a power supply. The LEDs require a very high quality PSU in order to function correctly. What kind of power supply do you have?

The power supply has an amperage of 4 A and the voltage is 5 V. Between the contacts of strip and power supply there are power-wires in a length of a half metre which I have used to get some length.

Do you have a different PSU to try out?