13-11-13 1
Raspberry Pi
Set-Top-Box
What is set-top box
A set-top box (STB) or set-top unit (STU) is an information
appliance device that generally contains a tuner and
connects to a television set and an external source of
signal, turning the source signal into content in a form that
can then be displayed on the television screen or other
display device.
A consumer Palcom DSL-350
satellite-receiver;
the
Intermediate
frequency
demodulation tuner is on the
bottom left, and a Fujitsu MPEG
decoder CPU is in the center of
the board. The power supply is
on the right.
13-11-13 3
Main parts of STB
Tuner & demodulator
- transform radio waves to data stream
22Mbps DVB-T Mux
Decryption HW/SW
- Smartcard reader and conax decoder
Content Player
- HW accelerated MPEG4 video*
- MPEG2 / AC3 / HE-AAC / DTS audio
* On Raspberry Pi we need to buy license for MPEG2 video that costs 2.4 GBP. HW audio codec not licensable, yet.
What is in the box - software
RaspBMC operating system:
- Based on Raspbian = Debian Whezzy ARMv6 port
- XBMC 12 binary
- Tvheadend 3.4 binary
Need to install
- PCSC tools and libs
- OSCam decoder, build from source
- LCDproc + patched lcd driver
13-11-13 5
Setup
Exit to console or connect with ssh (pi/raspberry)
Some basic hints:
- If you need to change your mac address add
cloned-mac-address=XX.XX.XX.XX.XX to
/etc/NetworkManager/system-config/Wired Connection 1
- Hidden wifi needs bssid in Wifi Connection 1
PCSC
sudo apt-get update
sudo apt-get install build-essential subversion
sudo apt-get install pcscd pcsc-tools libpcsclite-dev libccid
libssl-dev
CCID supported card reader is hardly recommended
- armv6 linux, HW vendors has no precompiled driver
http://pcsclite.alioth.debian.org/ccid/
13-11-13 7
OSCam
svn checkout http://www.streamboard.tv/svn/oscam/trunk
oscam-svn
cd oscam-svn
make pcsc
OSCam
+---| OSCam ver: 1.20-unstable_svn rev: 8701 target: arm-linux-gnueabihf-pcsc | Tools:
| CROSS = | CC = gcc | Settings:
| CONF_DIR = /usr/local/etc
| CC_OPTS = -O2 -ggdb -pipe -ffunction-sections -fdata-sections
| CC_WARN = -W -Wall -Wshadow -Wredundant-decls -Wstrict-prototypes -Wold-style-definition | CFLAGS = -DWITH_PCSC=1 -I/usr/include/PCSC
| LDFLAGS = -Wl,--gc-sections -DWITH_PCSC=1 -I/usr/include/PCSC | LIBS = -lpcsclite -lpthread -ldl
| UseFlags = USE_PCSC=1 | Config:
| Addons : WEBIF TOUCH HAVE_DVBAPI IRDETO_GUESSING CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CW_CYCLE_CHECK
| Protocols: CAMD35 CAMD35_TCP NEWCAMD CCCAM CCCSHARE GBOX RADEGAST SERIAL CONSTCW PANDORA
| Readers : NAGRA IRDETO CONAX CRYPTOWORKS SECA VIACCESS VIDEOGUARD DRE TONGFANG BULCRYPT GRIFFIN DGCRYPT
| CardRdrs : PHOENIX INTERNAL SC8IN1 MP35 SMARGO DB2COM STAPI | Compiler : gcc (Debian 4.6.3-14+rpi1) 4.6.3
| Binary : Distribution/oscam-1.20-unstable_svn8701-arm-linux-gnueabihf-pcsc
+---13-11-13 9
OSCam configuration
sudo cp
Distribution/oscam-1.20-unstable_svn8701-arm-linux-gnueabihf-pcsc /usr/local/bin/oscam
sudo mkdir /var/log/oscam
sudo mkdir /etc/oscam
====== /etc/oscam/oscam.conf ===== [global] serverip = 127.0.0.1 logfile = /var/log/oscam/oscam.log disablelog = 0 maxlogsize = 100 # kB usrfile = /var/log/oscam/oscamuser.log failbancount = 0 # ban wrong login waitforcards = 0
OSCam – oscam.conf
[monitor] port = 0
serverip = 127.0.0.1 # debugger connected from ip monlevel = 0 [webif] httpport = 8888 #httpcert = oscam.cert httpuser = felhasznalonev httppwd = 654321 httprefresh = 10 Httpallowed = 0.0.0.0-255.255.255.255 Httpreadonly = 0 httphelplang = en
13-11-13 11
OSCam – oscam.conf
[newcamd] mgclient = 1 key = 000102030405060708090A0B0C0D port = 15050@0B00:000000 allowed = 127.0.0.1 keepalive = 1NewCamd protocol is used for serve key decoding for
cliens.
Oscam oscam.server
==== /etc/oscam/oscam.server ===== [reader] label = mypcscreader enable = 1 protocol = pcscDevice = 0 # pcsc_scan helps if you use more card readers group = 1
caid = 0B00 # conax emmcache = 1,3,2
detect = CD # Carrier Detect cardmhz = 400
13-11-13 13
OSCam oscam.user
==== /etc/oscam/oscam.user ==== [account] user = teve pwd = mindigtvuniq = 0 # one connection by one user forced
au = 1 # 1 = allow emm packages to update card Group = 1
keepalive = 1 caid = 0B00
OSCam Upstart job
=== /etc/init/oscam.conf === ## oscam server description "oscam" author "none" start on startup stop on runlevel [!2345] pre-start scripttest -x /usr/bin/oscam || { stop; logger -t oscam "cannot execute /usr/bin/oscam, exiting" ; exit 1; }
sleep 5 end script
13-11-13 15
TvHeadend
Copy firmware of the dvb-t stick to /lib/firmware and
connect the tuner to the Pi.
On XBMC gui, turn on preinstalled tvheadend in the
“Programs” menu
Use your web browser on a machine to configure the
tvheadend service at port 9981.
13-11-13 17
13-11-13 19
13-11-13 21
LCDProc
sudo apt-get install lcdproc
Copy patched hd44780.so to /usr/lib/lcdproc/
=== /etc/LCDd.conf === [Server] DriverPath=/usr/lib/lcdproc/ Driver=hd44780 ServerScreen=no Hello=” Welcome to ” Hello=” RaspBMC! ”
GoodBye=”Thanks for using” GoodBye=” Raspberry Pi! ”
LCDProc LCDd.conf
[hd44870]
size=16x2
ConnectionType=rpi
# 4 bit data transfer D7=22 D6=27 # rev1: 21 D5=17 D4=23 RS=25 EN=24 #backlight #LCD_LED = 18
13-11-13 23
XBMC lcd settings
=== .xbmc/userdata/advancedsettings.xml ===
<advancedsettings> <lcd>
<rows>2</rows> <!-- Number of rows to use for the LCD. -->
<columns>20</columns> <!-- Number of columns to use for the LCD. --> <scrolldelay>8</scrolldelay> <!-- Delay of the scroller widget. Defaults to 1. -->
</lcd>
</advancedsettings>
13-11-13 25
13-11-13 27
Features
Use other devices to connect your set-top box. Android with native tvheadend client: TvHGuide
13-11-13 29
13-11-13 31
What is in the box - hardware
- Raspberry Pi Model B rev 2
- Active USB Hub /w 5V2A power adapter
- DVB-T tuners
- Smartcard reader
- Wifi dongle
- Remote control receiver
- LCD display
- Storage (hdd / pendrive)
- SD card
- male F connector to right angle MCX pigtail
- antenna splitter
13-11-13 33
LCD
HD44780 compatible 16x2 LCD display Ebay <3 USD
13-11-13 35
LCD
LCD | RasPi | pin (gpio) 1 | 6 (G) 2 | 2 (5V) 3 | 6 < 3K ohm 4 | 22 (25) 5 | 6 (G) 6 | 18 (24) 7 | 8 | 9 | 10 | 11 | 16 (23) 12 | 11 (17) 13 | 13 (21/27) 14 | 15 (22) 15 | 2 (5V) 16 | 6 (G)13-11-13 37
USB Hub
Active USB Hub with 5V2A adapter Dx 15.90 USD
13-11-13 39
DVB-T Tuners, IT9135rev2
13-11-13 41
13-11-13 43
13-11-13 45
13-11-13 47
13-11-13 49