• No results found

Raspberry Pi. Set-Top-Box

N/A
N/A
Protected

Academic year: 2021

Share "Raspberry Pi. Set-Top-Box"

Copied!
51
0
0

Loading.... (view fulltext now)

Full text

(1)

13-11-13 1

Raspberry Pi

Set-Top-Box

(2)

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.

(3)

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.

(4)

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

(5)

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

(6)

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/

(7)

13-11-13 7

OSCam

svn checkout http://www.streamboard.tv/svn/oscam/trunk

oscam-svn

cd oscam-svn

make pcsc

(8)

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

(9)

+---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

(10)

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

(11)

13-11-13 11

OSCam – oscam.conf

[newcamd] mgclient = 1 key = 000102030405060708090A0B0C0D port = 15050@0B00:000000 allowed = 127.0.0.1 keepalive = 1

NewCamd protocol is used for serve key decoding for

cliens.

(12)

Oscam oscam.server

==== /etc/oscam/oscam.server ===== [reader] label = mypcscreader enable = 1 protocol = pcsc

Device = 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)

13-11-13 13

OSCam oscam.user

==== /etc/oscam/oscam.user ==== [account] user = teve pwd = mindigtv

uniq = 0 # one connection by one user forced

au = 1 # 1 = allow emm packages to update card Group = 1

keepalive = 1 caid = 0B00

(14)

OSCam Upstart job

=== /etc/init/oscam.conf === ## oscam server description "oscam" author "none" start on startup stop on runlevel [!2345] pre-start script

test -x /usr/bin/oscam || { stop; logger -t oscam "cannot execute /usr/bin/oscam, exiting" ; exit 1; }

sleep 5 end script

(15)

13-11-13 15

(16)

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.

(17)

13-11-13 17

(18)
(19)

13-11-13 19

(20)
(21)

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! ”

(22)

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

(23)

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>

(24)
(25)

13-11-13 25

(26)
(27)

13-11-13 27

(28)

Features

Use other devices to connect your set-top box. Android with native tvheadend client: TvHGuide

(29)

13-11-13 29

(30)
(31)

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

(32)
(33)

13-11-13 33

LCD

HD44780 compatible 16x2 LCD display Ebay <3 USD

(34)
(35)

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)
(36)
(37)

13-11-13 37

(38)

USB Hub

Active USB Hub with 5V2A adapter Dx 15.90 USD

(39)

13-11-13 39

(40)

DVB-T Tuners, IT9135rev2

(41)

13-11-13 41

(42)
(43)

13-11-13 43

(44)
(45)

13-11-13 45

(46)
(47)

13-11-13 47

(48)
(49)

13-11-13 49

(50)
(51)
http://www.raspberrypi.org http://en.wikipedia.org/wiki/Set-top_box http://pcsclite.alioth.debian.org/ccid/ http://www.streamboard.tv/wiki/OSCam/en/Config/oscam.conf http://www.streamboard.tv/wiki/OSCam/en/Config/oscam.server http://logout.hu/bejegyzes/azbest/usb_dvb-t_tuner_it9135_rev2/hsz_1-100.html

References

Related documents