Hyperion / Lightberry HD on RasPlex - Setup Instructions, Default settings, plus hints & tips

rasplex

#1

I have recently installed a Lightberry HD and set it up using RasPlex and I thought I would make a post with some notes on a few things I found or worked out along the way. Lots of things are undocumented or dotted all over the web. I wrote this using a Lightberry HD and RasPlex 0.7.0, the instructions will likely work for other similar setups but this is the one I have used.

Update History

  • August 31 - Initial Post
  • September 1st - Fixed instructions regarding editing the hyperion on file on your PC not on the Pi directly.
  • Saturday 12th - Updated Hyperion script section using suggestions by @Kwiboo - It now sets the enabled/disabled state in a better way making the System Settings update correctly. I also added notifications. Also added the file and the launch script at attachments to this post.
  • Saturday 12th Part 2 - Added a new "Default Settings" section with some example setups.

Hardware Setup

This part I have no notes, the instructions from Lightberry worked you just have to follow them.

Lightberry HD Instructions

Lightberry Instructions

Software Setup

You'll need to create a custom configuration file for your Lightberry HD. Part of this will need to be custom depending on your LED layout for your TV size. Other parts of it need to be standard. Before you go any further you'll need to record how many LEDs you have the vertical and horizontal sides. You also need to note if you have LEDs in the corners or not.

Now you should install this Java application onto your desktop computer (not the Pi).

https://github.com/tvdzwan/hyperion/wiki/configuration -> It also has some good expplatations of what all the settings do.

Hardware - Construction

First the "Construction" section. Items in bold are ones where you will need to enter custom details depending on your setup.

  • Direction - counter_clockwise
  • LED in top / bottom corners - Change this to true or false depending on how you setup your LEDs
  • Horizonal # - Number of horizontal LEDs
  • Vertical # - Number of Vertical LEDSs
  • Bottom Gap - Not needed unless you left a gap at the bottom of your lights.
  • 1st LED offset - If you followed the lightberry instructions then your LEDs start in the bottom right of the image and go round the TV in a counter clockwise rotation. Remember the image show you looking at the TV on the screen side so make sure you keep that in mind as it looks flipped when you wired up the back of the TV. :) The key is to make sure the numbers and how you setup your LEDs line up the first LED on your string starts at 0 and the last one. If you get this bit wrong then you'll get colours in the wrong place.

Hardware - Image Process

Make sure Blackborder Detector is on and the threshold is set to 1% this means films that have black borders (both widescreen and 4:3) will have the correct lighting and ignore the borders.

Process - Frame Grabber

It's enabled by default just leave the settings as they are

Process - Frame Grabber

This setting is down to personal preference but without some form of smoothing you'll get annoying flickers. I suggest enabling it with a 100ms Time setting and see how that works for you. I had it at 200ms which worked well but perhaps is a little slow for fast scenes.

Process - Colours

These settings will need to be tweaked per your preferences but after some trial and error I have the following suggestions based on my latest attempts. These are what control the lighting colours and intensity, I have spent time trying to get the best match across multiple types of film from vivid films like Avatar and Fifth Element to things with a more brown/dark palette like Game Of Thrones. These are based on Lightberry HD which use WS2801 LED strips.

  • HSV Saturation gain - 1.47
  • HSV Value gain - 0.5

Leave RGB Gamma, BlackLvl and WhiteLvl at defaults. The only variation you might want to alter is the threshold value. You can bump this value by a small amount if you are experiencing flickers of colour when in a dark scene. This value however will also effect the colour of certain scenes as it will stop the colours from lighting up.

Initially I have the threshold settings at:

  • Red 0.08
  • Green 0.05
  • Blue 0.05

However I found it means the colours didn't match as well so I reverted back to having them all set to 0. In most cases this works out much better with more accurate colour mapping but I am sure in certain scenes you might get a little flicker if the colour is on the edge.

The problem is all these settings effect each other so if you tweak one you need to modify all the others to fit. I would be very interested to see what values others have been using.

External

XBMC Checker - Enabled using defaults
JSON Server - Enabled using defaults
Proto Server - Enabled using defaults
Boblight Server - Disabled
Effect Engine - Enabled
- Directory - This needs to be altered slightly for RasPlex use the following path: /usr/share/hyperion/effects
- Bootsequence - enabled (use defaults)

Share your settings on this thread

If people using Lightberry HD's or similar WS2801 strips can share their:

  • HSV Saturation gain
  • HSV Value gain
  • Threshold, Gamma, BlackLvl & WhiteLvl for RGB

It would be interesting if we can try and build up some good settings that work with different films and lighting conditions. I am happy with my settings as a first stage but I am very keen to try and see what others are trying out with the aim of having some good recommended defaults for Lightberry HD (or similar LED strip) users.

Installing settings

There should be a number of guides on this forum about what apps and how to use sftp or ssh, I am assuming you know about those or can google. With that out the way connect to your RasPlex using ssh (or sftp)

Server Name: RasPlex.local
Username: root
Password: rasplex
Directory: /storage/.config/

Backup the original file (called hyperon.config.json) and replace it with the one you just generated. If something goes wrong you can compare the original to the one you made to track down any mistakes or problems.

I have attached my working json that I am using currently (which is setup for my LEDs layout) as a sample zip file to help if people have issues.

Turning on Hyperion

Go into your System Preferences and turn on Hyperion. If all has gone well you should get the rainbow effect round your TV. Now go and play a movie or TV show and enjoy!

Extra Credit - Toggle Hyperion using a button on your remote

There are times when you might want to disable/enable Hyperion without having to go into the menus. This is both for times when you just don't want to use it and also if you just want to restart Hyperion after altering settings. I wrote a script to do this and hooked it up to the Blue button on the remote.

This needs two parts adding a script to rasplex to toggle Hyperion and second a file to add the button to the remote. I am also assuming for this part you are happy with ssh and some very basic scripting.

Create a file called hyperionswitch.sh in the following location /storage/hyperion/ you will need to create the hyperion folder. Make sure it has the following contents.

#!/bin/sh
SERVICE=hyperion
if systemctl is-active $SERVICE >/dev/null 2>&1
then
echo "Stop Hyperion"
systemctl stop $SERVICE
[ -f /storage/.cache/services/$SERVICE.conf ] && mv /storage/.cache/services/$SERVICE.conf /storage/.cache/services/$SERVICE.disabled
/usr/bin/xbmc-send --host=127.0.0.1 --port=9778 --action="Notification(Hyperion,Shutting Down)"
else
echo "Start Hyperion"
[ -f /storage/.cache/services/$SERVICE.disabled ] && mv /storage/.cache/services/$SERVICE.disabled /storage/.cache/services/$SERVICE.conf
[ ! -f /storage/.cache/services/$SERVICE.conf ] && touch /storage/.cache/services/$SERVICE.conf
systemctl start $SERVICE
/usr/bin/xbmc-send --host=127.0.0.1 --port=9778 --action="Notification(Hyperion,Starting Up)"
fi

You will need to make the script executable using chmod +x hyperionswitch.sh via ssh.

You will now need to make a second file called remote.xml and make sure it has the following contents.

<keymap>
<global>
<remote>
<blue>XBMC.System.Exec("/storage/hyperion/hyperionswitch.sh")</blue>
</remote>
</global>
</keymap>

Now connect to your RasPlex again and put this file in the following folder location (it should already exist so you won't need to do anything but add the file).

/storage/.plexht/userdata/keymaps/remote.xml

Reboot your RasPlex, the blue button will now toggle Hyperion on and off.

I have attached the scripts to this post in a zip.

Useful Apps

There is an iOS and Android app that allows you to tweak the values of Hyperion in realtime it's a little fiddly but is very useful and allows you to see how certain settings will look without having to edit the setup file and restart Hyperion.

https://github.com/tvdzwan/hyperion/wiki/android-remote

https://github.com/tvdzwan/hyperion/wiki/Hyperion-Remote-for-iOS

That's it for now, I'll look to date this as I get more details and answer any questions people might have. I hope some of you using RasPlex and Hyperion might find this useful.

Default Settings

Below are a list of different settings you might want to try.

My Current Settings

The aim of these settings are to give the best overall colour for films, the brightness is lower so it doesn't take away from the films you're watching but it high enough to enhance the experience. It's my personal favourite overall.

"color" :
{
"transform" :
[
{
"id" : "default",
"leds" : "*",
"hsv" :
{
"saturationGain" : 1.4700,
"valueGain" : 0.5000
},
"red" :
{
"threshold" : 0.0800,
"gamma" : 1.0000,
"blacklevel" : 0.0000,
"whitelevel" : 1.0000
},
"green" :
{
"threshold" : 0.0500,
"gamma" : 1.0000,
"blacklevel" : 0.0000,
"whitelevel" : 1.0000
},
"blue" :
{
"threshold" : 0.0500,
"gamma" : 1.0000,
"blacklevel" : 0.0000,
"whitelevel" : 1.0000
}
}
],
"smoothing" :
{
"type" : "linear",
"time_ms" : 100,
"updateFrequency" : 20.0000,
"updateDelay" : 0
}
},

@Kwiboo Settings

I have not tested these but I would expect they will have stronger colours than my defaults. I'll update this once I give it a better test.

"color" :
{
"transform" :
[
{
"id" : "default",
"leds" : "*",
"hsv" :
{
"saturationGain" : 1.5000,
"valueGain" : 0.5000
},
"red" :
{
"threshold" : 0.0500,
"gamma" : 1.7000,
"blacklevel" : 0.0000,
"whitelevel" : 1.0000
},
"green" :
{
"threshold" : 0.0500,
"gamma" : 1.7000,
"blacklevel" : 0.0000,
"whitelevel" : 1.0000
},
"blue" :
{
"threshold" : 0.0500,
"gamma" : 1.7000,
"blacklevel" : 0.0000,
"whitelevel" : 1.0000
}
}
],
"smoothing" :
{
"type" : "linear",
"time_ms" : 100,
"updateFrequency" : 20.0000,
"updateDelay" : 0
}
},


#2

Excellent How-To @edddeduck

Regards


#3

Just got my LEDs mounted and everything hooked up. Here we go! Will report back :)

Thanks @edddeduck!


#4

Not having any luck, no number of Rasplex restarts/ daemon kills/restarts via SSH shows any kind of LED activity other than one light blue LED lighting up. I'm on 0.7.1.

The only thing I deviated from in the instructions is that I started on the bottom right, if looking from behind the TV. Shouldn't be a problem, as I've set the direction in the config to clockwise, and all the LED numbers in the Hyperion Configuration Tool replicate how my LED strip is numbered/ordered.

I've got an email into them to see what's going on. Below is my output when manually starting hyperion, along with my config.

RasPlexLiving:/usr/bin # /usr/bin/hyperiond /storage/.config/hyperion.config.json
Application build time: Aug 31 2015 21:12:13
QCoreApplication initialised
Selected configuration file: /storage/.config/hyperion.config.json
ColorTransform 'default' => [0; 97]
Device configuration:
{
"colorOrder" : "rgb",
"name" : "MyPi",
"output" : "/dev/spidev0.0",
"rate" : 1000000,
"type" : "ws2801"
}

Black border threshold set to 0.01 (3)
Not creating any smoothing
Effect loaded: Knight rider
Effect loaded: Blue mood blobs
Effect loaded: Cold mood blobs
Effect loaded: Full color mood blobs
Effect loaded: Green mood blobs
Effect loaded: Red mood blobs
Effect loaded: Warm mood blobs
Effect loaded: Rainbow mood
Effect loaded: Rainbow swirl fast
Effect loaded: Rainbow swirl
Effect loaded: Snake
Effect loaded: Strobe blue
Effect loaded: Strobe Raspbmc
Effect loaded: Strobe white
Initializing Python interpreter
Hyperion created and initialised
run effect Rainbow swirl fast on channel 0
Boot sequence(Rainbow swirl fast) created and started
XBMC Connected
XBMC video checker created and started
Display opened with resolution: 1920x1080
Frame grabber created and started
Json server created and started on port 19444
Proto server created and started on port 19445
Message from XBMC: {"id":666,"jsonrpc":"2.0","result":[]}
XBMC checker: switching to OFF mode
Message from XBMC: {"id":668,"jsonrpc":"2.0","result":{"System.ScreenSaverActive":true}}
Message from XBMC: {"id":670,"jsonrpc":"2.0","result":{"version":{"major":12,"minor":2,"tag":"stable"}}}
effect finished

Config file (pastebin)
pastebin.com/S694gWBG


#5

I took your LED info and put it inside my working .json file and attached to to this message as I noticed a number of differences. A few of them could be the cause but I can't be sure as I am not near a Pi right now. After you have it working you can look at tweaking the gamma and smoothing to what you prefer right now it's running a variation of what I have been using at home.

Try this out and see what happens. You don't need to reboot the Pi just turning hyperion off and on again in the System Settings should suffice.


#6

@edddeduck said:
I took your LED info and put it inside my working .json file and attached to to this message as I noticed a number of differences. A few of them could be the cause but I can't be sure as I am not near a Pi right now. After you have it working you can look at tweaking the gamma and smoothing to what you prefer right now it's running a variation of what I have been using at home.

Try this out and see what happens. You don't need to reboot the Pi just turning hyperion off and on again in the System Settings should suffice.

Thanks, I uploaded that to my Pi2 and tested it. Still just the one LED. Did your kit also come with some extra cables? Mine came with a power cable splitter and another looks to be power for GPIO pins. Kinda throwing me for a loop what those are for.

When I killall hyperiond, then restart hyperion with the path of my config file, I can see the daemon fire up and even pull information of the video I'm playing (Episode Name, etc...).

Message from XBMC: {"id":668,"jsonrpc":"2.0","result":{"System.ScreenSaverActive":false}}
Message from XBMC: {"id":667,"jsonrpc":"2.0","result":{"item":{"file":"plexserver://c3e3c99eff5f10c4e8cd28ff04bf862891898298/library/metadata/12287","id":14348,"label":"**Jack B. Nimble Can't Sit Down**","type":"unknown"}}}
Message from XBMC: {"id":670,"jsonrpc":"2.0","result":{"version":{"major":12,"minor":2,"tag":"stable"}}}
BORDER SWITCH REQUIRED!!
CURRENT BORDER TYPE: unknown=0 hor.size=0 vert.size=0
effect finished
Message from XBMC: {"jsonrpc":"2.0","method":"Player.OnStop","params":{"data":{"end":false,"item":{"id":12287,"type":"episode"}},"sender":"xbmc"}}
XBMC checker: switching to OFF mode
Message from XBMC: {"jsonrpc":"2.0","method":"Playlist.OnClear","params":{"data":{"playlistid":1},"sender":"xbmc"}}
Message from XBMC: {"jsonrpc":"2.0","method":"Playlist.OnAdd","params":{"data":{"item":{"id":14348,"type":"episode"},"playlistid":1,"position":0},"sender":"xbmc"}}
Message from XBMC: {"jsonrpc":"2.0","method":"GUI.OnScreensaverActivated","params":{"data":null,"sender":"xbmc"}}

That said, I've got my GPIO alignment correct for the Pi2 - I've quadruple checked that :(


#7

Nope, mine only came with cables I needed. One from the Pi2 to the power splitter box, then a cable out to the LEDs and finally a separate power adapter for the LEDs.

  1. Did you plugin in the LEDS to the power box before you split them? If you did then they should have all lit up, when you cut them to size they only light up when you boot Hyperion.
  2. I know it's silly but you have checked you used the Pi2 connection location not the Pi+? I don't think you would have given your comments but I have to ask :)
  3. A picture of your Pi2 (where we can see the connections to GPIO) and the power converter box to the LEDs might help.

Good Luck!


#8

I don't have the LEDs cut to size yet. I have the remaining unused ones still connected on the spool.

I understand on double checking the GPIO jumpers are right - see the images below. :)

Weird cables

Converter box

GPIO connection


#9

@edddeduck - I see you're a fellow redditeer as well. I posted a more complete thread over there with hopes of drawing a larger audience while I wait on Jacek to reply to my support email. If you have time, maybe check it out to see if you notice anything. :)

reddit.com/r/Lightberry/comments/3kaaoj/rasplexlightberry_hd_woesonly_2_leds_lighting_up/


#10

@kars85 two things:
1. Change type from ws2801 to lightberry in your device configuration
2. The weird cables should be used to split the power and connected to the end of the led strip, the 5m led strip needs power from both ends

I have attached the config file I use with my 5m led strip


#11

@Kwiboo - wow, thanks!

I guess it would have been helpful from the get go if I would have unspooled all the LEDs from the reel. Unfortunately, now I get merely a flicker, only if I barely connect the DC power to the LED strip. I also changed the light type to lightberry as you suggested.

I've got a 4m set on the way, and I'm suspecting something in the chain of connections to be bad.

Question, though, how do folks trim the LEDs to length then? Do they re-solder the +/- wires from the power to the LED strip?


#12

@kars85 Unsure how to trim or it it actually need power from both ends, I have the unused part still on the reel behind the TV and connected the power on both ends from start.

@edddeduck Changing your toggle script to something similar will make systemd much happier.
It will also toggle the enabled/disabled state for hyperion in System Settings.
#!/bin/sh
SERVICE=hyperion
if systemctl is-active $SERVICE >/dev/null 2>&1
then
echo "Stop Hyperion"
systemctl stop $SERVICE
[ -f /storage/.cache/services/$SERVICE.conf ] && mv /storage/.cache/services/$SERVICE.conf /storage/.cache/services/$SERVICE.disabled
else
echo "Start Hyperion"
[ -f /storage/.cache/services/$SERVICE.disabled ] && mv /storage/.cache/services/$SERVICE.disabled /storage/.cache/services/$SERVICE.conf
[ ! -f /storage/.cache/services/$SERVICE.conf ] && touch /storage/.cache/services/$SERVICE.conf
systemctl start $SERVICE
fi


#13

@Kwiboo said:
kars85 Unsure how to trim or it it actually need power from both ends, I have the unused part still on the reel behind the TV and connected the power on both ends from start.

Ah I have a 4M LED setup hence my confusion on the extra bits. It all makes sense now.

edddeduck Changing your toggle script to something similar will make systemd much happier.
It will also toggle the enabled/disabled state for hyperion in System Settings.
#!/bin/sh
SERVICE=hyperion
if systemctl is-active $SERVICE >/dev/null 2>&1
then
echo "Stop Hyperion"
systemctl stop $SERVICE
[ -f /storage/.cache/services/$SERVICE.conf ] && mv /storage/.cache/services/$SERVICE.conf /storage/.cache/services/$SERVICE.disabled
else
echo "Start Hyperion"
[ -f /storage/.cache/services/$SERVICE.disabled ] && mv /storage/.cache/services/$SERVICE.disabled /storage/.cache/services/$SERVICE.conf
[ ! -f /storage/.cache/services/$SERVICE.conf ] && touch /storage/.cache/services/$SERVICE.conf
systemctl start $SERVICE
fi

I'll have a look at that, while you're making suggestions.... I have a question :) I would like to use the pop up notifications to have one displaying a Hyperion image (in colour for enabling and grey for disabling) using the notification system would you know the best way of doing that?

I found an example from openelec but it didn't work (or I could have been using it wrong). I think it would be a nice addition.

Finally can you share your HSV Saturation gain , HSV Value gain and RGB gamma, threshold, black and white level settings for your setup? I am trying to pull together a list of various settings so we can better come up with settings that work in various light levels and films.

I'd really like more data from people with Lighberries so I can build up settings that others use and compare them. I then might be able to improve my script so it rotates through "Day/Night/Movie/MusicVideo" modes for example.

Thanks,

Edwin


#14

@edddeduck I am guessing you have found some example using xbmc/kodi-send? If that is the case you should be able to use /usr/bin/xbmc-send --host=127.0.0.1 --port=9778 --action="<action>" instead, PHT is running on port 9778 and not the kodi default 9777.

My current config is attached a few posts above, I basically just used the values from the Lightberry HD install manual and tested modifying them a little bit. To be honest I have not use the Lightberry that much since I do not always enable hyperion when flashing a new dev build of RasPlex.
Looking forward to your findings on optimal configuration values.


#15

@Kwiboo said:
edddeduck I am guessing you have found some example using xbmc/kodi-send? If that is the case you should be able to use /usr/bin/xbmc-send --host=127.0.0.1 --port=9778 --action="<action>" instead, PHT is running on port 9778 and not the kodi default 9777.

If I ssh into my RasPlex (latest 1.6.1) and run the following command:

RasPlex:~ # /usr/bin/xbmc-send --host=127.0.0.1 --port=9778 --action="Notification(All Good)"

I get this returned in the terminal:

Sending action: Notification(All Good)

But nothing on the TV screen displays. I did a quick google search and apparently xbmc-send might be broken on RasPlex as far as notifications go. Have you ever tried getting a notification up and running? If not I might look at writing up a bug to see if it can get fixed or if an alternative exists.


#16

@edddeduck You need to specify two or more parameters to the Notification method, try:
/usr/bin/xbmc-send --host=127.0.0.1 --port=9778 --action="Notification(All Good,test)"


#17

@Kwiboo said:
edddeduck You need to specify two or more parameters to the Notification method, try:
/usr/bin/xbmc-send --host=127.0.0.1 --port=9778 --action="Notification(All Good,test)"

That did it thanks!

=========

I have updated the instructions with new scripts for the remote control thanks to @Kwiboo and his suggestions. I also added my working config file as an example for people who might be getting stuck and need something to compare against.


#18

I'am running Rasplex with Hyperion for a long time now. I bought a new receiver and now would like to run Hwulex switching script. Sometimes everything works, but the script is mostly crashing.

If I make a telnet connection with the receiver, the input is very accurate. So the script isn't always reacting correct and chashing.

@edddeduck Any idea?


#19

Hi all,

Anyone has updated to rasplex 1.0 and successfully used a lightberry HD ?
I've just bought mine (HD, 5m with an USB adapter and an HDMI splitter/grabber) and I can't get it to work (with the default configuration, those in this thread, or a made one based on the information on first post).

When I boot the raspberryPi (2), the led light up in red, green and blue but there is no "Rainbow swirl" effect.
I downloaded an OpenElec image from the lightberry website, and with the default configuration it works fine.

But the default configuration (the one attached) is weird ... device type is not lightberry, colorOrder is bgr, ...

Does anyone has a working config file for rasplex 1.0 ? Or any aother idea why my configuration is not working ?

Regards


#20

@Yoda6 said:
Hi all,

Anyone has updated to rasplex 1.0 and successfully used a lightberry HD ?
I've just bought mine (HD, 5m with an USB adapter and an HDMI splitter/grabber) and I can't get it to work (with the default configuration, those in this thread, or a made one based on the information on first post).

I have 1.0 upgraded from the previous builds and my LightberryHD is working just fine (using the setting file in the zip in the initial post) with no problems. Please note you won't see a rainbow swirl effect on booting the Pi (unless you enabled Hyperion) but it should trigger when you toggle Hyperion on and off as per my instructions in the initial post.

Good luck.