In the age of Netflix, watching live TV seems old school, but you can’t always find every show or movie you want on the streaming service. The alternative is to pay for cable or satellite TV, and who wants to do that?
Luckily, if you’re in a country with terrestrial TV broadcasts, you can cut the cord and record live TV on a Tvheadend NVR running a Raspberry Pi instead. Here’s how you do it.
What is Tvheadend?
Tvheadend is a live streaming server. It can handle DVB-T/T2 off-the-air TV streaming and recording like Freeview in the UK. It can also handle other forms of streaming TV including cable (DVB-C), satellite (DVB-S and DVB-S2), ATSC and IPTV.
This guide will focus on using Tvheadend with a DVB-T/T2 tuner for terrestrial TV, but many of the Tvheadend setup instructions will remain the same if you prefer to use Tvheadend to record TV from other input sources. ,
What you need
To set up your Tvheadend DVR, you will need the following:
- Raspberry Pi 2, 3 or 3B+ with case
- MicroSD card with Raspbian installed
- High quality power supply (5V @ 2.5A)
- USB DVB-T/T2 tuner for receiving OTA-TV or Raspberry Pi TV HAT
- Antenna DVB-T / T2
- Another PC for SSH connections with SSH client installed
Step 1: Preparing the Raspberry Pi
First you will need to install an operating system on your Raspberry Pi; This guide assumes you have installed the latest version of Raspbian Lite on a microSD card and your Pi has an internet connection. It is also recommended to run the usual commands on first boot to update the Pi and change the default password:
sudo apt update sudo apt upgrade passwd
Once your Pi boots up, connect the DVB-T/T2 tuner to your Pi (or connect to the GPIO pins if you’re using a HAT) and connect via SSH. Make sure your USB tuner is working:
Assuming this is the case, check that the firmware for your tuner exists and is loading:
dmesg | tail | grep dvb
If the command returns nothing (or no errors), your DVB-T/T2 tuner should be ready. If the command returns log snippets indicating that your firmware cannot be loaded, or the firmware files you need are missing, you need to download them.
The Git repository from the developers of OpenELEC, a Linux media center distribution, contains a large number of firmware files for various tuner chipsets. To install them on your Pi, run the following commands on your terminal and restart your computer:
sudo apt install git git clone https://github.com/OpenELEC/dvb-firmware.git cd dvb-firmware ./install sudo reboot
Step 2: Install Tvheadend
To install Tvheadend and any additional packages, type:
sudo apt install tvheadend
Enter Y and press Enter to agree to the installation. When you get started, you will need to provide a username for Tvheadend for administrative access after installing it. Enter a suitable username, then press Enter.
You will need to enter a password, so enter one and press Enter. The last menu contains information on what to do after installing Tvheadend to access the web interface through port 9981; just hit enter to continue with the installation.