1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Other Problems with pi and ws2812

Discussion in 'LED Devices Support' started by Nick, 18 February 2017.

  1. Nick

    Nick New Member

    Messages:
    4
    Hardware:
    RPi1/Zero, RPi2, RPi3
    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
     
  2. penfold42

    penfold42 Moderator Developer

    Messages:
    430
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Do you have hdmi plugged in ?

    The onboard analog uses PWM and will conflict with this driver.

    Have you tried using SPI instead of pwm ?
     
  3. Nick

    Nick New Member

    Messages:
    4
    Hardware:
    RPi1/Zero, RPi2, RPi3
    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
     
  4. TPmodding

    TPmodding Administrator Staff Member Administrator

    Messages:
    611
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino
  5. Nick

    Nick New Member

    Messages:
    4
    Hardware:
    RPi1/Zero, RPi2, RPi3
    Yep, I tried the 3-wire PWM approach first
     
  6. penfold42

    penfold42 Moderator Developer

    Messages:
    430
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    The jazzycamel stuff looks like it to uses the same pwm approach rather than spi.

    Can you try useing the Hyperion ws2812-spi driver ?
    This uses the MOSI pin rather than gpio 18
     
  7. Nick

    Nick New Member

    Messages:
    4
    Hardware:
    RPi1/Zero, RPi2, RPi3
    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?
     
  8. Akriss

    Akriss New Member

    Messages:
    18
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino