Trying to connect to a VPN failed while running behind my OpenWRT router (Chaos Calmer) from a Windows LAN client.

Adding the following software package to the router resolved the issue;

kmod-nf-nathelper-extra

The original error was;

806: The VPN connection between your computer and the VPN server could not be completed. The most common cause for this failure is that at least one Internet device (for example, a firewall or a router) between your computer and the VPN server is not configured to allow Generic Routing Encapsulation (GRE) protocol packets. If the problem persists, contact your network administrator or Internet Service Provider.

I use my Chromecast regularly for all my media streaming, however it never allowed me to watch Live TV.
Why not consolidate the two? As I was already running a Plex server, adding a Live TV server into the mix would be ideal rather than using another PC.

Plex handles all the transcoding, meaning Live TV can be shown on the Chromecast, as well as any other device that supports Plex channels.

Setup

tvheadend

The TV server package I decided to use was tvheadend. It seemed to have the best support across all of the options I was able to collate — and it’s regularly updated too.

The server is running Debian, and tvheadend is provided as a package on the following repository. You’ll want to add this to the end of your /etc/apt/sources.list. Note that it needs to be the unstable version as the stable version is quite out of date;

deb http://apt.tvheadend.org/unstable wheezy main

The configuration was straightforward, with documentation provided on their Redmine wiki.

Sony PlayTV

This works reasonable well with a Sony PlayTV (dib0700) dual-digital tv tuner which you usually pick up off Gumtree or eBay for a reasonable price and works well with Australian TV.

You’ll want to put the firmware file (dvb-usb-dib0700.1.20.fw) for this tuner into the relevant /lib/firmware directory on your server;

http://www.linuxtv.org/downloads/firmware/#dibcom

I needed to disable the “Idle Scan” on each tuner through tvheadend as it was causing kernel panics after a few days of running. Power Save and Initial Scan are okay to use.

Plex Channel

To get tvheadend into Plex, we need to use a channel. There have been a few, tvheadend-ng which is available on GitHub. You’ll want to clone this into your Plex channels directory;

Configuration was simple, though one notable point is that if you’re using a reverse proxy with tvheadend, you’ll need to put the path after the port in the Web Port field.

Channel Images & Icons

The icons for the Plex Channel don’t appear correctly with security enabled on TVHeadEnd.

It’s a permission error. The trick is to whitelist for all users connecting from 127.0.0.1/32 to have full access. This assumes your Plex is running on the same server as tvheadend. You’ll need to amend your IP filter accordinglly. More detail on Gav’s blog.