Setting Up Tvheadend on a Raspberry Pi 2 for US TV Antenna Reception
Introduction In this guide, I will walk you through the process of setting up Tvheadend on a Raspberry Pi 2 for use with a TV antenna in the United States. While I used a Raspberry Pi 2 for this setup, any newer model of the Raspberry Pi (3-5) should work. Please note that if you use a newer version of the Raspberry Pi (3 or newer), you can opt for the 64-Bit version for better performance. This setup allows you to stream and record over-the-air TV channels. While Tvheadend can also be used as a DVR service to save shows to a hard drive, this article focuses solely on the streaming capabilities of the app.
Requirements
Raspberry Pi
Micro SD card (with Raspberry Pi OS Bookworm 32-Bit installed)
Hauppauge 1657 USB TV tuner
Windows PC (for initial setup)
Optional
ClearStream 4MAX C4MVJ antenna
SSH client (e.g., PuTTY for Windows, ConnectBot for Android)
Step-by-Step Setup
1. Install Raspberry Pi OS
Download and install the Raspberry Pi Imager on your Windows PC.
Use the Imager to write Raspberry Pi OS Bookworm 32-Bit to your micro SD card.
Insert the micro SD card into your Raspberry Pi and power it on.
2. Install Tvheadend
Open a terminal on your Raspberry Pi or connect via SSH.
Run the following command to install Tvheadend: sudo apt-get install tvheadend
Note: Using the package manager might not prompt you to set up a username and password. If this happens, uninstall and reinstall Tvheadend using the terminal.
3. Initial Configuration
On any computer on your local network, open a web browser and go to http://raspberrypi.local:9981/.
Log in using the username and password you set up during installation.
Follow the Wizard for the initial setup:
Tuner and Network Wizard Menu: Select LG Electronics LGDT3306A VSB/QAM Frontend #0 : ATSC-T #0.
Assign Predefined Muxes to Networks: Choose Network: ATSC-T, Pre-defined muxes: United States: us-ATSC-center-frequencies-8VSB.
Map Services to Channels: Tick the box Map all services.
4. Advanced Configuration
Go to Configuration > Basic (Expert view level) under the Tvheadend tab.
Change the authentication type to plain to avoid errors when playing content in VLC and when using the software bellow to export the channel list.
5. Advanced Security
I recommend adding your local network IP addresses under allowed networks. Configuration > Users > Access Entries. Change View level to Expert. In the Allowed networks field enter your local network. This ensures that no one outside your local network can access the Tvheadend server. For example, on my server, I have 192.168.1.0/24,192.168.254.0/24. The .1 subnet includes all my network devices, and the .254 subnet is for my OpenVPN server.
See screenshots bellow for help
6. Viewing Channels
All your channels will be listed under Configuration > Channel / EPG.
To save a stream, right-click the Play icon and select Save link as.
Open the saved link in a text editor like Notepad++ and delete ?ticket= and all text after it.
Open the edited file in VLC. It will prompt you for your Tvheadend username and password.
On Android VLC, you can save your login credentials to avoid repeated prompts.
Optional: Exporting Channel List Automatically
I have created a program that will export the channel list automatically. Please read the README file on how to run the software.
You can download the software Here
sha256 hashes:
ExportTvheadendChannels.exe: EFB926DB8A438FB7FB5DABC1EF35EFBCDD2470FC104E759F8355548BE46FB1F1
run.py: 700558733B09BEE451C1131C7409DB936284C9DB48728695B0D5078A5AB69DF9
Changes in v0.0.3 (Sep.25.2024):
Prompt for hostname or IP address.
Prompt for port number.
Ask user if they want to download channels with the name {name-not-set}.
Channels with the same name will now save with a unique filename.
Changes in v0.0.2 (Sep.25.2024):
Changed host from raspberrypi to raspberrypi.local
Conclusion With this setup, you can enjoy over-the-air TV channels on your Raspberry Pi using Tvheadend. This guide should help you get started, but feel free to ask any questions to troubleshoot any issues you encounter.