Posts by Da Flex

    I guess I found the port 80 error. It's inside "ledon.py". One line must be deleted, and it should look like this:

    Code
    import subprocess
    import time
     
    subprocess.call('/storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json </dev/null >/dev/null 2>&1 &', shell=True)
     
    time.sleep(2)
     
    subprocess.call('/storage/hyperion/bin/hyperion-remote.sh --priority 100 --duration 400 --effect "Rainbow Swirl"', shell=True,)

    Please edit the file, and try to run it again:

    Code
    python /storage/hyperion/scripts/ledon.py

    After that edit the "ledoff.py" to avoid the same port 80 error. It should look like this:

    Code
    import subprocess
     
    subprocess.call('killall hyperiond', shell=True)

    OK, maybe the Hyperion service is already running when you try to start it. In that case the port number is not available anymore.

    Please reboot (with Python script still commented out). Let's see if Hyperion already runs after start:

    Code
    ps -A | grep hyperion

    terminate called after throwing an instance of 'std::runtime_error'

    what(): JSONSERVER ERROR: could not bind to port

    LibreELEC:~ #

    Maybe because of this?

    Quote


    Tried editing script and changing port 22 instead of 80..

    Please set the port number back to the original value and comment the Python script out by adding # at that line:

    Bash
    #!/bin/sh
    (
    #    python /storage/hyperion/scripts/ledon.py
    ) &

    Then reboot, and try the command from my last post again. Don't be too quick.

    Excellent, that's it! :)

    If you only have a Win10 PC, you can edit the files by SSH login (use PuTTY).

    If you have a Linux PC, simply remove the MicroSD card, and plug it into the PC.

    Create the directory "/storage/hyperion/scripts" for the scripts.

    On SSH:

    Code
    mkdir /storage/hyperion
    mkdir /storage/hyperion/scripts

    Copy "ledon.py" and "ledoff.py" into that folder.


    Insert this code into autostart.sh, if you want to start Hyperion by default:

    Bash
    #!/bin/sh
    
    (
        python /storage/hyperion/scripts/ledon.py
    ) &

    Copy "remote.xml" into the "/storage/.kodi/userdata/keymaps" folder, if you want to switch it on and off by red and green remote buttons.

    Tell us, if it works!

    Is "hyperion creator" part of an add-on? If yes, is it an official add-on from the LibreELEC repository? What's the name of the add-on?

    PS: I'm asking because there are two ways to install Hyperion: By using HyperCon (Win10) installer, or by using a LibreELEC add-on.

    The autostart.sh calls a Python script. The Python script will set electrical levels to specific GPIO pins. A device, connected to GPIO (Hyperion), will listen to those level changes at GPIO. That's usually the way to start or reset connected RasPi hardware.

    When I have some time, I will have a look at the Hyperion project.

    I can help you to adapt the scripts, but I need the necessary infos for Hyperion GPIO events.

    English is not my mother language. "Outage" means an electrical accident, and no power for a short time, right?

    After that outage, the RasPi and LibreELEC will start. You can trigger the fitting GPIO signals by using autostart. In the Python script (see link above), you can learn how to set GPIO levels. I don't know the right pins / signals to start Hyperion. That's not part of LibreELEC. Can you do a research for this?

    I could handle cutting off the power with smart plug or whatever, but I found out that if I cut power (I am powering Rpi through Leds via Gpio), hyperion does not start automatically when I power on again. Leds remain off.

    I wouldn't do that. It's better not to cut the power for the RasPi. Use a RasPi power button instead. That should keep Hyperion in a defined state, and should power it on with the RasPi when the power button is pressed. You can use PuTTY on Win10 to add the necessary scripts to RasPi.

    For the installation of the button, you may have some space between the RasPi Ethernet port and the upper part of the RasPi case. If you have enough space there, you can just lay the button on the Ethernet port without mounting it permanently. Then you just have to drill a hole over the Ethernet port, insert the button and close the case to fix it.

    Here is the button that I use: 10x tact push buttons. With some cables and basic soldering skills everybody can do it.

    I still don't understand your setup, especially "I am powering Rpi through Leds via Gpio".

    Generally, you can have an on/off button on the RPi, you can autostart scripts when LibreELEC starts, and you can trigger scripts by GPIO events. Does any of those options solve the problem?

    Marry Christmas, robmcc83!

    It's definitely possible to make your case work with LE. I did an on/off button (see here) and a status LED (see here).

    You just have to adapt the pin numbering for your needs. Take care about the difference of GPIO and pin numbering system.

    Adding a reset function to the Python script should be no problem, too (use the "reboot" command).

    Da Flex