SPI first LED is green

  • so I used 74HCT and this https://hyperion-project.org/wiki/Supported-hardware wiring scheme. I connected just mosi line (not clk) but result is the same.


    P.S. No Idea why all LEDs flashing crazy when I turn on power source (even when Pi is booting). So I wait for a while until it stopped and then I tried all scenarios with +6,+3,0,3. Only scenario with +6 and 3 worked (as mentioned above). So I don't think it is a question of level shifter.


    btw, can be used these values (uint8_t tx[num_leds*3*4+6]; unsigned spi_ptr=3) for a long time period without problems?

  • Damn !


    So you have a separate 5v PSU for the leds ?


    A good ground connection between
    - the Pi,
    - the 74hct00
    - The led strip
    - The led power supply


    Is the 74hct00 powered by the pi or the led power supply ?


    Can you tell I'm running out of ideas ?


    I'm beginning to wonder if the 1st led is faulty ?


    I wish I could drop by with oscilloscope and see what's happening on the pins !

  • So you have a separate 5v PSU for the leds ? I tried both cases with separate PSU and with one common PSU. (changed nothing)


    A good ground connection between - yes, I rechecked and added two additional wires for ground to cover it twice. (changed nothing)


    Is the 74hct00 powered by the pi or the led power supply ? I tried both ways. (changed nothing)


    I'm beginning to wonder if the 1st led is faulty ? I have more strips and tried with each. (changed nothing) So I think first LED is not faulty.


    I really appreciate your huge effort to help. Thanks again mate!



    P.S. on RPi first led is off - this is interesting, too. So maybe a software issue (?). Btw when uint8_t tx[num_leds*3*4+6]; and unsigned spi_ptr=3 work together, can I use change it somewhere in hyperion files and recompile it with these values? (and can they be used for normal long using of hyperion?)

  • I think have it in both (classic original and fantastic new ng) would be great. But I don't want to bother you, so if you just tell me which file to edit in original version, I do it in my downloaded original version by myself.
    thanks many times again

  • Assuming you've cloned the hyperion
    hyperion/libsrc/leddevice/LedDeviceWs2812SPI.cpp


    Line 37: unsigned spi_size = mLedCount * SPI_BYTES_PER_LED + 3;
    Change 3 to 6
    Line 42: unsigned spi_ptr = 0;
    Change 0 to 3


    Thats it .... you'll notice the code is very similar!


    I do have another theory tho..... maybe your leds arent actually ws2812 but one of the many clones around.
    The timing I have for the reset pulse is actually waaaay out of spec, but has worked find for ws2812 and sk6812 leds.
    The alternate fix for this to simply extend the reset pulse is:
    Line 37: unsigned spi_size = mLedCount * SPI_BYTES_PER_LED + 3;
    Change 3 to 80 (yes.... eighty)

  • same issue here with anything ive tried, than its an OPI issue,
    @peter what OPI do you have?, mines an Orange Pi Plus v1.1 on Armbian 5.25 Server
    ill be trying this code edit out on the shiny new hyperion-ng and will report back!


    Edit : code is fairly different, not exactly into C++ so much; which one should i modify?


    in the meantime ill try compiling without edits


    Edit 2: Compiling Hyperion-ng, had to modify CMakeLists.txt because it was detecting the OPI as a Raspberry Pi due that the CPU check is not by model but by architecture.
    Modified Lines 73 to 75

    Code
    elseif ( "${PLATFORM}" STREQUAL "rpi" )
        SET ( DEFAULT_DISPMANX   OFF )
        SET ( DEFAULT_WS281XPWM  OFF )


    Edit 3 4:


    compiling right now


    Edit 5 : Compile done, will test in about an hour

  • Edit: changed video links to webm


    sorry to rewake an old thread but i didnt want to start another one


    so i tried connecting everything with the SPI with a 74HCT125, ive tried doing the edits on the orangepi and did not have a green led, then i upgraded the orangepi to a devport kernel 4.10 due that video0 was not found on the old 3.4.113 kernel
    now i have some glitches, which i suppose are either from timing, the first led gone bust or i have a clone of the ws2812b
    I have tried editing /libsrc/LedDevices/LedDeviceWS2812SPI.cpp variable SPI_FRAME_END_LATCH_BYTES with 6 and 80 and unsigned_ptr to 3. In all cases i fixed the first green led, but not this (webmshare).


    With the Raspberry Pi 3 and no edits to the , i get something completely different. it works except for this random white flashing, on Dispmanx Grabber , it stays white longer , maybes because theres more white on the first few leds due to the top bar in linux desktop (?)


    So close to fix but i always seem to find something in the way


Jetzt mitmachen!

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