Introduction: My Cord Cutting System

[Updated and moved here]

My goal in cord cutting is to significantly reduce cable TV's very high monthly fees and still have desired channels, services and features. This instructable describes my cord cutting system.

My cable TV provider gives access to almost 900 channels. My family doesn't need 900 channels. Half of the 900 are standard definition - none of these are needed. I have disabled 811 of the almost 900 channels offered. And of the remaining channels, my family watches 20% of those. I only want to pay for the services, channels, and features my family watches.

I get an itemized bill for internet and TV. My TV bill with fees and taxes are as follows:

$60.00 for TV and HBO
$ 6.88 for taxes
$12.09 for surcharges
=====
$88.97 Total

My cord cutting total monthly bill:

$24.99 for Sling TV
$15.00 for HBO
$ 2.50 for taxes
=====
$42.49 Total

In both cases, I have NetFlix and Amazon Prime.

I tried many different approaches, and this worked for me.

Step 1: My Requirements

My requirements for cord cutting are:

  • Play content from premium internet TV, such as SlingTV, DirecTV Now, PlayStation Vue
  • Play content from a premium service, such as Hulu, Netflix, Amazon or iTunes
  • Minimal monthly fees, and no fees for:
    • DVR or PVR
    • Set top box or remote
    • Surcharges
    • Taxes
    • Broadcast TV or OTA TV (over-the-air, off-the-air)
  • Pay for as much Digital Video Recording (DVR) or Personal Video Recording (PVR) storage as I want
  • Pay for as much simultaneous live or recording channels as I want
  • Watch in any room that has a TV, projector or computer
  • Watch on a wired or wireless connection (802.11AC AP)
  • Watch live events on broadcast TV as they happen
  • 1080p or HD TV
  • If I am a few minutes late to a broadcast show, I want to able to rewind and watch from the beginning rather than waiting N hours after the show ends
  • Pick desired services and cancel unwanted services on a monthly basis without penalty
  • Low-cost setup (missed this requirement)
  • Required cable channels (Roku with SlingTV Orange + DVR $25/mo or DirecTV Now (Live a little with HBO $43.30/month, PlayStation Vue Access Slim with HBO $44.90):
    • Comedy Central (The Daily Show) (not on PSVUE)
    • AMC (The Walking Dead)
    • TBS (Full Frontal with Samantha Bee) (not on PSVUE)
    • ESPN (on Orange, but not Blue)
    • CNN
    • HLN (not on Sling)
    • HBO (This Week Tonight, Game of Thrones, ...)
    • HGTV (Fixer Upper)
  • SlingTV Orange has all my required channels, but only provides one stream. Blue doesn't have all my required channels and a bunch I don't want but allows 3 streams. Ala Carte, well not really.
  • Allow multiple people to watch at the same time (Sling Blue)
  • Broadcast TV (Raspberry Pi running Kodi / OSMC connected to PC running TVheadend):
    • ABC, CBS, CW, Fox, NBC, PBS - Broadcast TV via TVheadEnd
  • Have the same service in every room - don't use different remotes, different devices, etc.
    • Common universal remote
  • Theatre quality TV - no choppiness, no pauses while loading, and so on

Step 2: Gather Parts

These are the basic components of my cord cutting system. I am not advocating these are the best components, just that they work for me:

  • Home Theatre: Projector, Surround sound audio system, Home Theater PC / Media Center
  • TV, laptop, tablet, smartphone
  • Blu-ray/DVD Player
  • Premium content (Sling and Netflix) and internet TV:
    • Roku Ultra
  • Broadcast TV:
    • Raspberry Pi with IR Receiver running Kodi on OSMC to play broadcast TV
    • PC running ubuntu with TVheadend and 4 955Q Hauppauge TV Tuners
    • Digital Antenna
  • Universal Remote to control all of the above:
    • Logitech Harmony 650

Most of the components are self-explanatory and you can use whatever you have or prefer.

I wanted to make an all Raspberry Pi system. In creating this system, I tried many variations and combinations of hardware and I found that without a PC Class computer a Raspberry Pi 3:

  • Cannot support premium services (e.g., DLNA, NetFlix, Hulu)
  • Cannot play multicast TV (e.g., Raspberry Pi cannot run VLC)
  • Cannot run TVheadend with high quality

Roku is a plug-and-play kind of set up. The instructions are very straightforward. So, tThe focus of this instructable is Broadcast TV

In the future, I hope one of the following happens:

  • Roku supports TVheadend, or
  • Raspberry Pi 4 supports premium content

Notes:

  • Text enclosed in spades is meant to be replaced by your data, ♣username♣
  • The instructable editor messes up HTTP links and anything enclosed in angle brackets

Step 3: TVheadend: Install Ubuntu on PC

Link to TVheadend ubuntu PC 2019 update, or here are the original steps:

Cord cutting systems require a frontend and backend. If the system is powerful enough and it is only required in one room, then it can be all on one system. In my case, I have seven rooms with TVs. So, I need a powerful backend computer (TVheadend PC) and a low-cost, distributed front-end computer (Raspberry Pi in each room).

A relatively high performing PC is required to run TVheadend with four TV tuners. I am not sure what the minimum specs are, this is what worked for me.

PC Hardware

A few years ago, I bought my son a gaming computer with the following characteristics:

  • CPU model name: AMD A6-3620 APU with Radeon HD Graphics
  • # of Cores: 4
  • CPU speed: 2.2GHz
  • Cache: 1MB
  • HD: 1TB
  • RAM: 4GB

He managed to collect over 1,000 viruses when he said it didn't work. He bought himself a new PC and gave me this one back.

Install Ubuntu

Download the latest version of Ubuntu's iso image and move to USB drive.

Update: In early August 2018, I updated from ubuntu16.04 to Bionic 18.04.1. When I upgraded, the system would randomly freeze. I couldn't figure out the cause from the logs. I reran the update instructions a few times, and the freezing seems to have stopped ... hopefully.

When the freezing started, I thought I would need to redo the ubuntu PC from scratch on 18.04.1. So, I downloaded it and created a thumb drive with the iso image. But the system couldn't boot from that. I tried burning a CD several times and I kept getting a failure on verifying the data.

There is a version of tvheadend for bionic.

Insert the USB drive into the PC

Boot the PC

Press and hold F10 while booting to get to setup utility (F9 resets BIOS to default)

Change the boot order

Put USB drive first

Accept changes

Save changes and exit

Install the latest version of Ubuntu

Follow directions (don't encrypt anything, you want speed out of this PC)

  • Pick language
  • Check box: Download updates while installing Ubuntu
  • Check box: Install third-party software ...
  • Continue
  • Erase disk and install Ubuntu
  • Checkbox: Use LVM ...
  • Install Now
  • Continue in UEFI mode
  • Continue
  • Set time zone
  • Continue
  • Select keyboard layout
  • Continue
  • Enter your name
  • Change computer's name to something reasonable
  • pick a username
  • Enter your password twice
  • Set radio button: Log in automatically
  • Continue

After you press Continue, Ubuntu installs. Depending on your internet bandwidth, disk drive, and CPU speed, ubuntu takes a while to install (for me 13 minutes). Go do something else

  • Remove USB Drive
  • Restart Now

You should be in ubuntu desktop

Step 4: TVheadend: Use SSH

Use ssh so the tvheadend server can run without a monitor

Install and start ssh

$ sudo apt-get install openssh-server
$ sudo service ssh restart 

Step 5: TVheadend: Access Computer by Name

I don't remember IP addresses. I prefer to refer to servers by their name

  • Note: underscores should not be used in hostnames. avahi will not work with underscores, use dashes instead. For the tvheadend server ♣hostname♣, I am using = tvheadend

Avahi is installed on ubuntu, and allows me to ssh into the TVheadend PC using:

$ ssh ♣username♣@♣hostname♣.local

For me, it is easier to refer to a server by ♣hostname♣.local.

Avahi should already be installed. So, skip to the next step.

Running the commands below won't do any harm and will show the latest version is installed:

$ sudo apt-get install avahi-daemon

Try pinging the device

$ hostname
♣hostname♣
$ ping ♣hostname♣.local

Run this command to find your ♣hostname's-IP-address♣:

$ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:64:56:82             
          inet addr:♣hostname's-IP-address♣  Bcast:192.168.1.255  Mask:255.255.255.0<br>

If you would like to change the hostname do the following, otherwise, go to the next step

$ sudo nano /etc/hosts

My local area network is 192.168.1.x. My hosts file is:

127.0.0.1	localhost
127.0.1.1	♣hostname♣

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

CTRL-O, CTR-X, ENTER to save and exit the editor

The hostname file should contain just one entry:

$ sudo nano /etc/hostname
♣hostname♣

CTRL-O, CTR-X, ENTER to save and exit the editor

If you changed the hostname, then reboot

$ sudo reboot

Step 6: TVheadend: Install TV Tuner Utilities

Open a browser window and go to this instructable on your Ubuntu machine. It is much easier to cut-and-paste from this instructable, then to flip back and forth between computers.

Search your ubuntu PC for terminal

Drag the terminal icon to the dock

Open a terminal window

Install TV Tuner utilities:

$ sudo apt-get install dvb-apps dvblast w-scan -y

Step 7: TVheadend: Don't Type in Password on Every Sudo

$ sudo nano /etc/sudoers

Without the following change you will have to enter a password each time sudo is used.

After the comment, #includedir ..., add the line that starts, ♣username♣ ALL=:

#includedir /etc/sudoers.d 
♣username♣ ALL=(ALL) NOPASSWD: ALL 

CTRL-o, ENTER, CTRL-x to save and close the file

Step 8: TVheadend: Install TV Tuner

Attach the TV Tuner and reboot

$ sudo reboot

Login to and run the command to check if tuner is recognized.

Open a terminal window

$ dmesg | grep dvb
[    4.232615] cx231xx 1-1.5:1.1: Successfully loaded cx231xx-dvb
[    4.232639] cx231xx 1-1.5:1.1: Cx231xx dvb Extension initialized

If there are issues such as a missing driver, then you have the wrong TV Tuner or the wrong version of the kernel or ubuntu installed. With a different TV Tuner, I spent a lot of time trying to resolve these issues by downloading drivers and rebuilding the kernel. It really wasn't worth the time. I returned the tuner to Amazon and got the right one. So, much easier.

Another way to check if it is working is to run the command:

$ ls /dev/dvb
adapter0

If you don't see the above, then stop and start over. If starting over be sure to use the correct parts.

If you do see the above, then continue.

Step 9: TVheadend: Install & Setup

Install TVHeadEnd (only says it supports 16.04)

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61
$ echo "deb <a href="https://dl.bintray.com/tvheadend/deb"> <a href="https://dl.bintray.com/tvheadend/deb"> https://dl.bintray.com/tvheadend/deb </a> </a> xenial stable-4.2" | sudo tee -a /etc/apt/sources.list 
$ sudo apt-get update
$ sudo apt-get install tvheadend

Enter ♣username♣ and ♣password♣ for TVHeadEnd

Open browser and enter (remove spaces around the colon, :)

http : //localhost:9981

Login with ♣username♣ and ♣password♣ for TVHeadEnd

Follow directions, enter your preferred languages

Click Save & Next a couple of times to get to next screen

Enter allowed network, mine 192.168.1.0

Read the directions and enter ♣admin_name ♣ and ♣admin_password♣

I allowed anonymous access for a user * *

Click Save & Next

My Hauppauge WinTV HVR 955Q shows up as LG Electronics ...

The 955Q supports both Cable (C) and Terrestrial (T) networks. I am only going to use ATSC-T

Click Save & Next

Select your pre-defined muxes. For the US: United States: us-ATSC-center-frequencies-8VSB

Click Save & Next

Now it scans for a while. Go do something else.

When it is done, click Save & Next

Map all services and Create provider and network tags

Click Save & Next

Click Finish

In the upper right, Click Watch TV

Select a channel and it should work!

Step 10: TVheadend: Configure

The muxes marked as OK are the ones where one or more stations were found

  • In TvHeadEnd go to Configuration : DVB Inputs : Muxes
  • I deleted all the failed muxes
  • If Scan Result shows FAIL, click on that row and then delete

Disable unused stations

  • In TvHeadEnd go to: Configuration: DVB Inputs: Services
  • All the stations found should be enabled
  • Uncheck those you don't want to watch
  • Click Save

Disable stations in the Electronic Program Guide

  • TvHeadEnd go to Configuration : Channels / EPG : Channels
  • All the channels should be enabled
  • Uncheck those you don't want to watch
  • Click Save

Step 11: TVheadend: Remote Access

TVheadend will operate headless (i.e., not connected to a monitor). Most ubuntu features can be accessed from the command line.

To access TVheadend remotely, in a browser use (remove the spaces around the colon):

http : //192.168.1.110:9981

At first, I only installed one TV Tuner, then I added three more.

Each time I added another TV Tuner, I followed the directions in the previous two steps, except I accessed TVheadend from my MacBook.

Step 12: Tvheadend: Cron

There is no point in having the TV tuners and TV headend running all of the time. Also, after a while the recordings start to accumulate. So, add a cron to delete recordings older than 14 days

Add a cron job to reboot the tvheadend server every night at 2am.

$ sudo crontab -e

and add the following lines:

# restart everyday at 2am
0 2 * * * sudo reboot

# remove recordings older than 14 days
# the following doesn't really work. The recordings still show in TVheadend
# 0 1 * * * sudo find /home/hts/* -mtime +14 -exec rm {} \;

CTRL-o, ENTER, CTRL-x to save and close the file

Step 13: Raspberry Pi: Running Kodi / OSMC

Setup Kodi / OSMC

Download the latest Raspberry Pi 3 disk image for OSMC from here

Once downloaded, double click on the file (OSMC_TGT_rbp2_20170504.img.gz) to expand it (OSMC_TGT_rbp2_20170504.img)

Insert a Micro SD Card into USB card reader, and insert the USB into the MacBook

Run Etcher to burn the image to the Micro SD Card

For whatever reason, on my MacBook, Etcher doesn't eject the USB disk

I close Etcher and then eject the disk

Insert Micro SD Card, ethernet connection, HDMI and keyboard/mouse into Raspberry Pi, and finally insert the power cord. If you have fast wi-fi, you can use that. I have my Kodi/OSMC Raspberry Pis using wired connections.

The OSMC directions are very straightforward

  • Choose your language
  • Choose your continent and time zone
  • Change the hostname (mine are osmc-room-name)
  • Accept
  • Accept SSH service is enabled
  • Continue
  • I am old, so I pick Classic UI (skin = Estuary)
  • Exit

Add TVheadend

Go to Add-ons, My Add-ons, All

Add Tvheadend HTSP Client by Adam Sutton ...

Configure TVheadend

TVheadend is controlling several TV Tuners running on a PC. The PC is running ubuntu.

IP Address: 192.168.1.110

HTTP: 9981

HTTPS: 9982

Username: ♣your-username♣

Password: ♣your-password♣

Set auto-update to on

Enable

Reboot

Go to My OSMC, Pi Config, Hardware Support, and Enable LIRC GPIO Support, OK

ADD THIS: this can be set in kodi: dtparam=gpio_in_pull=up

Reboot (Power, Reboot)

Go to TV and it should work!

If you need to set up Wi-Fi on Kodi use these instructions

Step 14: Raspberry Pi: Find Host by Name

I don't remember IP addresses. I prefer to refer to servers by their name

  • Note: underscores should not be used in hostnames. avahi will not work with underscores, use dashes instead. My hostnames are of the form: osmc-room-name

Avahi is installed on OSMC, and allows me to ssh into a Raspberry Pi using:

$ ssh osmc@♣hostname♣.local

For me, it is easier to refer to a Raspberry Pi by its ♣hostname♣.local.

Avahi should already be installed and this should all work. So, go to the next step.

If you can't ssh in with hostname, then here are the instructions. Running the command won't do any harm and will show the latest version is installed:

$ sudo apt-get install avahi-daemon

Try pinging the device

$ ping ♣hostname♣.local

Run this command to find your ♣hostname's-IP-address♣:

$ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:64:56:82
          inet addr:♣hostname's-IP-address♣  Bcast:192.168.1.255  Mask:255.255.255.0

If you would like to change the hostname do the following, otherwise, go to the next step

$ sudo nano /etc/hosts

The hostname should default to dietpi. Change the last line from dietpi to the new ♣hostname♣

♣hostname's-IP-address♣     ♣hostname♣

CTRL-O, CTR-X, ENTER to save and exit the editor

$ sudo nano /etc/hostname

♣hostname♣

CTRL-O, CTR-X, ENTER to save and exit the editor

Commit the changes to the system

$ sudo insserv hostname.sh 
$ sudo reboot

Step 15: Raspberry Pi: Change OSMC Password

Run the following command to change the default password from osmc:

$ passwd

Step 16: Raspberry Pi: Add MPEG-2 License for to Enable Hardware Decoding

I keep getting a thermometer alert on the screen and an occasional OSMC sad face reboot. I suspect the two are related. So, I bought and installed an MPEG-2 license key to enable hardware decoding of the Broadcast TV MPEG-2 stream from the tvheadend tuners.

Open a terminal window and login to raspberry pi, something like:

$ ssh osmc@osmc-room-name.local

Run the command to get the serial number of your Rasppberry Pi's processor:

$ cat /proc/cpuinfo

Go to the following site and purchase an mpeg license key, and then wait up to 72 hours (even though it says you can download key immediately)

http://www.raspberrypi.com/mpeg-2-license-key/

When your license arrives, edit the following file:

$ sudo nano /boot/config.txt

decode_MPG2=your-license

CTRL-o, ENTER,CTRL-x to save and exit the editor

To ensure hardware decoding is being used, restarted the Raspberry Pi

$ sudo reboot

And run the command and it shoulw show MPG2 is enabled:

$ vcgencmd codec_enabled MPG2
MPG2=enabled

Step 17: Raspberry Pi: Build a Kodi / OSMC Hat With IR Receiver and Reset Button

This instructable provides steps to add an infrared receiver and reset button to a Raspberry Pi hat. Build the hat and then add the hat to your Raspberry Pi.

On the TV, go to My OSMC : Pi Config : Hardware - to determine GPIO pins used mine are in=18, and out=17
Enable LIRC GPIO Support

OK

Reboot

This instructable shows the code that needs to be added to enable the features of the hat

Step 18: Raspberry Pi: Put in a Case

This instructable shows how to put everything in a case.

Step 19: Raspberry Pi: Kodi Music and Videos

Add Videos (or Music)

My media server is a Home Theatre PC (HTPC) running Windows 7.

In Kodi,

  • go to Videos : Files : Add videos : Browse : Add network location

Windows network (SMB)

Name or IP Address

username

password

  • add videos

I was able to connect to my media server using a Windows Work group, but after awhile it stopped working. This website has some tips on getting it to work

On Windows 7 server, Create a Homegroup

  • Go to Start Menu: Control Panel
  • Type Homegroup in the search box
  • Click on Homegroup
  • Click on Create a Homegroup
  • Note and change password
  • Select the Libraries to share (Videos, Music, Pictures)

Go to your Music, Videos and Pictures folders, right-click and share with Homegroup (Read/Write)

On Windows 7 server:

  • Go to Start Menu: Control Panel

  • Type Homegroup in the search box

  • Click on Homegroup

  • Select: Leave the homegroup. Ignore the warning (Leave homegroup, and Finish)

  • On page, "Share with other home computers running Windows 7."

  • Select: Change advanced sharing settings

  • Network Discovery: turn on network discovery

  • Media Streaming: Turn on

  • Public folder sharing: Your choice. It can be on or off.

  • File and printer sharing: turn on

  • Password protected sharing: Turn off password protected sharing

  • Allow Windows to manage my homegroup connections

Step 20: Raspberry Pi: Kodi Weather

In Kodi, go to

  • Settings
  • Add-ons
  • Install from repository
  • Weather information
  • Yahoo! Weather
  • Install

Then configure Yahoo! Weather by entering the largest city near to you

It should work, but if it doesn't make sure any other weather apps are disabled, and click on the Use icon

Step 21: Raspberry Pi: Cron

I want to free up the tv tuners when not in use, one way is to reboot every night.

First, install cron

$ sudo apt-get install cron 

Then edit the crontab

$ sudo crontab -e 

and add

# restart everyday at 2am
0 2 * * * sudo reboot

CTRL-o, ENTER, CTRL-x to save and exit the editor

and then restart the service

$ sudo service cron restart

Step 22: Logitech Harmony 650 Remote: Control TV, Roku and Raspberry Pi

I tried many different remote controls. I tried cheaper ones. I tried lirc and flirc. My favorite is the Logitech Harmony 650.

Download and install the Logitech's MyHarmony app. The app is self-explanatory.

To setup your devices (TV, DVD, Projector, Raspberry Pi, and so on) you need to know the manufacturer and model number.

The Raspberry Pi is a bit unique. I couldn't find anything that worked properly. So, I setup the Raspberry Pi as an Apple TV. Apple Remote A1294 controls Apple TV A1378. A1294 remote is preloaded in Kodi.

In my setup, the Raspberry Pi runs Kodi on OSMC and is really only used for broadcast TV.

Within the MyHarmony App, do the following to setup the Raspberry PI:

  • Add Device:
    • Manufacturer: Apple
    • Model: A1378
    • The A1378 corresponds to the Silver Apple Remote
    • Rename the device to Raspberry Pi
  • Add activity Watch TV
    • The TV should control volume
  • running Kodi as Watch Apple, rename to "Broadcast TV", manufacturer: Apple, model: A1378, select Apple Silver remote from Kodi,

Setup the rest of the devices using manufacturer and model number. Add activities. Sync, and then go back and edit On Screen buttons and physical buttons, and sync again. I remove the premium buttons (NetFlix, ...) and add Options, Home, Menu, Select and direction buttons to on screen

To continue setting up the 650 to control the Raspberry Pi, on the TV with it connected to Raspberry Pi and with a mouse and keyboard connected to a Raspberry Pi:

  • go to My OSMC : Pi Config : Hardware - to determine GPIO pins used.
  • My GPIO pins are in=18, and out=17
  • go to My OSMC: Pi Config: Remote - select the remote Apple Silver Remote A1294

Enable LIRC GPIO Support OK Reboot

Step 23: Roku: Disable SSID

Roku broadcasts its own SSID so the Roku remote can connect. Roku calls this feature Wi-Fi Direct.

Once the universal remote is configured, disable the Roku's SSID. There is no real reason to do this step. Disabling the SSID doesn't make the network more secure, and a broadcast SSID doesn't use significant Wi-Fi bandwidth.

Turn on the Roku, go to the home page, and go to: Settings: System: Advanced system settings: Device connect: Disable Device connect

Step 24: Appendix: Troubleshooting

Kodi OSMC locks with message "Mouse not supported"

I have auto-update enabled. I am not sure what caused the Raspberry Pi to lock with the message Mouse not supported, but apt-get update and upgrade (dist-upgrade), followed by a reboot fixed

Upgrade from 17.04 to 18.04

I upgraded ubuntu from 17.04 to 18.04 following the directions in this link


System goes to sleep after auto-update

03FEB2019: I gave up desktop ubuntu and moved to ubuntu server, which doesn't go to sleep. The new instructions are here Setup TVheadend on ubuntu PC

Attempts to stop ubuntu desktop from going to sleep prior to 03FEB2019:

After an auto-update, tvheadend didn't see to be working. Rebooting showed everything to be running as expected but after 20 minutes of inactivity the system would go to sleep or hibernate. I ran the following commands recommended by this link:

gsettings set org.gnome.desktop.session idle-delay 0

sudo systemctl mask sleep.target suspend.target hibernate.tar

I am not quite sue what happened, but after several power outages. The system would shut off at random times during the day. The changes above didn't fix the issue. Disk utilities didn't find any corruption. dmesg didn't show anything wrong. I edited the file to find when it stopped logging, and looked at last process running:

$ sudo nano /var/log/syslog

One of the last lines referred to:

Started Network Manager Script Dispatcher Service

and the following were trying to use ipv6. Since I don't use ipv6, I edited the file:

$ sudo nano /etc/sysctl.conf

and added the following lines at the end:

#Disable IPv6
net.ipv6.conf.all.disable_ipv6 = 1

net.ipv6.conf.default.disable_ipv6 = 1

net.ipv6.conf.lo.disable_ipv6 = 1

net.ipv6.conf.eth0.disable_ipv6 = 1

The system has stayed up for a couple of days