Cord Cutting with a Raspberry Pi using a TVheadend Server
What is cord cutting?
Cord-cutting is any process that attempts to reduce the number of cables used in a media center setup. This tutorial will show a neat cord-cutting trick to get free OTA (over the air) television.
What you’ll need
- Raspberry Pi $80 Kit on Amazon
- USB TV Tuner $55 on Amazon
- TV Antenna $30 on Amazon
- Amazon Fire TV (Optional) $40 on Amazon
The whole setup has a one time cost of about $205 but there are some steps you can take to try to reduce this cost.
- If you already have most of the parts needed for using a Raspberry Pi you should purchase one of the less expensive kits that has less in it.
- Use an old TV antenna you may have around the house or you can even make your own.
- Amazon’s Fire TVs are often on sale especially during “Prime Day”
- Unfortunately, unless you happen to have a USB TV tuner laying around the house you’ll have to invest the $55.
1 Set Up the Raspberry Pi
Load an operating system onto a Raspberry Pi There are probably thousands of tutorials on how to do this. The most common OS for the Pi is Raspbian. I personally prefer DietPi because its lightweight and you can install a lot of very useful programs on there very easily.
2 Connect the USB TV Tuner and connect the TV Antenna
Simply plug in the USB TV Tuner into the Pi and connect the TV Antenna to the USB TV Tuner. Make sure to pick a good location for the TV antenna.
3 Install TVheadend
TVheadend is a great program that allows the Raspberry Pi to be used as a server that will let you get OTA Live TV anywhere in your house over WIFI or Ethernet. The Tvheadend website site offers a decent guide. on how to install it on the Raspberry Pi, but since I had some difficulty understanding it at first I’ll post a simple guide here that you can follow. You’ll first want to SSH into the Pi or open a terminal. Then type the following:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61
Executing: /tmp/apt-key-gpghome666/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61 gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory gpg: connecting dirmngr at '/run/user/0/gnupg/d.1234/S.dirmngr' failed: No such file or directory gpg: keyserver receive failed: No dirmngrThen you need to install dirmngr using:
sudo apt-get install dirmngr
Then retry the previous command. Then you need to add TVheadend to your repository.
echo "deb https://dl.bintray.com/mpmc/deb raspbianstretch stable-4.2" | sudo tee /etc/apt/sources.list.d/tvheadend.list
Then simply update your repositories and install TVHeadend!
sudo apt-get update sudo apt-get install tvheadend
4 Configure TVheadendOnce you’ve successfully installed TVheadend. You can go ahead and log into the TVheadend server from any browser. you’ll first need to know what the IP address of your Raspberry Pi is. Here is a good tutorial on how to get it from the desktop or terminal. From this point forward, you’ll want to replace “ipaddr” with whatever you’re Raspberry Pi’s IP address is. To access the TVheadend server go ahead and type the following in any browser:
You should be greeted with a login screen. Put the username and password that you chose previously here. Next, you want to make sure that your USB TV Tuner is being recognized by the Raspberry Pi. At the top you should see a menu; select “Configuration”, then “DVB Inputs.” You should then see your USB TV Tuner listed under “TV adapters.”
You can then go ahead and start the TVheadend wizard by clicking on “General” then “Start Wizard.” Below are the settings I used to get over the air TV in the US. depending on your location, these settings may need to be changed.
- Language: English (US)
- Language 1: English (US)
- Allowed network: [blank]
- Admin username: [choose an admin username]
- Admin password: [choose an admin password]
- Username: [choose a standard user username, * if you want to allow anonymous users]
- Password: [choose a standard user password, * if you want to allow anonymous users]
- Network 1: [blank]
- Network 2: ATSC-T (only one that shows up)
- Network 3: [blank] (optionally pick ATSC-C but these are not standard OTA frequencies)
- Standard Muxes (ATSC-T): United States: us-ATSC-center-frequencies-8VSB
TVheadend will then start scanning for channels, wait for 100% completion before selecting next. You then want to select the option to “map all channels”, then click “finish”. Congratulations! You’ve configured TVheadend. Now we can test out the connection.
5 Connect to your Live TV!
To connect to the TVheadend server you’ll a “client” program. Below is a list of some of my favorites.
- VLC Media Player
- TVHClient for Android
- TVHClient for iOS
To play your OTA TV Channels on VLC Media Player, you have to download the playlist from your TVheadend server simply by typing the following in your browser:
If you only made an admin account and don’t want to be hassled to put in the username and password every time you change channels you can use:
Where USERNAME is your username, PASSWORD is your password, and ipaddr is the ip address of your TVheadend server. This should start a download of a file called “channels.m3u”. If you open this file, VLC Media Player should automatically play the first stream on the playlist. You can then go ahead and choose another Live TV stream by clicking on “View” then “Playlist” or use the keyboard shortcut
"Ctl + L" and then double click on the stream that you want to play.
6 Configure Amazon Fire TV with Kodi (Optional)
If you want to get the live TV to play on a large TV screen there are a few options:
- Connect your computer to the larger TV screen via HDMI
- If you have a “Smart TV” you may be able to share your phone screen wirelessly onto the TV.
- Download a TVheadend client on an Android OS enabled device.
I personally prefer the last one and will describe some general guidelines to do this. Since the Amazon Fire TV is a custom version of the Android OS called Fire OS, it is a great candidate for getting a TVHeadend Client on your big screen. Below are some great tutorials that should help get you started with getting a great TVHeadend Client on your Fire TV.