[Guide] Install latest alpha as a service

  • Since there is no English tutorial yet, and I've struggled quite a bit today, I decided to make a guide on how to install the latest alpha4 hyperion on your Raspberry pi 2 and run it as a service.


    Enable SSH on your raspberry pi through the user interface


    Use your favourite SSH client to log in to your raspberry pi (default username is root, default password is libreelec)


    Navigate to /storage/downloads:

    Code
    cd /storage/downloads


    If the folder doesn't exist, create it:

    Code
    cd /storage
    mkdir downloads
    cd downloads


    Download the latest alpha version of hyperion:

    Code
    wget https://github.com/hyperion-project/hyperion.ng/releases/download/2.0.0-alpha.4/Hyperion-2.0.0-alpha.4-Linux-armv7hf-rpi.sh


    Wait for the download to complete. Then make it executable and execute the script:

    Code
    chmod +x Hyperion-2.0.0-alpha.4-Linux-armv7hf-rpi.sh
    ./Hyperion-2.0.0-alpha.4-Linux-armv7hf-rpi.sh


    [INDENT][/INDENT]


    Wait for the installation to complete and if needed, say Y to everything.


    Now you can in principle already start hyperion simply by navigating to the directory and running hyperiond:

    Code
    cd /storage/downloads/Hyperion-2.0.0-alpha.4-Linux-armv7hf/bin
    ./hyperiond



    However, we are going to set up hyperion as a service, and create an additional log file to send the hyperion output to. This makes it easier for debugging.


    First we are going to create a script that will run hyperion, and output the so-called stdout to a logfile, with a timestamp prepended to it. Make sure you are in the right directory, and then create a file called start_hyperion_as_service.sh

    Code
    cd /storage/downloads/Hyperion-2.0.0-alpha.4-Linux-armv7hf/bin/
    nano start_hyperion_as_service.sh


    This will open a text editor. Paste the text below, and exit by pressing :x. When asked to save the modified buffer, press Y and enter.

    Bash
    #!/bin/bash
    /storage/downloads/Hyperion-2.0.0-alpha.4-Linux-armv7hf/bin/hyperiond --userdata /storage/.hyperion | /usr/bin/awk '{ print strftime("%c: "), $0; fflush(); }' | /usr/bin/tee -a /storage/logfiles/hyperion-ng-service.log


    Make sure the file is executable:

    Code
    chmod +x start_hyperion_as_service.sh


    Now that we have the start script, we are going to create the service. First navigate to the system.d directory and create a service file there:

    Code
    cd /storage/.config/system.d
    nano hyperion-ng.service


    In the text editor, paste the content below, and then close the text editor by pressing :x, saving the modified buffer.

    Code
    [Unit]Description=Hyperion ambient light systemd service for userAfter=network.target[Service]ExecStart= /bin/bash /storage/downloads/Hyperion-2.0.0-alpha.4-Linux-armv7hf/bin/start_hyperion_as_service.sh#WorkingDirectory=/storage/downloads/Hyperion-2.0.0-alpha.4-Linux-armv7hf/share/hyperion/binTimeoutStopSec=5KillMode=mixedRestart=on-failureRestartSec=5[Install]WantedBy=multi-user.target



    Before we can run the service, we need to reload systemctl:

    Code
    systemctl daemon-reload


    Then we can finally test the service:

    Code
    systemctl start hyperion-ng.service


    To test if we are successful, type:

    Code
    systemctl status hyperion-ng.service


    And you should see a hyperiond logfile. You should also be able to navigate to libreelec:8090 and see the hyperion.ng interface.


    Now we want to start hyperion on boot, so we type:

    Code
    systemctl enable hyperion-ng.service



    And we are done! If you don't care about logfiles, you can skip making start_hyperion_as_service.sh, and simply add /storage/downloads/Hyperion-2.0.0-alpha.4-Linux-armv7hf/bin/hyperiond --userdata /storage/.hyperion to hyperion-ng.service.

  • Excellent little guide, I meant to comment on this literally hours after you posted it but my account was too new to reply and this forum doesn't provide a clear way of knowing when a new account can post, unless I missed that?


    I followed your instructions and now have Hyperion running on a Raspberry Pi 4 v1.2 using WS2815 strips. I am grabbing the HDMI signal from my Onkyo TX-RZ3100 using the Zone 2 output.


    To use my RPI4 v1.2 with ws281x I had to update what Hyperion uses to include the latest version of this file: https://github.com/jgarff/rpi_ws281x/blob/master/rpihw.c


    Here is a video showing my results:

    Externer Inhalt www.youtube.com
    Inhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.
    Durch die Aktivierung der externen Inhalte erklären Sie sich damit einverstanden, dass personenbezogene Daten an Drittplattformen übermittelt werden. Mehr Informationen dazu haben wir in unserer Datenschutzerklärung zur Verfügung gestellt.

    I've since hidden my cables, I am using 3-conductor wire in the wall connected to a 3-pin DMX wall plate behind the TV and behind the entertainment center for easy connect/disconnect.

  • Greetings !


    Great tutorial! Clean and precise , hard to find. Have been thinking of switching but always unclear as to how.


    Is this the same procedure for Raspbian?
    I currently run Hyperion classic flawlessy. Reckon I should upgrade ?
    Should I do it on a different SD card just for safety ? Can I import my current configs ?


    Thanks a mil

Jetzt mitmachen!

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