Skip to content

Instantly share code, notes, and snippets.

@bgulla
Last active February 5, 2023 15:16
Show Gist options
  • Save bgulla/138d44933c1e5db4c7247059717425cd to your computer and use it in GitHub Desktop.
Save bgulla/138d44933c1e5db4c7247059717425cd to your computer and use it in GitHub Desktop.
Bad instructions on setting up a Hyperion DIY ambilight system

WLED Hyperion Ambilight Notes

Disclaimer

Nothing about this is turnkey. It's a mess of protocols, firmware and apps, but if you're the right kind of nuts, keep reading.

Required hardware

  • Power Supply Amazon $22
  • WS2812B Addressable RGB LED Strips Amazon $30
  • NodeMCU 8266 Amazon $6
  • AndroidTV - There are alternatives that include using a HDMI grabber and decoding the signal on a Pi/server directly, but this works for a 0.1 alpha attempt. I used a NVidia ShieldTV
  • Raspberry Pi/Linux/Windows computer/server to run Hyperion
  • Random Breadboard Wires Amazon $6

Wiring up the NodeMCU + LED strips

Everything you need to know is here

wiring diagram

Setting up WLED

Instructions

Installing Hyperion

  1. Download the binary that matches your server/package manager from https://github.com/hyperion-project/hyperion.ng/releases. Example: If you are running a raspberry-pi, you would run sudo dpkg -i https://github.com/hyperion-project/hyperion.ng/releases/download/2.0.0-alpha.7/Hyperion-2.0.0-alpha.7-Linux-armv7l.deb .

Configuring Hyperion

WARNING: This step requires a JVM. WARNING There is a web-ui for Hyperion. Unfortunately, I could not get it to save the config appropriately so I moved on to: HyperCon.

Steps: ** On a computer/server with a display/X11 forwarding**

  1. Download the Hypercon JAR from here.
  2. Run the JAR locally on a machine that you have a display/X11 forwarding turned on. (laptop, etc)
  3. run the jar java -jar ./Hypercon.jar
  4. Under Hardware change Type -> UDP (new-imp) (no i dont know what new-imp means). Set the output to <your_wled_ip>:19446.
  5. Under Grabber, disable both checkboxes.
  6. Under External, enable the Proto/Json Forward. Leave the other entries with their default values.
  7. Go back to Hardware: fill in the number of LEDs you have in horizontal, left and right.
  8. Under SSH. Find SSH- Send Hyperion Configuration. Click Local Config Path and download the hyperion config file to disk.
  9. SCP that file to your server with Hyperion installed and save the file under /etc/hyperion. (i.e. scp ./hyperion.config.json root@raspberrypi.local:/etc/hyperion/

/etc/hyperion/hyperion.config.json | head -n 30

This is what your config file should resemble...

{
	"device" :
	{
		"name"       : "MyHyperionConfig",
		"type"       : "udpraw",
		"output"     : "<WLED_IP_ADDRESS>:19446", 
		"rate"     : 1000000,
		"maxpacket"     : 1450,
		"protocol"     : 0,
		"colorOrder" : "rgb"
	}
...
}

On the Hyperion Server

  1. Assuming that the config file now lives in /etc/hyperion, restart the service with service hyperion restart.

Configuring WLED to receive Hyperion data

Once you have WLED up and running, you need to configure the correct UDP port for communicating with Hyperion.

Goto your webui for WLED (reminder, it runs on port 80). Click Settings -> Sync Interfaces -> WLED Broadcast. Set UDP Port = 19448, click save.

If Hyperion is running, you should be able to refresh your WLED page and it should display a message saying WLED is receiving live Hyperion data from x.x.x.x.

Grabbers

In order for Hyperion to process what is being displayed on your TV, it needs a way to capture the signal. If you are using an AndroidTV to watch your media, I would recommend the option 2: AndroidTV Grabber. For everything else (AppleTV, Xbox, etc) you will need to buy some sort of server/computer/raspberry pi and connect a USB capture card. While this method is more flexible in allowing you to process any HDMI source, it does require the server/rpi to be physically located near the HDMI device (or a really long cable)

Option1: Cheap HDMI-USB capture card

Buy me.

In Hypercon under Grabber:

  • Disable the Internal Frame Grabber
  • Enable GrabberV4L2. Select the appropriate /dev/video* and leave the rest set to default. Warning: for some reason the PAL or NTSC video-standard breaks my setup. After you export the hyperion.conf.yaml file, be sure to change the "PAL" entry to "" or run sed -i 's/PAL//g' hyperion.conf.yaml before starting hyperion.

Note: if you receive an error when starting Hyperion with this device, run the following command first: hyperion-v4l2 --screenshot --pixel-format YUYV. I will be adding this to a fixed systemd service file at some point.

Option 2: AndroidTV Grabber

Install the AndroidTV Hyperion Grabber

Once installed, fill in the following values:

Key Value example
Hyperion Host IP address of the Hyperion server 10.0.1.246
Hyperion Protobuf Port 19445 19445
Horizontal LED count Number of LEDs going horizontally (note: this is only for top OR bottom. Not the sum of both) 74
Vertical LED count Number of LEDs going vertically (note: this is only for left OR right. Not the sum of both) 42
Grab on boot Do you want it to always send the data? (yes) checked

Once you save, exit out to the main menu and click the power button to enable.

... Profit

Raspberry-Pi fix

apt install -y libcec-dev 
#port :8090

Badness

hyperion-v4l2 --video-standard NO-CHANGE --screenshot --pixel-format YUYV

TODO

  • Get Hyperion running in Docker/k3s.

Resources

@jandae
Copy link

jandae commented Nov 17, 2021

Great guide man! I would also want to add if you want to use Hyperion Grabber for android you should set the priority from 100 to 199 for it to work. I have set to to 150 and it's working great

@andreagalle
Copy link

andreagalle commented Jan 24, 2022

What about Option 2: AndroidTV Grabber when streaming from Netflix/Prime, i.e. any source behind DRM & HDCP ?
Aren’t them blocked and black screen send to WLED?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment