rpi-ws281x / rpi-ws281x-python

Python library wrapping for the rpi-ws281x library
BSD 2-Clause "Simplified" License
326 stars 103 forks source link

Entire strip lights up weirdly when using SPI / GPIO 10 #83

Closed ningelschlingel closed 1 year ago

ningelschlingel commented 2 years ago

I used this package with PWM on GPIO 18 during the development. In production I need it to run without root permission, which is why I switched over to SPI on GPIO 10.

Now I get this weird behaviour where suddenly the entire led strip lights up but in kind of a gradient:

enter image description here

The strip is connected to GND, 5V, and GPIO10 / MOSI / Pin 19.

Example usage of the Strip:

#strip = Adafruit_NeoPixel(led_count, led_pin, led_freq_hz, led_dma, led_invert, led_brightness, led_channel)
strip = Adafruit_NeoPixel(110, 10, 800000, 10, False, 255, 0)
# PWM would have GPIO 18 as led_pin
# strip = Adafruit_NeoPixel(110, 18, 800000, 10, False, 255, 0)
strip.begin()
strip.setPixelColor(0, Color(255, 255, 255))
strip.show()

I also implemented a draw-like mode where I can set the color for every specific led. Around every other color-setting-request this error occurs. I also set the entire strip on the same color to check if lies within the power supply, but if the error does not occur the entire strip lights up as it should.

I didn't find a documentation on how to use this library with SPI and what the differences in usage are compared to PWM.

Gadgetoid commented 1 year ago

This library has not provided the Adafruit_NeoPixel class for quite some time (since Aug 2018).

Either way issues with SPI and other underlying plumbing is outside the scope of these bindings, you'd need to ask here: https://github.com/jgarff/rpi_ws281x

(SPI seems to have a lot of bugs and there's nothing I can do to fix those)