WS2812B not working (RPi 3B+ + Hyperbian)

  • Hi all


    After a recent update of Hyperbian (reflash) causing an update from 2.0.0-alpha.9 to 2.0.0-alpha.10, my ambilights have stopped working.


    Did the whole setup following the manual of Hyperbian.

    Documented this process also here.


    Prior to the upgrade, everything worked fine.

    Afterwards, LEDs would stay off and after a few days some LEDs at the start of the strip would turn on and randomly change colour after a day or so.


    Re-flashed Hyperbian. No change.

    Removed Hyperion and installed 2.0.0-alpha.9, disabling hyperion@pi service and enabling hyperiond@pi. No change.


    Even RGB-test won't light up the strip.


    Checked if nothing changed in the wiring, but everything is still the same.

    WS2812B eco strip. About 4m of strip.

    5.1V power supply, power injected at start and end.

    RPi GPIO18 wired into the data line at the start of the strip.

    LED strip and RPi connected to the same PSU (spliced a microUSB cable for the RPi).


    I'm out of ideas at this moment.



    Tested the LED strip with an ESP32 and the code below and the strip works perfectly.

    So there's no doubt on the strip working just fine.


    Code: esp32-fastled.yaml
    light:
    - platform: fastled_clockless
      chipset: WS2812B
      pin: GPIO23
      num_leds: 180
      rgb_order: GRB
      name: "FastLED WS2811 Light"

    Einmal editiert, zuletzt von Sequr () aus folgendem Grund: Merged a post created by Sequr into this post.

  • Zur hilfreichsten Antwort springen
  • My apologies for the late reply.


    Hooked up a test-strip as I can't keep moving the television, risking the partner approval rating ...

    Installation is pretty similar. RPi and LED-strip connected to same PSU, RPi powered via spliced microUSB cable. Dupont cable from pin18 to data pin. It's just a bit shorter.


    Testing version 2.0.0-alpha.9. To do this I uninstalled hyperion, downloaded alpha.9 deb and installed this, as Hyperbian image automatically installs latest version (alpha.10).

    LED-controller config as in first post.

    Enabled Instance Capture as I currently don't have a capture card connected.

    Smoothing is on


    Logs on Log-level 'Warning' did not show anything.


    Changed Log-level to 'Debug' and disabled/re-enabled the Instance





    Einmal editiert, zuletzt von Sequr () aus folgendem Grund: Explained how I'm running alpha.9

    • Hilfreichste Antwort
    • Offizieller Beitrag

    Sequr See the error in the Log, you need to run hyperion as root for this type of device.
    Look in the forum for "mmap() failed"

    (ERROR) Device disabled, device 'ws281x' signals error: 'Failed to open. Error message: mmap() failed'

  • Thanks Lord-Grey

    Found the commands I need to run.


    However, wouldn't it make more sense to create a Hyperion user and grant is the necessary rights?

    A PR at the H*ian repo was denied as they don't want to run applications as root by default, which makes sense.

    Which rights does the user need to be able to use WS281x LEDs?


    Code
    pi@HyperBian:~ $ sudo systemctl disable --now hyperion@pi.service
    pi@HyperBian:~ $ sudo systemctl enable --now hyperion@root.service
    Created symlink /etc/systemd/system/multi-user.target.wants/hyperion@root.service → /etc/systemd/system/hyperion@.service.

    3 Mal editiert, zuletzt von Sequr () aus folgendem Grund: Found the trigger word ...

    • Offizieller Beitrag

    Which rights does the user need to be able to use WS281x LEDs?

    My understanding had been that you cannot easily assign a group or so, but happy to learn how a user can be given dedicated rights without opening up the whole system.

    Edit: Hyperion uses the following library https://github.com/jgarff/rpi_ws281x
    Maybe you start from there how to avoid running under root.

  • Depends on whether the authorisation model for the particular module/driver/... is assigned to a group.


    For example, the pi user is member of the following groups: pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi


    I don't know enough of Hyperion to know which modules are at the root cause of this issue nor enough about Linux/Raspbian to know how to fix it :(

    • Offizieller Beitrag

    see https://github.com/jgarff/rpi_ws281x/issues/396 and start from there.
    It has nothing to do with hyperion, but with the rpi_ws281x and PWM usage.

  • Will have a look at the rpi_ws281x repo.


    By the way, did you notice this disclaimer in the README?

    Zitat

    Important warning about DMA channels

    You must make sure that the DMA channel you choose to use for the LEDs is not already in use by the operating system.

    For example, using DMA channel 5 will cause filesystem corruption on the Raspberry Pi 3 Model B.

    The default DMA channel (10) should be safe for the Raspberry Pi 3 Model B, but this may change in future software releases.

    Looks like Hyperion uses DMA channel 5 by default?

    • Offizieller Beitrag

    Looks like Hyperion uses DMA channel 5 by default?

    Just check the definitions... Yes, you are right the current default is 5., but it can be changed manually.
    I do not have too much experience with this device myself.
    If the community says a default 10 will work out of the box, for most of the installations, I am happy to update the default....

  • I suppose it wouldn't be a bad idea to have a 'safe' default.

    Don't want to have people complaining Hyperion destroyed their SD-cards.


    I has been running great here for 4 months on a RPi 3B+ without wrecking the SD-card, but I'll change to channel 10 just to be on the safe side.

Jetzt mitmachen!

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