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

Finished Ws281x SPI connection device type

Discussion in 'Development' started by penfold42, 11 May 2016.

Tags:
Thread Status:
Not open for further replies.
  1. penfold42

    penfold42 Moderator Developer

    Messages:
    518
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    anyone interested in testing a direct SPI attached ws2812 driver ?

    Yes, you read that correctly - no pwm, no dongles, not microcontrollers.

    Just a pi and a wire from MOSI to the data in on the strip.
     
  2. Brindosch

    Brindosch Administrator Administrator

    Messages:
    607
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    No pwm? Really? Yeah remove the pwm code :D
    People complain to often with issues. For testing you may able to attach a hyperiond. I could test it with a small "21 LEDs ring" - ws2812 chips
    :)

    Great work!
     
  3. penfold42

    penfold42 Moderator Developer

    Messages:
    518
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
  4. penfold42

    penfold42 Moderator Developer

    Messages:
    518
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    I should add - the low level code has had a couple of hours testing, the Hyperion driver has had 5 mins of testing.

    RPi 3, OSMC current and a 60 led ring
    Lightly loaded system - haven't even tried playing a movie - just some effects
     
  5. penfold42

    penfold42 Moderator Developer

    Messages:
    518
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Just been playing despicable me for the last hour - so far so good !

    Some notes:
    1) you need to make sure the core frequency is consistent. That might mean playing with some over clock aettings.

    2) I don't know how it will behave with longer strips - I'm assuming the kernal driver is using DMA to ensure it all get sent in one hit.

    3) the SPI rate is critical. The default works for me but is 60% higher than I calculated it should be.
    If you use a value too low, the strip is white
    If too big, the strip is all back
     
  6. penfold42

    penfold42 Moderator Developer

    Messages:
    518
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    So after some more testing - it works great.

    My pi was undervolted so it was changing the core clock speed regardless of the config.txt settings.

    I've been testing with a 256 led matrix and it's perfect.
     
    • Like Like x 1
  7. Brindosch

    Brindosch Administrator Administrator

    Messages:
    607
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Sorry, had still no time!
    But if you keep the default settings the governor is still a problem?
    Great news so far :)
     
  8. penfold42

    penfold42 Moderator Developer

    Messages:
    518
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    I did some
    Basic testing on raspbian today - works fine for me. Same dependency on a fixed core_freq which means you need force_turbo=1

    So that's OSMC on a pi3 and raspbian on a pi2.

    Pull request time ?
     
  9. Brindosch

    Brindosch Administrator Administrator

    Messages:
    607
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    In case you get a voltage drop and pi lower the clock speed (should kick in? you could prevent it, yes), the leds will be black or white? For a short period or the whole time?
    Great so far!
     
  10. penfold42

    penfold42 Moderator Developer

    Messages:
    518
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    I've seen white which means the SPI clock is too slow.

    I think it all depends on the core frequency on startup - this is when the SPI divisor is calculated
     
  11. cbabbman

    cbabbman New Member

    Messages:
    12
    Hardware:
    RPi1/Zero, RPi2, RPi3
    Is this still available for testing? I am getting a 404 error when clicking the link
     
  12. Brindosch

    Brindosch Administrator Administrator

    Messages:
    607
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    • Like Like x 1
  13. René Arts

    René Arts New Member

    Messages:
    21
    Hardware:
    RPi2
  14. cbabbman

    cbabbman New Member

    Messages:
    12
    Hardware:
    RPi1/Zero, RPi2, RPi3
    I am embarrassed to even ask this question, but I have to...

    I have the beta version working on a RPI B+... still using the PWM as attempting to use the SPI had my LED's flashing well out of control......

    Unfortunately, I am completely unable to get anything working on my 2 RPI2's or my 3... Hyperion starts without errors but no output to my WS2812b LEDs... not at all sure why but I must be missing something in the config.txt or perhaps the STK1160 USB capture isn't working correctly, even though it will do a framegrab...

    Any thoughts on what I might be missing? It's all pretty standard...openelec V6.0.3, latest hyperion beta, etc..
     
  15. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    160
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    @cbabbman could you post your Hyperion config and config.txt to pastebin / gist so we can check a few things :) , sounds like hardware / wiring issue but best to rule out this first.
     
  16. cbabbman

    cbabbman New Member

    Messages:
    12
    Hardware:
    RPi1/Zero, RPi2, RPi3
    you bet..




    I have 2 RIP B+'s that this all works perfectly on... hopefully, I haven't missed something incredibly simple and stupid, but you never know..

    These are WS2812b led's (256 total) , the wiring is ground on pin 6, data on pin 12. I am running all of this off of a 20a power supply...

    if you need any other info, just let me know...
     
  17. penfold42

    penfold42 Moderator Developer

    Messages:
    518
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    There are now 3 ways to directly drive ws2812 strips from Hyperion
    - ws2812b - RPi 1 ONLY. Not pi2 nor pi3 (but maybe pi zero)
    - ws281x - should work on rpi 1,2,3 but is sensitive to the rpi firmware/OS and whether HDMI is plugged in. Eg OSMC needs an HDMI device attached at startup
    - my new SPI based 2812 driver - should work on any PI but you need a stable core_clock. Dynamic CPU will fiddle with this and under voltage also screw you over
     
  18. cbabbman

    cbabbman New Member

    Messages:
    12
    Hardware:
    RPi1/Zero, RPi2, RPi3
    This was the interesting part. On the pi2, with the 2nd option selected, fresh install of openelec, fresh install of Hyperion and my config, it all fired up without any issues. Once I rebooted, it never worked again. This was repeatable.

    I will try it again though cause I cannot confirm that I had hdmi plugged in on the reboot. It definitely was plugged in during the initial setup.
     
  19. Wolph

    Wolph New Member Developer

    Messages:
    16
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +PhilipsHue, +AtmoOrb, +nodeMCU/ESP8266
    I've just tested a bit and similar to cbabbman I had the flashing results. After rebooting it usually doesn't start flashing but after restarting hyperion it generally starts flashing again.

    When using many leds (over 300) it appears to be doing nothing but I haven't debugged that yet.
     
  20. penfold42

    penfold42 Moderator Developer

    Messages:
    518
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Thanks - can you upload your config.txt ?

    What values do you get from
    vcgencmd measure_clk core ?

    If you can run it while flashing and not that would be great
     
Thread Status:
Not open for further replies.