[Tutorial] Hyperion Ambilight on Linux

  Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
patrickstam Offline
Junior Member
Posts: 3
Joined: Jan 2015
Reputation: 0
Post: #46
Hey guys,

After several attempts i finally managed to compile hyperion and create the hyperion binaries but i'm struggling with getting the startup and the config file in place.
I'm using FileZilla to connect to the KODIbuntu computer but when i try to move the files from my windows pc to the directories on the KODI-pc i'm getting a permission error, and i have no idea how to solve this?
find quote
Protheon Offline
Junior Member
Posts: 28
Joined: May 2014
Reputation: 0
Post: #47
Have tried to get my Lightpack running with the Lightpack plugin and the XBMC Boblight plugin without success, now I want give Hyperion a try.
After entering
cmake -DENABLE_DISPMANX=OFF
I get the following:

Code:
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- ENABLE_DISPMANX = OFF
-- ENABLE_SPIDEV   = ON
-- ENABLE_WS2812BPWM = OFF
-- ENABLE_V4L2 = ON
-- ENABLE_X11 = OFF
-- ENABLE_TINKERFORGE = ON
-- ENABLE_PROTOBUF = ON
-- ENABLE_FB = OFF
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found libusb-1.0:
--  - Includes: /usr/include/libusb-1.0
--  - Libraries: /usr/lib/x86_64-linux-gnu/libusb-1.0.so
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Error at dependencies/CMakeLists.txt:9 (add_subdirectory):
  The source directory

    /tmp/hyperion/dependencies/external/protobuf

  does not contain a CMakeLists.txt file.


CMake Error at dependencies/CMakeLists.txt:17 (export):
  export given target "protoc_compiler" which is not built by this project.


CMake Error at dependencies/CMakeLists.txt:25 (get_property):
  get_property could not find TARGET protoc_compiler.  Perhaps it has not yet
  been created.


-- Using protobuf compiler:
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found version "2.7.6")
-- Found Qt4: /usr/bin/qmake-qt4 (found version "4.8.6")
CMake Warning at doc/CMakeLists.txt:31 (message):
  Doxygen not found, unable to generate documenation!


-- Configuring incomplete, errors occurred!
See also "/tmp/hyperion/CMakeFiles/CMakeOutput.log".
See also "/tmp/hyperion/CMakeFiles/CMakeError.log".

CMakeError.log:

Code:
Determining if the Q_WS_WIN exist failed with the following output:
Change Dir: /tmp/hyperion/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec3429884551/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3429884551.dir/build.make CMakeFiles/cmTryCompileExec3429884551.dir/build
make[1]: Entering directory `/tmp/hyperion/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /tmp/hyperion/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec3429884551.dir/CheckSymbolExists.cxx.o
/usr/bin/c++    -std=c++0x -Wall  -I/usr/include/qt4    -o CMakeFiles/cmTryCompileExec3429884551.dir/CheckSymbolExists.cxx.o -c /tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx
/tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx: In function ‘int main(int, char**)’:
/tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:8:19: error: ‘Q_WS_WIN’ was not declared in this scope
   return ((int*)(&Q_WS_WIN))[argc];
                   ^
make[1]: *** [CMakeFiles/cmTryCompileExec3429884551.dir/CheckSymbolExists.cxx.o] Error 1
make[1]: Leaving directory `/tmp/hyperion/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec3429884551/fast] Error 2

File /tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:
/* */
#include <QtCore/qglobal.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef Q_WS_WIN
  return ((int*)(&Q_WS_WIN))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the Q_WS_QWS exist failed with the following output:
Change Dir: /tmp/hyperion/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec154367788/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec154367788.dir/build.make CMakeFiles/cmTryCompileExec154367788.dir/build
make[1]: Entering directory `/tmp/hyperion/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /tmp/hyperion/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec154367788.dir/CheckSymbolExists.cxx.o
/usr/bin/c++    -std=c++0x -Wall  -I/usr/include/qt4    -o CMakeFiles/cmTryCompileExec154367788.dir/CheckSymbolExists.cxx.o -c /tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx
/tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx: In function ‘int main(int, char**)’:
/tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:8:19: error: ‘Q_WS_QWS’ was not declared in this scope
   return ((int*)(&Q_WS_QWS))[argc];
                   ^
make[1]: *** [CMakeFiles/cmTryCompileExec154367788.dir/CheckSymbolExists.cxx.o] Error 1
make[1]: Leaving directory `/tmp/hyperion/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec154367788/fast] Error 2

File /tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:
/* */
#include <QtCore/qglobal.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef Q_WS_QWS
  return ((int*)(&Q_WS_QWS))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the Q_WS_MAC exist failed with the following output:
Change Dir: /tmp/hyperion/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec1146240855/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec1146240855.dir/build.make CMakeFiles/cmTryCompileExec1146240855.dir/build
make[1]: Entering directory `/tmp/hyperion/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /tmp/hyperion/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec1146240855.dir/CheckSymbolExists.cxx.o
/usr/bin/c++    -std=c++0x -Wall  -I/usr/include/qt4    -o CMakeFiles/cmTryCompileExec1146240855.dir/CheckSymbolExists.cxx.o -c /tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx
/tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx: In function ‘int main(int, char**)’:
/tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:8:19: error: ‘Q_WS_MAC’ was not declared in this scope
   return ((int*)(&Q_WS_MAC))[argc];
                   ^
make[1]: *** [CMakeFiles/cmTryCompileExec1146240855.dir/CheckSymbolExists.cxx.o] Error 1
make[1]: Leaving directory `/tmp/hyperion/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec1146240855/fast] Error 2

File /tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:
/* */
#include <QtCore/qglobal.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef Q_WS_MAC
  return ((int*)(&Q_WS_MAC))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the pthread_create exist failed with the following output:
Change Dir: /tmp/hyperion/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec1815373527/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec1815373527.dir/build.make CMakeFiles/cmTryCompileExec1815373527.dir/build
make[1]: Entering directory `/tmp/hyperion/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /tmp/hyperion/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1815373527.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTryCompileExec1815373527.dir/CheckSymbolExists.c.o   -c /tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec1815373527
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1815373527.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTryCompileExec1815373527.dir/CheckSymbolExists.c.o  -o cmTryCompileExec1815373527 -rdynamic
CMakeFiles/cmTryCompileExec1815373527.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [cmTryCompileExec1815373527] Error 1
make[1]: Leaving directory `/tmp/hyperion/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec1815373527/fast] Error 2

File /tmp/hyperion/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /tmp/hyperion/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec2388859953/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2388859953.dir/build.make CMakeFiles/cmTryCompileExec2388859953.dir/build
make[1]: Entering directory `/tmp/hyperion/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /tmp/hyperion/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2388859953.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTryCompileExec2388859953.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-2.8/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec2388859953
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2388859953.dir/link.txt --verbose=1
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTryCompileExec2388859953.dir/CheckFunctionExists.c.o  -o cmTryCompileExec2388859953 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [cmTryCompileExec2388859953] Error 1
make[1]: Leaving directory `/tmp/hyperion/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec2388859953/fast] Error 2

Any ideas?

XBMCbuntu Kodi 14.0 Helix
find quote
patrickstam Offline
Junior Member
Posts: 3
Joined: Jan 2015
Reputation: 0
Post: #48
@protheon
Did u use the: git clone --recursive https://github.com/tvdzwan/hyperion.git instead of the git clone https://github.com/tvdzwan/hyperion.git
That solved the problem for me

@anyone else
I finally got it working on Kodibuntu the only thing i can't get to work is an autostart. When i start hyperion using the script in putty everything works fine, but it won't start when i boot my HTPC. Any suggestions?
find quote
Protheon Offline
Junior Member
Posts: 28
Joined: May 2014
Reputation: 0
Post: #49
Thanks @patrickstam, that did the trick.

These are the addon settings:

[Image: JjrsgJo.png]

When I start a movie an error message pops up saying "Unable to connect to Hyperion".
How can I check if Hyperion is started?

XBMCbuntu Kodi 14.0 Helix
find quote
patrickstam Offline
Junior Member
Posts: 3
Joined: Jan 2015
Reputation: 0
Post: #50
i use the hyperion remote for android to see if hyperion is running. When you start the android app it displays : "server synchronised" if Hyperion is running.
find quote
NicCo Offline
Member
Posts: 93
Joined: Feb 2014
Reputation: 0
Post: #51
Hi,
I have installed Hyperion to my Ubuntu system, it seems to be OK because Android Hyperion app tells me "Server synchronized". But my LEDs stay inactive.
I have plugged my Arduino Uno to the HTPC with a USB port, I use ttyACM0 (like indicated into ls -l from /dev/ directory) and I have configured Hyperion with configurator.
But I don't know if my sketch is OK. Could you give me a sketch for Arduino Uno and WS2812B LEDs ?
Thanks !
(This post was last modified: 2015-02-07 21:47 by NicCo.)
find quote
illiac4 Offline
Fan
Posts: 597
Joined: May 2009
Reputation: 4
Post: #52
Well first i doubt that uno introduces itself to linux as ttyACM0 it should be like ttyUSB0. Second i have no experiences with 2812 so i can not elaborate on that. I assume you have used right pde with fastled integration.
find quote
NicCo Offline
Member
Posts: 93
Joined: Feb 2014
Reputation: 0
Post: #53
Thanks ! How could I verify if it's ACM0 or USB0 ? I'm noob with Linux...

Edit : I have found this with dmesg :
Quote:[ 117.566865] usb 2-3: new full-speed USB device number 6 using xhci_hcd
[ 117.585137] usb 2-3: New USB device found, idVendor=2341, idProduct=0001
[ 117.585147] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 117.585152] usb 2-3: Product: Arduino Uno
[ 117.585156] usb 2-3: Manufacturer: Arduino (http://www.arduino.cc)
[ 117.585160] usb 2-3: SerialNumber: 5543131313835161B180
[ 117.585396] usb 2-3: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[ 117.585826] cdc_acm 2-3:1.0: ttyACM0: USB ACM device
(This post was last modified: 2015-02-08 11:28 by NicCo.)
find quote
b0mb Offline
Senior Member
Posts: 103
Joined: Feb 2014
Reputation: 0
Location: .de
Post: #54
on kodibuntu 14.2 my hyperion suddenly stopped working...

when i try to compile new i get the following two errors....

Code:
Linking CXX static library ../../lib/libjsonserver.a
[ 76%] Built target jsonserver
[ 77%] Running C++ protocol buffer compiler on /tmp/hyperion/libsrc/protoserver/message.proto
[ 77%] Generating __/__/include/protoserver/moc_ProtoServer.cxx
[ 78%] Generating __/__/include/protoserver/moc_ProtoConnection.cxx
/tmp/hyperion/include/protoserver/ProtoConnection.h:0: Note: No relevant classes found. No output generated.
[ 78%] Generating moc_ProtoClientConnection.cxx
[ 78%] Generating __/__/include/protoserver/moc_ProtoConnectionWrapper.cxx
Scanning dependencies of target protoserver

Code:
[ 94%] Built target hyperion-v4l2
Scanning dependencies of target gpio2spi
[ 95%] Building C object test/CMakeFiles/gpio2spi.dir/switchPinCtrl.c.o
/tmp/hyperion/test/switchPinCtrl.c: In function ‘setup_io’:
/tmp/hyperion/test/switchPinCtrl.c:146:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
       printf("mmap error %d\n", (int)gpio_map);
                                 ^
/tmp/hyperion/test/switchPinCtrl.c:169:4: warning: format ‘%p’ expects argument of type ‘void *’, but argument 2 has type ‘int’ [-Wformat=]
    printf("SPI mapped from 0x%p to 0x%p\n",SPI0_BASE,spi0_map);
    ^
/tmp/hyperion/test/switchPinCtrl.c:172:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
       printf("mmap error %d\n", (int)spi0_map);
                                 ^
Linking C executable ../bin/gpio2spi
[ 95%] Built target gpio2spi

Can any1 help plz?

I think the problem belongs to the jsonserver... looks like it isn´t build so that hyperion can´t connect to
(This post was last modified: 2015-04-03 13:18 by b0mb.)
find quote
sgaluf Offline
Junior Member
Posts: 5
Joined: Dec 2014
Reputation: 0
Post: #55
@NicCo:
my arduino uno introduces as ttyACM0 to linux.
try to check your Sketch using this tutorial:
https://learn.adafruit.com/adalight-diy-...v-lighting
connect arduino uno directly to Windows or Linux PC and see, how to setup LEDs

can anyone help me on hyperion effects. I've put effect files in "/media/scripts/hyperion/effects", effects are enabled in config.json, correct path is stated, but the effects don't work from android app. color whel does work.
find quote
tdhz77 Offline
Senior Member
Posts: 125
Joined: Apr 2009
Reputation: 0
Post: #56
Has anybody tried to get hyperion working on Kodibuntu and SteamOS?

http://mattie.id.au/boblightd-and-steamos.html
find quote
tdhz77 Offline
Senior Member
Posts: 125
Joined: Apr 2009
Reputation: 0
Post: #57
@anyone else
I finally got it working on Kodibuntu the only thing i can't get to work is an autostart. When i start hyperion using the script in putty everything works fine, but it won't start when i boot my HTPC. Any suggestions?
[/quote]

The autoexec.py did not work for me on Kodibuntu 14.04 LTS. No matter what I tried I still couldn't get it working. In the end this worked. Maybe this will help somebody else out there.

Copy this script to /etc/init.d/hyperion

Code:
#!/bin/sh
### BEGIN INIT INFO
# Provides:  hyperion
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start the hyperion daemon at boot time
# Description:       Enable service provided by hyperion.
### END INIT INFO

user="root"
cmd="sudo /usr/bin/hyperiond /etc/hyperion.config.json >/dev/null 2>&1 &"

name=`basename $0`
pid_file="/var/run/$name.pid"
stdout_log="/var/log/$name.log"
stderr_log="/var/log/$name.err"

get_pid() {
    cat "$pid_file"
}

is_running() {
    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
}

case "$1" in
    start)
    if is_running; then
        echo "Already started"
    else
        echo "Starting $name"
        cd "$dir"
        sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
        echo $! > "$pid_file"
        if ! is_running; then
            echo "Unable to start, see $stdout_log and $stderr_log"
            exit 1
        fi
    fi
    ;;
    stop)
    if is_running; then
        echo -n "Stopping $name.."
        kill `get_pid`
        for i in {1..10}
        do
            if ! is_running; then
                break
            fi

            echo -n "."
            sleep 1
        done
        echo

        if is_running; then
            echo "Not stopped; may still be shutting down or shutdown may have failed"
            exit 1
        else
            echo "Stopped"
            if [ -f "$pid_file" ]; then
                rm "$pid_file"
            fi
        fi
    else
        echo "Not running"
    fi
    ;;
    restart)
    $0 stop
    if is_running; then
        echo "Unable to stop, will not attempt to start"
        exit 1
    fi
    $0 start
    ;;
    status)
    if is_running; then
        echo "Running"
    else
        echo "Stopped"
        exit 1
    fi
    ;;
    *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 1
    ;;
esac

exit 0

Give the script permissions

Code:
chmod +x /etc/init.d/hyperion

Add it to the startup process using rc.local

Code:
sudo update-rc.d hyperion defaults

Reboot.

This works for me.
find quote
meowmoo Offline
Member
Posts: 71
Joined: Jul 2013
Reputation: 0
Post: #58
anybody got a know how to get this on a non pi openelec box to work
find quote
Post Reply