0

is there a limit on the neopixel library for Pi?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

is there a limit on the neopixel library for Pi?

by jimxbob on Tue Jun 08, 2021 9:40 am

Hi,

I'm using the Neopixel library for the Pi and it's great!
I've hit an issue though.... I'm still installing the strips and testing them with simple code taken from the excellent Adafruit tutorial:
https://learn.adafruit.com/neopixels-on ... thon-usage
https://github.com/adafruit/Adafruit_Ci ... pletest.py
and cut down & simplified.
When I set num_pixels to 2699 it works fine.
When I set it to 2700 it behaves as if I'd set it much lower.
Have I hit some sort of limit within the library?
reading this:
https://learn.adafruit.com/adafruit-neopixel-uberguide
Suggests 3 concerns for a limit:
frame rate - I'm not worried by this - I'm not trying to create fast effects.
power - I have a huge PSU, am providing power every 2.5m (60 LEDS/m) minimum, and I'm running them well under full brightness.
memory - this is my worry - I started out on an arduino, and was def. memory constrained - I thought on the Pi that that shouldn't be an issue though.

Has anyone else found this issue? is there a workaround? I have around 3500 pixels in my installation.
I could split the setup in two, and drive it from two Pis - they don't cost much, but then I've got to come up with a way of making one Pi slave to the other one & communicate....

Thanks!

James

jimxbob
 
Posts: 3
Joined: Tue Jun 08, 2021 9:07 am

Re: is there a limit on the neopixel library for Pi?

by blnkjns on Wed Jun 09, 2021 12:03 am

I think FastLED is one of the best solutions for many NeoPixels.
https://github.com/FastLED/FastLED
It can drive 8 strains in parallel on the M4 (Atsamd51 like in Itsy Bitst M4, Teensy 3.2).

blnkjns
 
Posts: 663
Joined: Fri Oct 02, 2020 3:33 am

Re: is there a limit on the neopixel library for Pi?

by jimxbob on Wed Jun 09, 2021 3:57 am

Thanks - I might have to go that way... I do have multiple intermediate points that I could use to split the long line in to individual "strands".
However I'd like to understand if there is a fundamental issue I'm hitting running on a Pi Zero, as I've got the code written for that (including a web server for controlling the lights) and it all wired up!
If I had to port, would I be able to use that library from CircuitPython? (I'm not a very experienced coder - sorry!)

jimxbob
 
Posts: 3
Joined: Tue Jun 08, 2021 9:07 am

Re: is there a limit on the neopixel library for Pi?

by blnkjns on Wed Jun 09, 2021 7:10 am

I think FastLED is a C++ thing, but you could use the M4 board with your Raspberry Pi. No idea how complex the stream of data to the pixels is. If the pixels are like 3500 colours all different and changing 30 times a second it demands more from the Pi->M4 connection than if it is a glowing effect with some colour points and fluent transitions in between.
No idea where the limit comes from. Storing the data should be no issue at all. Must be some limit in the driver, maybe it can be tweaked.

blnkjns
 
Posts: 663
Joined: Fri Oct 02, 2020 3:33 am

Re: is there a limit on the neopixel library for Pi?

by jimxbob on Sat Jun 12, 2021 6:35 pm

I thought I'd post an update here as I've got a solution thanks to some help from a reddit user.
There does seem to be a limit around 2700 - if you're using GPIO18.
If you move to GPIO21 then there's still a limit, but it's around 5400 apparently, which is enough for me.
Frame rates clearly suffer at these sizes, but that isn't an issue for my application - I've pushed up to around 3,500 OK.

It is exposing the next issue - which I think is unrelated - I have some big gaps between strands, and I'm getting corrupted data between sections - I'm not getting voltage drop, this is corruption on the data line where I'm running it 2 or 3m from one part of a bookcase to another. I've put a resistor at the start of each section to reduce reflection, and upped that to 2.5kohms as that seems to help, but I'm still getting intermittent green pixels. I've added pixels in the middle of the data lines to act as a kind of repeater, and again, that helps extend the length, but I'm still hitting issues... More investigation is needed, and probably another post......

jimxbob
 
Posts: 3
Joined: Tue Jun 08, 2021 9:07 am

Please be positive and constructive with your questions and comments.