Git Product home page Git Product logo

Comments (9)

makermelissa avatar makermelissa commented on July 24, 2024 1

Ok after trying a number of different strategies, I'm concluding that it really isn't possible. Here's some background of what I tried:
I was running into issues with NeoPixels on 2 different pins responding to the same changes. This is because there are 2 PWM channels on the Raspberry Pi that share a number of pins and both of the ones I was using are on PWM0.

The specific parameter options for this dtoverlay can be found with the following command:

dtoverlay -h pwm-2chan

So I enabled the second PWM channel using the pwm-2chan dtoverlay by adding the following line to my /boot/config.txt

dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4

The pin functionality can be found on page 102 of the data sheet at https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/BCM2835-ARM-Peripherals.pdf.

I confirmed they were set in PWM output with the following command:

raspi-gpio get 12,13

and got the following output:

GPIO 12: level=0 fsel=4 alt=0 func=PWM0_0 pull=DOWN
GPIO 13: level=0 fsel=4 alt=0 func=PWM0_1 pull=DOWN

I ran my test script and got the following error:

RuntimeError: ws2811_init failed with code -11 (Selected GPIO not possible)
Segmentation fault

I did notice that after running the script, the raspi-gpio command now outputs the following:

GPIO 12: level=0 fsel=4 alt=0 func=PWM0_0 pull=NONE
GPIO 13: level=0 fsel=1 func=OUTPUT pull=NONE

This tells me that the rpi_ws281x library is handling changing the pin muxing already and the dtoverlay was probably not necessary. However, it just refuses to cooperate and the issue lies outside of Blinka. Also, the benefit of 1 additional strand is probably not worth it since strands can be chained together already, so I'm going to close this issue.

from adafruit_blinka.

ladyada avatar ladyada commented on July 24, 2024

hmm haven't tried it, can you use two neopixel strips with https://github.com/jgarff/rpi_ws281x ? that's what we're basing off of

from adafruit_blinka.

glenneroo avatar glenneroo commented on July 24, 2024

I can run the "test" program in 2 terminals:
sudo ./test -s grb -g 18 -c
sudo ./test -s grb -g 21 -c

And they both run, albeit the strips running off of GPIO21 seem to act a bit weird (regardless if running simultaneously or not).

from adafruit_blinka.

ladyada avatar ladyada commented on July 24, 2024

ok i thought it was just one at a time, well, we dont have support yet here is all

from adafruit_blinka.

georgebohnisch avatar georgebohnisch commented on July 24, 2024

Would also love to see support for multiple strips at once.

from adafruit_blinka.

tomkeuper avatar tomkeuper commented on July 24, 2024

I currently use neopixel with python 2.7 and it works with more than 1 strip. But I wanted to use asyncio and I need to upgrade to 3.5+ for that.

from adafruit_blinka.

makermelissa avatar makermelissa commented on July 24, 2024

I've been playing with this and I think it is possible with a workaround and a bit of a rewrite. There's a couple of possible strategies. While the _rpi_ws281x module only natively supports one strip, I'm not sure if that's 1 strip per instance or shared.

One strategy is to initialize a separate instance per GPIO (if it supports multiple instances) and switch between them based on the GPIO passed in. The other strategy is to have a single instance and have it reinitialize and switch every time the gpio changes.

from adafruit_blinka.

makermelissa avatar makermelissa commented on July 24, 2024

Ok, I just came across this: https://github.com/rpi-ws281x/rpi-ws281x-python/blob/master/examples/multistrandtest.py. It looks like it may now support multiple strips.

from adafruit_blinka.

makermelissa avatar makermelissa commented on July 24, 2024

There seems to be a pretty big bug with the rpi_ws281x library that will write the data to both GPIOs once they have been initialized as separate strips. This happened when using multiple instances and adapting the multistrand example above. I think strategy 2 (reinitializing between each write) might be the way to go.

from adafruit_blinka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.