Technical documentation

Technical documentation

Server hardware

The server consists of a Raspberry Pi 3 computer with a 16GB micro SD card, an antenna splitter and Media-Tech MT4171 DVB-T tuners. The larger case is suitable for adapting the server to other countries by using other tuners or other antenna splitter.

Server software

Installation and configuration steps made during manufacturing of the server are shown below.

Write image of Raspbian Jessie with PIXEL desktop to micro SD card (, tested for ver. 2016-11-25)

Start Raspberry Pi and execute the below commands/steps. Set initial passwords. 

#total time of installation: about 20 minutes; measured for: RPi 3, class 10 SD card, 20Mb/s Internet download speed
#time of downloading and installing updates may vary

#Change the default password for security reasons!

#Tuners firmware (download from the Internet and save to /lib/firmware/ directory)
sudo curl -o /lib/firmware/dvb-usb-it9135-01.fw '' -L
sudo curl -o /lib/firmware/dvb-usb-it9135-02.fw '' -L

#Additional packages repositories and OS update (~11 minutes)
sudo apt-key adv --keyserver hkp:// --recv-keys 379CE192D401AB61
echo 'deb jessie release' | sudo tee -a /etc/apt/sources.list #Tvheadend 4.0.8, Jessie is Debian current version
                                                                                                  #todo: update the name when changed
sudo apt-get update && sudo apt-get -y -q upgrade         #-q otherwise displays some information and asks to press Q(uit) key; we do not use
                                                          #PiBakery since it would hang after asking which '/etc/lightdm/lightdm.conf' file
                                                          #to use - the one from the system or the updated one
#Packages installation and preconfiguration (~ 8 minutes)
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install tvheadend  #(~ 6 minutes) will not ask about admin name and password during installation
sudo apt-get -y install tightvncserver xrdp               #(~ 2 minutes) Microsoft Remote Desktop (RDP)
                                                          #tightvncserver package is required for uninstalling RealVNC since Raspberry Pi 3
sudo apt-get -y install mc htop                           #Midnight Commander file manager and htop system monitor (set Hide userland threads: on)
sudo apt-get -y install unattended-upgrades               #(~ 15 seconds)
sudo apt-get -y install expect                            #(fast) used to change Tvheadend admin password in command line in automated configuration

in /etc/apt/apt.conf.d/20auto-upgrades file set: APT::Periodic::Update-Package-Lists  "1";
                                                 APT::Periodic::Unattended-Upgrade    "1"; 
in /etc/apt/apt.conf.d/50unattended-upgrades file uncomment and set: Unattended-Upgrade::Origins-Pattern       { ... "o=Raspbian,a=stable"; ... }
                                                                     Unattended-Upgrade::Automatic-Reboot      "true"
                                                                     Unattended-Upgrade::Automatic-Reboot-Time "03:30";
                                                                     Acquire::http::Dl-Limit                   "2048";
in /etc/default/rcS file uncomment and set: FSCKFIX=yes  #try to automatically repair problems with file system consistency
                                                         #(otherwise Raspberry Pi will stop during boot and wait for human intervention)

#Restart Raspberry Pi (to activate the firmware and to be sure that all changes are saved to SD card)
sudo reboot

Initial Tvheadend configuration (without setting multiplexes)
sudo dpkg-reconfigure tvheadend           #set/change Tvheadend admin name (to "tvadmin") & password
configure Tvheadend on raspberrypi:9981
 - Access control                         #add "tvuser1-.."
     Enabled:            yes
     Username:           tvuser<1-..>
     Password:           <password>
     Network prefix:,::/0   #for computer with any IP address (default value)
                  #ex. for all computers in local network with 192.168.1.* IP addresses
                         a.b.c.d/32       #ex. for one computer with a.b.c.d IP address, where a-d are numbers between 0 and 255
     HTSP Streaming:     yes              #TV can be watched in Kodi
     Limit Connections:  4                #how many streams can user watch at the same time, default is 4
 - DVB Inputs:
   - Networks:                            #define a "TV network"
     Type:               DVB-T
     Network name:       MyNet
     Network Discovery:  no               #doesn't search for new multiplexes automatically
   - TV Adapters:                         #for each TV adapter set:
     Enabled:            yes
     Name:               any unique name
     Networks:           name of the previously added TV network
     Power Save:         yes              #unused TV adapters will save power
     Priority:           <liczba>         #set it optionally to control in which order TV adapters are used
     Force old status:   yes              #otherwise sometimes TV signal strength and quality are shown incorrectly ( bug)

(for testing and configuration purposes:
  - configure multiplexes, services and channels for testing location, they should be removed after tests
  - enable SSH, it will be disabled after changing passwords)