Overview

Using a Raspberry Pi micro-computer as a DVR to record free over the air HD channels.

Overview

A semi-detailed guide on how to setup a DVR using Raspberry Pi 3 to watch and record free over the air HDTV.

These instructions will allow 2 simultaneous programme recording while watching another already recorder programme.

It aims at providing and addressing the following:

Bill of Material

LibreELEC Install

Download from https://libreelec.tv/

The version that was causing less issue is 9.2.1 for my Raspberry Pi 3. http://archive.libreelec.tv/LibreELEC-RPi2.arm-9.2.1.img.gz

Extract downloaded file and unzip it.

Plug micro sd card in PC.

Check where mounted: lsblk

Unmount card partition (if mounted): sudo umount /dev/sdx#

Write to micro sd card:

sudo dd if=XXX.img of=/dev/sdx bs=4M conv=fsync status=progress
sync

MPEG-2 License

Need to buy a license from http://www.raspberrypi.com/mpeg-2-license-key/

For my PI, the license is: 0x16baa230

Enable the license by sshing on the PI:

External Hard-drive

Tvheadend

Backend (tvheadend)

Install the Tvheadend Server add-on from the “Service” category in the add-ons repos.

Configure the addon to have a delayed startup of 20 seconds. This is to make sure that the externally mounted drive are available when tvheadend starts:

The rest of the tvheadend configuration is done from its web interface: http://ip:9981 (mine is: http://192.168.1.23:9981)

Goto Configuration > General > Base:

DVR Setup

The following is done using tvheadend web interface.

Refer to http://docs.tvheadend.org/webui/config_dvr/

Goto Configuration > Recording > Digital Video Recorder Profiles:

Channel setup

The following is done using tvheadend web interface.

Goto Configuration > DVB Input:

Goto Configuration > Channel/EPG

Frontend (Kodi)

In Kodi TV interface:

Configure Kodi TV settings:

EPG Downloader

These steps explains how to install an addon that will download the updated EPG (Electronic Program Guide) every night and make it available for tvheadend.

Download the addon script.module.zap2epg from https://github.com/mathieugouin/script.module.zap2epg

Direct download link https://github.com/mathieugouin/script.module.zap2epg/releases/download/v1.3.3/script.module.zap2epg-1.3.3.zip

Setup:

Configure the Addon as follows:

The following is done using tvheadend web interface.

Goto Configuration > Channel/EPG:

Miscelaneous

Clear Icons Cache

When changing tvheadend channel icons, it is required to clear the cache to force Kodi to reload the new icons

rm $HOME/.kodi/userdata/Thumbnails/*/*.png
rm $HOME/.kodi/userdata/Database/Textures13.db
sudo reboot

Enable debug log

If required to help debugging an issue with kodi, activate debug logging without the annying onscreen debug overlay as follows:

<advancedsettings version="1.0">
    <!-- That should enable debug logging but without that annoying overlay on the screen. -->
    <loglevel>1</loglevel>
</advancedsettings>

References

SSH

Connect: ssh root@192.168.1.23

File copy from PI: scp root@192.168.1.23:/home/xbian/zap2xml.tar.gz .

File copy to PI: scp file.tar.gz root@192.168.1.23:/path/to/copy/file.tar.gz