Getting Started with the Raspberry Pi TV HAT

Getting Started with the Raspberry Pi TV HAT

In this tutorial we're going to set up the Raspberry Pi TV HAT to receive DVBT or DVBT-2 signals through a media centre setup using LibreELEC and Kodi.

You will need:

  • A Raspberry Pi TV HAT (which comes with spacers, screws and an adapter)
  • A Raspberry Pi 2B, 3B or 3B+ (we're using a 3B+)
  • A pre-loaded SD card with LibreELEC
  • An RF coaxial cable
  • A micro USB power supply
  • A HDMI cable
  • A keyboard and mouse
  • A TV monitor
  • A wifi connection
  • Another networked computer (either another Raspberry Pi, PC or Mac)
  • A small flat head screwdriver.

Adding the TV HAT to your Raspberry Pi

Mount two spacers onto your Raspberry Pi using two of the screws:
Add the header onto your Raspberry Pi pins. This gives the TV HAT a bit of space between itself and the POE pins on the Pi.
Push the coaxial adapter into place on the TV HAT:
Push the TV Hat board into position on top of the Raspberry Pi pins.
Add two more screws onto the top of the TV Hat to secure it into place
Plug in the coaxial cable into the adapter and connect the other end into an aerial socket.

Setting Up LibreELEC

Now we can power up our Pi and connect it to the TV! Insert your pre-loaded LibreELEC SD card into the slot. Plug in the keyboard, mouse, HDMI cable and connect the micro USB power cable.
Once Kodi loads up you should be presented with the Welcome Screens. Firstly, click next:
Now you can change the hostname of your Kodi instance. We've kept ours to the default "LibreELEC" but feel free to pick a fancy name if you like. Click next when you've chosen:
Now we can choose our internet connection. Click on the local router, ours is the Plusnet one:
Click on "Connect" and then enter your password when prompted to connect to your chosen network:
Once connected, Kodi will give you an IP address. Make a note of this, we're going to need it in a little while! Click next.
Samba  is enabled by default, and we've chosen to enable SSH as well, so we can remotely control the Kodi box from other machines. It's worth doing at this stage if you think you might need it. Click next once you've chosen.
You've finished the setup stage! Hit next and we'll move onto installing the add-ons which will use the Raspberry Pi TV HAT.

Installing TVHeadend Server and TVHeadend HTSP Client

We now need to install a server/client setup to receive and process the signals coming from the TV HAT. For this we will use the TVHeadend add ons.

In the main menu, scroll down to Add-ons:


Now click on "Install from repository."

Now click on "LibreELEC Add-ons"

Then click on "services":

Scroll down to "Tvheadend Server 4.2" and click on it.

Finally click on "install" and then click the most up-to-date version. For us this was version 8.2.113.

Once this has installed, use backspace to navigate back up to the Add-ons/LibreELEC Add-ons menu and navigate into "PVR Clients" and choose "Tvheadend HTSP Client".

Once again, click install on this add on and pick the most up-to-date version. For us this was version

Once these two add-ons are installed we can set up the TVHeadend Server.

Setting up the TVHeadend Server

Remember the IP address we noted down earlier? Now is the time to use it! Move onto your networked machine (in our case an Ubuntu machine, but it can be a Windows PC, a Mac or another Raspberry Pi).

Open up a web browser and navigate to: YourIPAddress:9981 where YourIPAddress is the IP address you noted down before. You should end up at this screen, so choose "English GB" as your language. Click "Save and Next".

Now it's time to choose an admin login and password. Remember what these are (don't use our awful example, be safe people). Click "Save and Next"

At this point, if your TV HAT is connected correctly, you should see "Sony CXD2880 #0 : DVB-T #0" appear in the list of available tuners. Use the drop down below the tuner to choose "DVB-T Network". Click "Save and Next"

Next we need to choose a "Pre-defined muxes".  For this we need to find out where is the closest Digital TV transmitter, which you can find out using Digital UK's Coverage Checker. Type in your Postcode and house number and it will tell you which is the closest. For us, this was Sandy Heath. Once you've selected a transmitter, click "Save and Next".

The server will now immediately scan for available channels from this transmitter. It might take a little while, but you should see Muxes and Services increasing. We ended up with 9 Muxes and 150 Services. Click "Save and Next" once the scan has completed.

Now there should be a list of channels available and a "Service mapping" box. If you have children who potentially will be using this Kodi box, be careful not to check the "Map all services" button as there are some *ahem* grown up channels which you may not want to receive. We could recommend following the manual mapping advice and selecting channels which will be suitable for all viewers. These channels can also be un-mapped at a later date.

For now, we will select "Map all services". Click "Save and Next".

You're done in the backend! Once you hit the "Finish" button, you will be prompted to log in with your admin username and password.

Setting up the TVHeadend HTSP Client

The server is now setup and ready to receive a signal through your Raspberry Pi TV HAT.

We need to add a few more settings into the HTSP Client before things like the Electronic Programme Guide (EPG) will work.

Move back onto your LibreELEC Raspberry Pi with the TV HAT attached.

Go to the Main Menu and choose Add-ons then My Add-ons, PVR Clients and finally Tvheadend HTSP Client.

Click on "Configure".

Enter the IP address of this Raspberry Pi, the one we noted down earlier, along with the Username and Password we chose for admin rights when setting up the server. Click OK. At this point, you may need to restart your Raspberry Pi.

Watching TV

Now head to TV then Channels or Guide and sit back with a lovely cup of tea and enjoy watching Lord Sugar in the Apprentice (other shows are available, loads of them infact!).

Click on the show you'd like to watch and away you go!

We also have a tutorial for Getting Started with OSMC if you're setting up your media centre using OSMC.

Leave a comment

All comments are moderated before being published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.