Error when setting alternating colors on BlinkStick Square


#1

Hi!

I have a BlinkStick Square and try to programatically alternate between colors. My program in pseudocode is the following:
Open device
Open stream
for(;;) {
SetFeature(0x06 0x00 0x00 0xff 0x00 0x00 0xff 0x00 0x00 0xff 0x00 0x00 0xff 0x00 0x00 0x00 0xff 0x00 0x00 0xff 0x00 0x00 0xff 0x00 0x00 0xff)
Wait(250 ms)
SetFeature(0x06 0x00 0x00 0x00 0xff 0x00 0x00 0xff 0x00 0x00 0xff 0x00 0x00 0xff 0x00 0xff 0x00 0x00 0xff 0x00 0x00 0xff 0x00 0x00 0xff 0x00)
Wait(250 ms)
}

Sooner or later only the LED 0 will continue to alternate, though. All other LEDs remain at their previous state. The command has not changed and should address all LEDs, not only the LED 0.

You can find a video of the issue here: https://anonfile.com/0127S1gbb5/software_error_mp4

Does anyone have an idea what went wrong here?

Best
Jan


#2

Please post some real code, we can´t say whats wrong with your pseudocode only.


#3

Hey p0ke,

please find the real code below.

I do not think this is an error in my code, though. I assume a Firmware bug, that’s why I only posted the pseudocode. My code has a length of about 200 lines so I rewrote the necessary parts using the BlinkStickDotNet package from NuGet. It produces the same error.

public class Program
{
    public static void Main(string[] args)
    {
        BlinkStickTesterWithNugetPackage.Tester();
    }
}

public class BlinkStickTesterWithNugetPackage
{
    public static bool Tester()
    {
        BlinkStick device = BlinkStick. FindFirst();
        if (device == null || !device.OpenDevice())
        {
            return false;
        }

        device.SetMode(2);
        Thread.Sleep(100);

        byte[] colors1 =
        {
            0, 255, 0, // red - GRB
            0, 255, 0, // red - GRB
            0, 255, 0, // red - GRB
            0, 255, 0, // red - GRB
            0, 0, 255, // blue - GRB
            0, 0, 255, // blue - GRB
            0, 0, 255, // blue - GRB
            0, 0, 255 // blue - GRB
        };

        byte[] colors2 =
        {
            0, 0, 255, // blue - GRB
            0, 0, 255, // blue - GRB
            0, 0, 255, // blue - GRB
            0, 0, 255, // blue - GRB
            0, 255, 0, // red - GRB
            0, 255, 0, // red - GRB
            0, 255, 0, // red - GRB
            0, 255, 0 // red - GRB
        };

        for (int i = 0; i < 1000; i++)
        {
            device.SetColors(0, colors1);
            Thread.Sleep(250);
            device.SetColors(0, colors2);
            Thread.Sleep(250);
        }

        return true;
    }
}

#4

Yep, your code works like a charm. Tested it with 2 Squares but cannot reproduce your issue.
What is the revision of your board? I´ve tested Rev3 boards.


#5

Hmm … I have a Rev3 BlinkStick board here as well. Maybe @arvydas can help here?