Switch hyperion on/off

  • Hm I get this

    LibreELEC:~ # find / -name "hyperion*" -print

    /storage/hyperion

    /storage/hyperion/config/hyperion.config.json.example

    /storage/hyperion/bin/hyperiond

    /storage/hyperion/bin/hyperion-v4l2

    /storage/hyperion/bin/hyperion-dispmanx

    /storage/hyperion/bin/hyperion-remote.sh

    /storage/hyperion/bin/hyperion-v4l2.sh

    /storage/hyperion/bin/hyperiond.sh

    /storage/hyperion/bin/hyperion-remote

    /storage/logfiles/hyperion.log

    /storage/.kodi/addons/plugin.program.hyperion.configurator/hyperion.config.json.temp

    /storage/.kodi/addons/service.hyperion/config/hyperion.config.json.sample

    /storage/.kodi/addons/service.hyperion/bin/hyperiond

    /storage/.kodi/addons/service.hyperion/bin/hyperion-v4l2

    /storage/.kodi/addons/service.hyperion/bin/hyperion-dispmanx

    /storage/.kodi/addons/service.hyperion/bin/hyperiond.start

    /storage/.kodi/addons/service.hyperion/bin/hyperion-remote

    /storage/.kodi/userdata/addon_data/service.hyperion/hyperion.config.json

    /storage/.config/hyperion.config.json

    LibreELEC:~ #

    I edited the syntax error, I corrected it. Now seems I get connection refused. See edited last post

    Thankss

  • Hmm I get this, do I miss some params?

    LibreELEC:~ # /storage/hyperion/bin/hyperiond.sh

    Hyperion Ambilight Deamon (643)

    Version : V1.03.4 (brindosch-c750c41/dc6a602-1522918225

    Build Time: Apr 5 2018 01:57:25

    ERROR: Missing required configuration file. Usage:

    hyperiond <options ...> [config.file ...]

    LibreELEC:~ #

  • And now try this please:

    Code
    /storage/.kodi/addons/service.hyperion/bin/hyperiond.start

    LibreELEC:~ # /storage/.kodi/addons/service.hyperion/bin/hyperiond.start

    LibreELEC:~ # Hyperion Ambilight Deamon (666)

    Version : 1c21232

    Build Time: Oct 12 2017 09:47:51

    INFO: Selected configuration file: /storage/.kodi/userdata/addon_data/service.hy perion/hyperion.config.json

    HYPERION INFO: ColorTransform 'default' => [0; 45]

    HYPERION INFO: ColorCorrection 'default' => [0; 45]

    HYPERION INFO: ColorAdjustment 'default' => [0; 45]

    LEDDEVICE INFO: configuration:

    {

    "colorOrder" : "rgb",

    "name" : "MyHyperionConfig",

    "output" : "/dev/null",

    "rate" : 1000000,

    "type" : "file"

    }

    INFO: Creating linear smoothing

    HYPERION (CS) INFO: Created linear-smoothing(interval_ms=50;settlingTime_ms=200; updateDelay=0

    EFFECTENGINE INFO: 27 effects loaded from directory /storage/.kodi/addons/servic e.hyperion/effects

    EFFECTENGINE INFO: Initializing Python interpreter

    INFO: Hyperion started and initialised

    INFO: Boot sequence 'Rainbow swirl fast' EFFECTENGINE INFO: run effect Rainbow s wirl fast on channel 0

    BLACKBORDER INFO: threshold set to 0 (0)

    BLACKBORDER INFO: mode:default

    started

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

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

    LibreELEC:~ #

  • 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.

  • OK, I set back port to 80, edit autostart.sh by adding # and reboot

    After reboot I tried /storage/.kodi/addons/service.hyperion/bin/hyperiond.start

    Think I got the same.. :_(

    LibreELEC:~ # /storage/.kodi/addons/service.hyperion/bin/hyperiond.start

    LibreELEC:~ # Hyperion Ambilight Deamon (639)

    Version : 1c21232

    Build Time: Oct 12 2017 09:47:51

    INFO: Selected configuration file: /storage/.kodi/userdata/addon_data/service.hy perion/hyperion.config.json

    HYPERION INFO: ColorTransform 'default' => [0; 45]

    HYPERION INFO: ColorCorrection 'default' => [0; 45]

    HYPERION INFO: ColorAdjustment 'default' => [0; 45]

    LEDDEVICE INFO: configuration:

    {

    "colorOrder" : "rgb",

    "name" : "MyHyperionConfig",

    "output" : "/dev/null",

    "rate" : 1000000,

    "type" : "file"

    }

    INFO: Creating linear smoothing

    HYPERION (CS) INFO: Created linear-smoothing(interval_ms=50;settlingTime_ms=200; updateDelay=0

    EFFECTENGINE INFO: 27 effects loaded from directory /storage/.kodi/addons/servic e.hyperion/effects

    EFFECTENGINE INFO: Initializing Python interpreter

    INFO: Hyperion started and initialised

    INFO: Boot sequence 'Rainbow swirl fast' EFFECTENGINE INFO: run effect Rainbow s wirl fast on channel 0

    BLACKBORDER INFO: threshold set to 0 (0)

    BLACKBORDER INFO: mode:default

    started

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

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

    LibreELEC:~ #


    Running the ledon.py gets also the same

    LibreELEC:~ # cd /storage/hyperion/scripts

    LibreELEC:~/hyperion/scripts # python ledon.py

    * Trying 127.0.0.1...

    * TCP_NODELAY set

    * connect to 127.0.0.1 port 80 failed: Connection refused

    * Failed to connect to 127.0.0.1 port 80: Connection refused

    * Closing connection 0

    curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused

    hyperion-remote:

    version : V1.03.4 (brindosch-c750c41/dc6a602-1522918225

    build time: Apr 5 2018 01:57:05

    Connected to localhost:19444

    Start effect Rainbow Swirl

    LibreELEC:~/hyperion/scripts #


  • OK. And what's the output of this?

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

    Connection refused.. u.u

    LibreELEC:~/hyperion/scripts # python /storage/hyperion/scripts/ledon.py

    * Trying 127.0.0.1...

    * TCP_NODELAY set

    * connect to 127.0.0.1 port 80 failed: Connection refused

    * Failed to connect to 127.0.0.1 port 80: Connection refused

    * Closing connection 0

    curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused

    hyperion-remote:

    version : V1.03.4 (brindosch-c750c41/dc6a602-1522918225

    build time: Apr 5 2018 01:57:05

    Connected to localhost:19444

    Start effect Rainbow Swirl

    LibreELEC:~/hyperion/scripts #

  • 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)
  • Thanks I deleted that line in the script, rebooted and leds remain off.

    I run the script

    This is what I get

    LibreELEC:~ # python /storage/hyperion/scripts/ledon.py

    hyperion-remote:

    version : V1.03.4 (brindosch-c750c41/dc6a602-1522918225

    build time: Apr 5 2018 01:57:05

    Connected to localhost:19444

    Start effect Rainbow Swirl

    LibreELEC:~ #

    Seems no error, but nothing happened, leds remained off :_(

    Thanks

  • I finally got it! I recall I installed the Hyperion Service manually in LibreElec when I first set up the ISO (see screenshot attached). I disabled there and now it works!!

    The python code is right as you suggested, I un-commented the python call in autostart.sh and now hyperion starts automatically after I reboot!!

    You are the man, I owe you some beers. Thank you so much!!