Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Commit

Permalink
preperation for next release and cleanup
Browse files Browse the repository at this point in the history
Former-commit-id: dc829ea
  • Loading branch information
brindosch committed Apr 26, 2016
1 parent bb9b02c commit fc59df9
Show file tree
Hide file tree
Showing 41 changed files with 437 additions and 622 deletions.
13 changes: 7 additions & 6 deletions ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
**Please provide some information that we could help as fast as possible.
Please check the wiki in case your problem is already known/feature requested.**
BEFORE YOU OPEN A NEW ISSUE!

**1.** Used hardware and sofware (Wetek,RPi1,Rpi2,... Ubuntu 14.04(64bit),OSX,OpenELEC,OSMC,XBian,...)
**2.** Your LED device and additional hardware (if used) (WS2801,APA102,WS2812B,... connected through (direct,arduino uno,...))
**3.** Please upload your Hyperion log to pastebin.com and insert the link. Have a look at the wiki how you get one.
**4.** Please upload your "Hyperion Configuration File" to pastebin.com and insert the link.
Search at our wiki: wiki.hyperion-project.org
Our FAQ: https://hyperion-project.org/wiki/FAQ-Frequently-Asked-Questions
And have a look at our forum: forum.hyperion-project.org
If you need help please open a new thread their!

WE PROVIDE NO SUPPORT AT GITHUB!
All misleading issues will be closed without a announcement!
2 changes: 2 additions & 0 deletions PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ IMPORTANT: Please don´t commit to master, we will test your changes first at th
**2.** If this changes affect the .conf file. Please provide the changed section
**3.** Reference a issue (optional)

Note: For further discussions use our forum: forum.hyperion-project.org

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
HYPERION
========

Hyperion is an opensource 'AmbiLight' implementation controlled using the RaspBerry Pi running [Raspbmc](http://www.raspbmc.com). The main features of Hyperion are:
Hyperion is an opensource 'AmbiLight' implementation supported by many devices. The main features of Hyperion are:
* Low CPU load. For a led string of 50 leds the CPU usage will typically be below 1.5% on a non-overclocked Pi.
* Json interface which allows easy integration into scripts.
* A command line utility allows easy testing and configuration of the color transforms (Transformation settings are not preserved over a restart at the moment...).
* Priority channels are not coupled to a specific led data provider which means that a provider can post led data and leave without the need to maintain a connection to Hyperion. This is ideal for a remote application (like our Android app).
* HyperCon. A tool which helps generate a Hyperion configuration file.
* XBMC-checker which checks the playing status of XBMC and decides whether or not to capture the screen.
* Kodi-checker which checks the playing status of Kodi and decides whether or not to capture the screen.
* Black border detector.
* A scriptable effect engine.
* Generic software architecture to support new devices and new algorithms easily.

More information can be found on the [wiki](https://github.com/tvdzwan/hyperion/wiki) or the [Hyperion topic](http://forum.stmlabs.com/showthread.php?tid=11053) on the Raspbmc forum.
More information can be found on the [wiki](wiki.hyperion-project.org) or the [Hyperion webpage/forum](www.hyperion-project.org).

The source is released under MIT-License (see http://opensource.org/licenses/MIT).
10 changes: 5 additions & 5 deletions bin/create_all_releases.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
# create all directly for release with -DCMAKE_BUILD_TYPE=Release -Wno-dev
# Create the x64 build
mkdir build-x32x64
cd build-x32x64
mkdir build-x86x64
cd build-x86x64
cmake -DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev ..
make -j 4
cd ..
Expand All @@ -17,14 +17,14 @@ cd ..
# Create the RPI build
mkdir build-rpi
cd build-rpi
cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" -DIMPORT_PROTOC=../build-x32x64/protoc_export.cmake -DENABLE_WS2812BPWM=ON -DENABLE_WS281XPWM=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev ..
cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" -DIMPORT_PROTOC=../build-x86x64/protoc_export.cmake -DENABLE_WS2812BPWM=ON -DENABLE_WS281XPWM=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev ..
make -j 4
cd ..

# Create the WETEK build
mkdir build-wetek
cd build-wetek
cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" -DIMPORT_PROTOC=../build-x32x64/protoc_export.cmake -DENABLE_DISPMANX=OFF -DENABLE_FB=ON -DENABLE_AMLOGIC=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev ..
cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" -DIMPORT_PROTOC=../build-x86x64/protoc_export.cmake -DENABLE_DISPMANX=OFF -DENABLE_FB=ON -DENABLE_AMLOGIC=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev ..
make -j 4
cd ..

Expand All @@ -35,7 +35,7 @@ cd ..
#make -j 4
#cd ..

bin/create_release.sh . x32x64
bin/create_release.sh . x86x64
#bin/create_release.sh . x32
bin/create_release.sh . rpi
bin/create_release.sh . wetek
Expand Down
115 changes: 44 additions & 71 deletions bin/install_hyperion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ if [ "$1" = "HyperConInstall" ] || [ "$2" = "HyperConInstall" ]; then
HCInstall=1
else HCInstall=0
fi
if [ "$1" = "WS281X" ] || [ "$2" = "WS281X" ]; then
PWM=1
else PWM=0
fi
if [ "$1" = "USB" ] || [ "$2" = "USB" ]; then
USB=1
else USB=0
fi

#Check if HyperCon is logged in as root
if [ $(id -u) != 0 ] && [ $HCInstall -eq 1 ]; then
Expand All @@ -34,24 +26,30 @@ fi
#Welcome message
echo '*******************************************************************************'
echo 'This script will install/update Hyperion and it´s services'
echo 'Version 0.1'
echo 'Created by brindosch - hyperion-project.org - the official Hyperion source.'
echo '*******************************************************************************'

# Find out if we are on OpenElec / OSMC
# Find out if we are on OpenElec / OSMC / Raspbian
OS_OPENELEC=`grep -m1 -c OpenELEC /etc/issue`
OS_OSMC=`grep -m1 -c OSMC /etc/issue`
OS_RASPBIAN=`grep -m1 -c 'Raspbian\|RetroPie' /etc/issue`

# Find out if its an imx6 device
# Find out which device this script runs on
CPU_RPI=`grep -m1 -c 'BCM2708\|BCM2709\|BCM2710' /proc/cpuinfo`
CPU_IMX6=`grep -m1 -c i.MX6 /proc/cpuinfo`
CPU_WETEK=`grep -m1 -c Amlogic /proc/cpuinfo`
CPU_X32X64=`uname -m | grep 'x86_32\|i686\|x86_64' | wc -l`
#CPU_X32=`uname -m | grep 'x86_32\|i686' | wc -l`
# Check that we have a known configuration
if [ $CPU_RPI -ne 1 ] && [ $CPU_IMX6 -ne 1 ] && [ $CPU_WETEK -ne 1 ] && [ $CPU_X32X64 -ne 1 ]; then
echo '---> Critical Error: CPU information does not match any known releases -> abort'
exit 1
fi

#Check which RPi we are one (in case)
RPI_1=`grep -m1 -c BCM2708 /proc/cpuinfo`
RPI_2=`grep -m1 -c BCM2709 /proc/cpuinfo`
RPI_3=`grep -m1 -c BCM2710 /proc/cpuinfo`

#Check, if year equals 1970
DATE=$(date +"%Y")
if [ "$DATE" -le "2015" ]; then
Expand All @@ -67,7 +65,7 @@ USE_SERVICE=`which /usr/sbin/service | wc -l`
# Make sure that the boblight daemon is no longer running
BOBLIGHT_PROCNR=$(pidof boblightd | wc -l)
if [ $BOBLIGHT_PROCNR -eq 1 ]; then
echo '---> Critical Error: Found running instance of boblight. Please stop boblight via XBMC menu before installing hyperion -> abort'
echo '---> Critical Error: Found running instance of boblight. Please stop boblight via Kodi menu before installing hyperion -> abort'
exit 1
fi

Expand All @@ -92,7 +90,7 @@ if [ $OS_OPENELEC -ne 1 ]; then
fi

#Check, if dtparam=spi=on is in place (not for OPENELEC)
if [ $PWM -ne 1 ] && [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -ne 1 ]; then
if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -ne 1 ]; then
SPIOK=`grep '^\dtparam=spi=on' /boot/config.txt | wc -l`
if [ $SPIOK -ne 1 ]; then
echo '---> Raspberry Pi found, but SPI is not ready, we write "dtparam=spi=on" to /boot/config.txt'
Expand All @@ -102,7 +100,7 @@ if [ $PWM -ne 1 ] && [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -ne 1 ]; then
fi

#Check, if dtparam=spi=on is in place (just for OPENELEC)
if [ $PWM -ne 1 ] && [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ]; then
if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ]; then
SPIOK=`grep '^\dtparam=spi=on' /flash/config.txt | wc -l`
if [ $SPIOK -ne 1 ]; then
mount -o remount,rw /flash
Expand All @@ -113,27 +111,6 @@ if [ $PWM -ne 1 ] && [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ]; then
fi
fi

#Check, if dtoverlay=pwm is in place (not for OPENELEC)
#if [ $PWM -eq 1 ] && [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -ne 1 ]; then
# PWMOK=`grep '^\dtoverlay=pwm' /boot/config.txt | wc -l`
# if [ $PWMOK -ne 1 ]; then
# echo '---> Raspberry Pi found, but PWM is not ready, we write "dtoverlay=pwm" to /boot/config.txt'
# sed -i '$a dtoverlay=pwm' /boot/config.txt
# PWMREBOOTMESSAGE="echo Please reboot your Raspberry Pi, we inserted dtoverlay=pwm to /boot/config.txt"
# fi
#fi

#Check, if dtoverlay=pwm is in place (just for OPENELEC)
if [ $PWM -eq 1 ] && [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ]; then
PWMOK=`grep '^\dtoverlay=pwm' /flash/config.txt | wc -l`
if [ $PWMOK -ne 1 ]; then
mount -o remount,rw /flash
echo '---> Raspberry Pi with OpenELEC found, but PWM is not ready, we write "dtoverlay=pwm" to /flash/config.txt'
sed -i '$a dtoverlay=pwm' /flash/config.txt
mount -o remount,ro /flash
PWMREBOOTMESSAGE="echo Please reboot your OpenELEC, we inserted dtoverlay=pwm to /flash/config.txt"
fi
fi
#Backup the .conf files, if present
echo '---> Backup Hyperion configuration(s), if present'
rm -f /tmp/*.json 2>/dev/null
Expand All @@ -143,22 +120,31 @@ else cp -v /opt/hyperion/config/*.json /tmp 2>/dev/null
fi

# Select the appropriate release
HYPERION_ADDRESS=https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy
if [ $CPU_RPI -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi.tar.gz
HYPERION_ADDRESS=https://sourceforge.net/projects/hyperion-project/files/release
if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_1 -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi_oe.tar.gz
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz
elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_2 -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi2_oe.tar.gz
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz
elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_3 -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3_oe.tar.gz
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz
elif [ $CPU_RPI -eq 1 ] && [ $RPI_1 -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi.tar.gz
elif [ $CPU_RPI -eq 1 ] && [ $RPI_2 -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi2.tar.gz
elif [ $CPU_RPI -eq 1 ] && [ $RPI_3 -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3.tar.gz
elif [ $CPU_IMX6 -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_imx6.tar.gz
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-imx6.tar.gz
elif [ $CPU_WETEK -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_wetek.tar.gz
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz
elif [ $CPU_X32X64 -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_x32x64.tar.gz
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-x32x64.tar.gz
#elif [ $CPU_X32 -eq 1 ]; then
# HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_x32.tar.gz
# OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-x32x64.tar.gz
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_x86x64.tar.gz
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-x86x64.tar.gz
else
echo "---> Critical Error: Target platform unknown -> abort"
exit 1
Expand Down Expand Up @@ -189,9 +175,6 @@ else
ln -fs /opt/hyperion/bin/hyperion-v4l2 /usr/bin/hyperion-v4l2
ln -fs /opt/hyperion/bin/hyperion-dispmanx /usr/bin/hyperion-dispmanx 2>/dev/null
ln -fs /opt/hyperion/bin/hyperion-x11 /usr/bin/hyperion-x11 2>/dev/null

# Copy a link to the hyperion configuration file to /etc (-s for people who replaced the symlink with their config)
ln -s /opt/hyperion/config/hyperion.config.json /etc/hyperion.config.json 2>/dev/null
fi

# Restore backup of .conf files, if present
Expand Down Expand Up @@ -229,30 +212,14 @@ elif [ $USE_SYSTEMD -eq 1 ]; then
rm /etc/init.d/hyperion 2>/dev/null
cp -n /opt/hyperion/init.d/hyperion.systemd.sh /etc/systemd/system/hyperion.service
systemctl -q enable hyperion.service
if [ $PWM -eq 1 ] && [ $OS_OSMC -eq 1 ]; then
echo '---> Modify systemd script for OSMC usage (PWM Support)'
# Wait until kodi is sarted (for xbmc checker) and FIX user in case it is wrong (need root for access to pwm!)!
sed -i '/After = mediacenter.service/d' /etc/systemd/system/hyperion.service
sed -i '/Unit/a After = mediacenter.service' /etc/systemd/system/hyperion.service
sed -i 's/User=osmc/User=root/g' /etc/systemd/system/hyperion.service
sed -i 's/Group=osmc/Group=root/g' /etc/systemd/system/hyperion.service
systemctl -q daemon-reload
elif [ $USB -eq 1 ] && [ $OS_OSMC -eq 1 ]; then
echo '---> Modify systemd script for OSMC usage (USB Support)'
# Wait until kodi is sarted (for xbmc checker) and FIX user in case it is wrong (need root for access to USB!)!
if [ $OS_OSMC -eq 1 ]; then
echo '---> Modify systemd script for OSMC usage'
# Wait until kodi is sarted (for kodi checker)
sed -i '/After = mediacenter.service/d' /etc/systemd/system/hyperion.service
sed -i '/Unit/a After = mediacenter.service' /etc/systemd/system/hyperion.service
sed -i 's/User=osmc/User=root/g' /etc/systemd/system/hyperion.service
sed -i 's/Group=osmc/Group=root/g' /etc/systemd/system/hyperion.service
systemctl -q daemon-reload
elif [ $OS_OSMC -eq 1 ]; then
echo '---> Modify systemd script for OSMC usage'
# Wait until kodi is sarted (for xbmc checker) and replace user (for remote control through osmc)
sed -i '/After = mediacenter.service/d' /etc/systemd/system/hyperion.service
sed -i '/Unit/a After = mediacenter.service' /etc/systemd/system/hyperion.service
sed -i 's/User=root/User=osmc/g' /etc/systemd/system/hyperion.service
sed -i 's/Group=root/Group=osmc/g' /etc/systemd/system/hyperion.service
systemctl -q daemon-reload
fi
elif [ $USE_SERVICE -eq 1 ]; then
echo '---> Installing startup script in init.d'
Expand All @@ -262,10 +229,17 @@ elif [ $USE_SERVICE -eq 1 ]; then
update-rc.d hyperion defaults 98 02
fi

#chown the /config/ dir and all configs inside for hypercon config upload for non-root logins
if [ $OS_OSMC -eq 1 ]; then
chown -R osmc:osmc /opt/hyperion/config
elif [ $OS_RASPBIAN -eq 1 ]; then
chown -R pi:pi /opt/hyperion/config
fi

# Start the hyperion daemon
echo '---> Starting Hyperion'
if [ $OS_OPENELEC -eq 1 ]; then
/storage/.config/autostart.sh
/storage/.config/autostart.sh > /dev/null 2>&1 &
elif [ $USE_INITCTL -eq 1 ]; then
/sbin/initctl start hyperion
elif [ $USE_SERVICE -eq 1 ]; then
Expand All @@ -285,16 +259,15 @@ echo 'Please get a new HyperCon version to benefit from the latest features!'
echo 'Create a new config file, if you encounter problems!'
$HINTMESSAGE
$REBOOTMESSAGE
$PWMREBOOTMESSAGE
echo '*******************************************************************************'
## Force reboot and prevent prompt if spi is added during a HyperCon Install
if ( [ "$HCInstall" = "1" ] && [ "$CPU_RPI" = "1" ] ) && ( [ "$SPIOK" = "0" ] || [ "$PWMOK" = "0" ] ); then
echo "Rebooting now, we added dtparam=spi=on and/or dtoverlay=pwm to config.txt"
if [ $HCInstall -eq 1 ] && [ $CPU_RPI -eq 1 ] && [ $SPIOK -ne 1 ]; then
echo "Rebooting now, we added dtparam=spi=on to config.txt"
reboot
exit 0
fi
#Prompt for reboot, if spi added to config.txt
if ( [ "$CPU_RPI" = "1" ] ) && ( [ "$SPIOK" = "0" ] || [ "$PWMOK" = "0" ] ); then
if [ $CPU_RPI -eq 1 ] && [ $SPIOK -ne 1 ]; then
while true
do
echo -n "---> Do you want to reboot your Raspberry Pi now? (y or n) :"
Expand Down
25 changes: 22 additions & 3 deletions bin/remove_hyperion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fi
echo '*******************************************************************************'
echo 'This script will remove Hyperion and it´s services'
echo '-----> Please BACKUP your hyperion.config.json if necessary <-----'
echo 'Created by brindosch - hyperion-project.org - the official Hyperion source.'
echo '*******************************************************************************'

#Skip the prompt if HyperCon Remove
Expand Down Expand Up @@ -49,6 +50,9 @@ USE_SYSTEMD=`grep -m1 -c systemd /proc/1/comm`
USE_INITCTL=`which /sbin/initctl | wc -l`
USE_SERVICE=`which /usr/sbin/service | wc -l`

# set count for forwarder
SERVICEC=1

# Stop hyperion daemon if it is running
echo '---> Stop Hyperion, if necessary'
if [ $OS_OPENELEC -eq 1 ]; then
Expand All @@ -59,12 +63,19 @@ elif [ $USE_SERVICE -eq 1 ]; then
/usr/sbin/service hyperion stop 2>/dev/null
elif [ $USE_SYSTEMD -eq 1 ]; then
service hyperion stop 2>/dev/null
while [ $SERVICEC -le 20 ]; do
service hyperion_fw$SERVICEC stop 2>/dev/null
((SERVICEC++))
done
fi

#reset count
SERVICEC=`which /usr/sbin/service | wc -l`

#Disabling and delete service files
if [ $USE_INITCTL -eq 1 ]; then
echo '---> Delete and disable Hyperion initctl script'
rm -v /etc/init/hyperion.conf 2>/dev/null
rm -v /etc/init/hyperion* 2>/dev/null
initctl reload-configuration
elif [ $OS_OPENELEC -eq 1 ]; then
# Remove Hyperion from OpenELEC autostart.sh
Expand All @@ -75,12 +86,20 @@ elif [ $USE_SYSTEMD -eq 1 ]; then
# Delete and disable Hyperion systemd script
echo '---> Delete and disable Hyperion systemd script'
systemctl disable hyperion.service
rm -v /etc/systemd/system/hyperion.service 2>/dev/null
while [ $SERVICEC -le 20 ]; do
systemctl -q disable hyperion_fw$SERVICEC.service 2>/dev/null
((SERVICEC++))
done
rm -v /etc/systemd/system/hyperion* 2>/dev/null
elif [ $USE_SERVICE -eq 1 ]; then
# Delete and disable Hyperion init.d script
echo '---> Delete and disable Hyperion init.d script'
update-rc.d -f hyperion remove
rm /etc/init.d/hyperion 2>/dev/null
while [ $SERVICEC -le 20 ]; do
update-rc.d -f hyperion_fw$SERVICEC remove 2>/dev/null
((SERVICEC++))
done
rm /etc/init.d/hyperion* 2>/dev/null
fi

# Delete Hyperion binaries
Expand Down
Loading

0 comments on commit fc59df9

Please sign in to comment.