0

Raspberry Pi Zero W locking up with >100 WS2812Bs
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Raspberry Pi Zero W locking up with >100 WS2812Bs

by w15p on Sun Dec 16, 2018 6:55 pm

Hello,
I'm working with a Zero W that I purchased here about a year ago running an adafruit SD card with Jessie. It's powered with a MeanWell HLG-320H-24A (24V, 320W) power supply that is stepped down to 5V with an adjustable buck transformer (it should have plenty of power...)

I've set it up with the tutorial here: https://learn.adafruit.com/neopixels-on ... i/overview (both with and without the 74AHCT125). It worked swimmingly with up to around 100 LEDs (including running for over a day without problem) but if I push it above 100 leds (project goal is 1200) it will die, usually pretty quickly but dependent on how many leds are in use.

Things that I have tried:
* overvoltage on the power supply (up to 5.25VDC)
* setting LEDs to desired state and exiting, eg :
Code: Select all | TOGGLE FULL SIZE
#!/usr/bin/env python3.4
# Simple test for NeoPixels on Raspberry Pi
import board
import neopixel

# Choose an open pin connected to the Data In of the NeoPixel strip, i.e. board.
D18
# NeoPixels must be connected to D10, D12, D18 or D21 to work.
pixel_pin = board.D18

# The number of NeoPixels
num_pixels = 600

# pixel brightness
brightness = 0.3

# The order of the pixel colors - RGB or GRB. Some NeoPixels have red and green
reversed!
# For RGBW NeoPixels, simply change the ORDER to RGBW or GRBW.
ORDER = neopixel.GRB

pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=brightness,
                           auto_write=False, pixel_order=ORDER)

green = 255
red = 0
blue = 0

for i in range(num_pixels):
    pixels[i] = (green, red, blue)
    swap = green
    green = red
    red = swap

pixels.show()

(when this dies, the script has not been running for some time and mem/cpu/disk usage (per htop) is all minimal)

I've had to hard power cycle many times because of this and at one point got a
ImportError: No module named board
...after running the same script many times and although this was probably just a disk error that I could have cleaned up another way, I recompiled and installed rpi_ws281x as detailed here: https://stackoverflow.com/questions/530 ... odule-name

I'm at a bit of a loss - I've tried tailing every system log I can think of in the hopes that I will catch an exception but nothing is reported out when the system freezes.

Is this a known limitation of rpi_ws281x?

Thanks in advance for any ideas.

w15p

w15p
 
Posts: 12
Joined: Thu Dec 23, 2010 11:51 am

Re: Raspberry Pi Zero W locking up with >100 WS2812Bs

by adafruit_support_mike on Mon Dec 17, 2018 1:15 am

What are the exact symptoms of "dies"?

Pixels stop updating but code keeps running, code stops running, core dump, kernel panic, hardware shutdown, falls over and catches fire, etc?

adafruit_support_mike
 
Posts: 58911
Joined: Thu Feb 11, 2010 2:51 pm

Re: Raspberry Pi Zero W locking up with >100 WS2812Bs

by w15p on Mon Dec 17, 2018 1:44 am

Hi Mike,
LEDs will often dim somewhat, sometimes flicker. System is headless and becomes unresponsive in ssh, board led sometimes goes off, sometimes flickers. Any running process (like htop or tail) visually freezes. Always requires power cycle to recover.

Possibly a grounding issue. I rechecked all connections and shrunk down to a single strand of 300. I’ve had alternating red & green leds toggling (same script as before in a while loop with a switch on red/green) running for an hour now. We’ll see if it makes it all night...

Thanks for the reply - not positive it was a wiring issue but I don’t have any better ideas right now.

-w15p

w15p
 
Posts: 12
Joined: Thu Dec 23, 2010 11:51 am

Re: Raspberry Pi Zero W locking up with >100 WS2812Bs

by w15p on Mon Dec 17, 2018 11:34 am

I think this is resolved. Again, likely a grounding issue but ?possibly? also related to the kernel sound modules. I followed the advice here (https://www.raspberrypi.org/forums/view ... 60#p995173) and created a blacklist conf file at the same time I was redoing the wiring (yes, I should only do one thing at a time... however, working is working)

I ran it up to 900 LEDs this morning and observed the power-starving effects of not having power injected, but that was the only issue - the logic signal and system behavior was normal. Continuing to run it at 600 with no problem and will work on the final wiring harness tonight.

Thanks!

w15p

w15p
 
Posts: 12
Joined: Thu Dec 23, 2010 11:51 am

Re: Raspberry Pi Zero W locking up with >100 WS2812Bs

by adafruit_support_mike on Tue Dec 18, 2018 2:14 am

Those symptoms sound like power starvation.

Try powering the RasPi from a 5V supply independent of the WS2812 supply. Even if the MeanWell supply is beefy, the LED current will still procuce voltage drops along the DC resistance of the wire.

If that smooths things out, try moving the RasPi's power back to the MeanWell supply, but with its own run of wire independent of the power going to the WS2812s. Add a few thousand microfarads of capacitance right next to the RasPi to smooth out any voltage spikes that do make it past the supply.

adafruit_support_mike
 
Posts: 58911
Joined: Thu Feb 11, 2010 2:51 pm

Re: Raspberry Pi Zero W locking up with >100 WS2812Bs

by w15p on Tue Dec 18, 2018 1:30 pm

I think you are exactly correct. I added separate 5V buck converters for the LED strand (injecting power at both ends of 5m strand) and gave the raspberry pi its own. I can now run full power bright white (my eyes!) and the Raspberry pi is totally stable. Interestingly, a 5m strand stills dims in the middle of the strand, but I don't feel like ripping it open to inject more power in - in normal (non-max) usage it is imperceptible.

Thanks again,
w15p

w15p
 
Posts: 12
Joined: Thu Dec 23, 2010 11:51 am

Re: Raspberry Pi Zero W locking up with >100 WS2812Bs

by adafruit_support_mike on Wed Dec 19, 2018 1:02 am

Each pixel along a strip shunts some current from the 5V rail to GND, producing a small voltage drop. After 20 or 30 such drops, the 5V rail's actual voltage is low enough to start interfering with the LEDs. The blue/white ones lose headroom first, then the green. We call it 'red shift'.

We suggest putting a power tap every 30 pixels or so. That puts each pixel close enough to a power tap that the line losses don't cause trouble.

adafruit_support_mike
 
Posts: 58911
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.