Ws281x SPI connection device type

  • I've been fiddling around with the config quite a bit and I'm currently trying this device but it appears to be doing nothing at all. I should note that I'm running a Pi-1B here.


    Code
    "device" :
        {
            "name"       : "MyHyperionConfig",
            "type"       : "ws2812spi",
            "colorOrder" : "grb",
            "output"     : "/dev/spidev0.0",
            "rate"       : 3800000
        },


    The output when hyperion is and isn't running is currently:

    Code
    # vcgencmd measure_clock core
    frequency(1)=250000000


    I'm unable to produce any output using SPI at the moment. To be sure the led strip is functioning correctly I have tried the strip on pin 18 using this device which works:

    Code
    {
         "name"       : "MyHyperionConfig",
         "type"       : "ws2812spi",
         "colorOrder" : "grb"
     },
  • Interesting - I've never test on openelec.


    I think one of my Pi's has it setup to multi boot so I'll try to replicate it next week.


    Does configuring fewer LEDs work better ? Maybe the OE kernel has SPI issues with more LEDs.


    I am abusing the SPI device a bit - there's an assumption the kernel will use DMA and send all the led data in one continuous burst

  • Interesting - I've never test on openelec.

    I'm actually running Raspbian 8 (Jessie). A stock install specifically for Hyperion a few weeks ago so it shouldn't contain anything out of the ordinary..


    Zitat

    Does configuring fewer LEDs work better ? Maybe the OE kernel has SPI issues with more LEDs.


    I am abusing the SPI device a bit - there's an assumption the kernel will use DMA and send all the led data in one continuous burst

    Just for completeness I've tried with 32 leds and I'm not able to get it to do anything anymore unfortunately.


    Could it be that I need a level shifter for it to work through the MOSI pin?

  • It's difficult to troubleshoot without as oscilloscope - the kernel SPI driver does the heavy lifting and as long as I set the speed right and frame the data right it should just work.


    From memory setting the speed too low would give me white and too high would give me black. I never had a random 1st led.


    Are you sure you're on the right pin for SPI MOSI ?

  • Just got mine working.


    Fresh raspbian install,
    git clone from Hyperion.ng
    compiled on the pi1 (I forgot how slow they are!)


    i have a 60 led ring attached an the default config with only 46 leds defined.
    Heres my device section of the config.
    "device" :
    {
    "name" : "MyHyperionConfig",
    "type" : "ws2812spi",
    "output" : "/dev/spidev0.0",
    // "rate" : 1000000,
    "colorOrder" : "grb"
    },


    What do you get on the console from hyperiond /etc/hyperion/hyperion.config.json ?
    (well, with _your_ config patch)


    As for the wiring, the Pi and my led strip are powered by the same 50A 5V supply so I only need a single wire from MOSI to the led strip input signal

  • I think I may have simply fried something on this Pi along the way. It's an old one anyhow so I've ordered a new pi to test.


  • Ah, thanks :) These are my first ventures with Pi GPIO... so far I've only used arduino's and custom eeproms to control electronics so it's a bit of a slow start.


    Anyway... I've tried the loopback test and it indeed confirms that the Pi is at least partially dead. No useful output whatsoever from the SPI device.

  • I have everything set up on a Pi2 now and it appears to be working :)


    The only problem I have right now is that it appears to be limited to 341 leds. Since leds * colours per led * spi bytes per colour = 341 * 3 * 4 = 4092 I'm guessing there is some 4k limit somewhere in the SPI code but I haven't been able to find it yet.


    Do you have any idea @penfold42 ?

  • Not sure if this kernel has the DMA driver by default but I'm running this one: Linux raspberrypi 4.4.19-v7+ #906 SMP Tue Aug 23 15:53:06 BST 2016 armv7l GNU/Linux


    Seems pretty recent :)

Jetzt mitmachen!

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