jackw01 / led-control

Advanced WS2812/SK6812 RGB/RGBW LED controller with on-the-fly Python animation programming, web code editor/control interface, 1D, 2D, and 3D display support, and E1.31 sACN support
https://jackw01.github.io/led-control/
MIT License
162 stars 35 forks source link

help troubleshooting random colors #16

Closed ohthehugemanatee closed 2 years ago

ohthehugemanatee commented 2 years ago

Thank you for all your work on this project!

I'm having trouble getting my SK6812W strip working properly with my Pi3B. The strip is connected as described in the README, to GPIO18 with external power to the strip. When I run sudo ledcontrol --led_count 300 --led_pixel_order GRBW the strip lights up and the flask interface looks lovely... but the led outputs on the strip are seemingly random. "static color" shows up like this:

768-1024

Any pattern set in the UI will send changes to the LED strip, but not in any recognizable pattern on the actual light strip. It is as if I am sending commands, but in the wrong protocol.

How can I debug this further?

jackw01 commented 2 years ago

This is either a power supply issue, issue with the connection between the LEDs and the Raspberry Pi, bad LEDs, or an issue with the DMA configuration on the Pi.

ohthehugemanatee commented 2 years ago

Thank you! This is exactly the kind of helpful and informative response I was hoping for! I'm traveling on vacation this week, so I brought the pi and a 1m strip with me to continue poking at this.

Brief answers:

There's lots of great ideas in the jgarff repo you linked. I will try those too, and report back here.

One question though: is 5v really necessary for the data line, too? I see some resources saying the 3.3V from GPIO18 should be enough, and others saying you need a level shifter up to 5V. what gives?

jackw01 commented 2 years ago

I would definitely try powering everything through a single USB port (with the LEDs at low brightness, of course). IIRC, some older or low quality ATX power supplies cannot properly regulate their outputs without a fairly significant load and may sporadically shutdown and restart. If it's relatively new and high quality (well-known brand, 80+ rated, and UL/ETL listed) this shouldn't be a problem but any power supply issues can be eliminated by using a known stable power source like a 2+ amp USB charger.

If some of the LEDs do occasionally display the right colors, this can be a symptom of a loose/intermittent connection in the data line. Try bending/jiggling the wires, connectors, and even the LED strip itself and see if it affects anything. I have personally experienced this when using a real JST connector to connect with the off-brand one on an LED strip (the connector housings fit together properly but the pins didn't make good contact until I bent them a little bit).

From my experience, 5V is not necessary on the data line unless you are driving the LEDs through a very long wire. Older WS2811 or WS2812 LEDs may have required 5 volts but I have used many WS2812B and SK6812 LED strips from various sources with 3.3V with no issues.

ohthehugemanatee commented 2 years ago

W00t! It's working now at least in a limited setup. Here's what I did, for posterity:

I was using a new ATX power supply, so my present theory is that it was something else competing for the GPIO18 pin. When I get back from holiday I'll try again with a full length strip and a "proper" 5v 60A power unit. (that's 8A per 60 pixel meter, should power a couple of 3-4m strips)

Closing this ticket now. Thank you again for your help, I hope this thread helps some future users. Now it's on to actually writing a few patterns...

jackw01 commented 2 years ago

Tip: With a 60 amp power supply, a short circuit somewhere along the LED strip would likely not draw enough current to trip your power supply's over-current protection due to the resistance of the flexible PCB. This would be a pretty huge fire hazard if it ever happened, so I would recommend connecting sections of the strip that draw no more than ~10A to the power supply through their own independent wires with fuses or circuit breakers in series if you ever plan on running it unsupervised.

Going to add this to the readme too.