Problems with pi and ws2812

  • Hi all,


    Sorry for the vague title, but I'm not really sure what to call the problem.


    First the setup:
    - pi2
    - ws2812b LED Strip
    - Adafruit 74AHCT125 Level Shifter
    - 5v 10A power supply


    I first tried testing the LEDs using this python wrapper of a C driver as Adafruit suggest: https://github.com/jgarff/rpi_ws281x
    I am able to get the LEDs to work fine with this library - with strandtest.py for example, but I can do this only once. If I run the script again, or any others the strip does not change. I get no errors or anything. It just maintains it's previous state and I have to reboot to get it to work again.


    This problem in itself I'm not massively bothered about, but the strip also does not work with Hyperion. I've tried using the HyperCon colorpicker to set a color, and the strip just flashes seemingly randomly. It does have more of the color I select than anything else, but it flickers with other colors (mainly white) almost like there's interference going on. But as this does not happen with the Adafruit python library, I can't see how it could be hardware interference.


    I don't really know how to track this problem down any further. Does anyone have any ideas what could be going on, or what else I could try?


    Thanks,
    Nick

  • Hi,


    I've now tried SPI as well on both a pi2 B and a pi zero. I have got the strip working using SPI and this library https://github.com/jazzycamel/ws28128-rpi, so I know that hardware and wiring wise the strip now works. I'm still having no luck with Hyperion though. The LEDs do now light up when I use "Set Led Color" in hypercon, but if I keep pressing "Set Led Color" (without touching the color wheel) the color randomly changes each time I click.


    It's very odd. I'm stumped. Anyone got any tips on how I could debug this further? Some debug info out of hyperiond might be useful, but I can't see any options for debugging, and the standard level of output doesn't show much.


    Thanks

  • Update:


    I decided to start from scratch as all the different testing libraries was getting confusing. I flashed a fresh copy of raspbian jessie lite to a rpi3. Then all I did was enable spi, and join my wifi. I then connected 5v vcc from the led supply to pin 2, GND to pin 6, and data to pin 19


    I then used Hypercon on my desktop using the following steps:
    - Connected to the pi in the SSH tab
    - Installed Hyperion
    - In the Hardware tab I selected WS281X-SPI as the type
    - Created the hyperion config and saved to desktop
    - On SSH tab, Selected Load Config Path and set to desktop, then Sent the config
    - Stopped and Started Hyperion in the SSH tab to load new config - all looks well in the log
    - Selected a color in the color wheel and clicked "Set Led Color" annnnnd... nothing happens


    The pi has the spi device:
    pi@raspberrypi:/etc/hyperion $ ls /dev/spidev0.*
    /dev/spidev0.0 /dev/spidev0.1


    I'm stumped. Ir feels like I'm doing something stupid somewhere, but I can't see it.


    In desperation I took an oscilloscope to the MOSI pin on the pi and I get nothing. I've got a level shifter in the mix too of course, but that's down the line, and if there is no signal on the the SPI pin, then the problem seems to be on the pi itself.


    Anyone have any pointers where I'm going wrong?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!