1. dia - drag2web.com

Transcription

1. dia - drag2web.com
Raspberry Pi
Set-Top-Box
http://www.raspberrypi.org
13-11-13
1
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.
http://en.wikipedia.org/wiki/Set-top_box
13-11-13
2
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.
13-11-13
3
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
- firmware for DVB-T tuner sticks
13-11-13
4
Setup
Exit to console or connect with ssh (pi/raspberry)
Some basic hints:
- If you need to change your mac address add clonedmac-address=XX.XX.XX.XX.XX to
/etc/NetworkManager/system-config/Wired Connection 1
- Hidden wifi needs bssid in Wifi Connection 1
13-11-13
5
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/
Run pcsc_scan to see it's working, test it with a card.
13-11-13
6
OSCam
svn checkout http://www.streamboard.tv/svn/oscam/trunk
oscam-svn
cd oscam-svn
make pcsc
13-11-13
7
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
8
OSCam configuration
sudo cp Distribution/oscam-1.20-unstable_svn8701-armlinux-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
http://www.streamboard.tv/wiki/OSCam/en/Config/oscam.conf
13-11-13
9
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
10
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.
13-11-13
11
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
http://www.streamboard.tv/wiki/OSCam/en/Config/oscam.server
13-11-13
12
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
13-11-13
13
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
exec su - pi -c "/usr/bin/oscam -c /etc/oscam"
13-11-13
14
OSCam Web Interface :8888
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
16
TvHeadend – configuration
13-11-13
17
TvHeadend – configuration :9981
13-11-13
18
TvHeadend – configuration
13-11-13
19
TvHeadend – configuration
13-11-13
20
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! ”
13-11-13
21
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
22
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>
Turn on LCD display on XBMC settings.
13-11-13
23
XBMC Live Tv
13-11-13
24
XBMC PVR
13-11-13
25
XBMC Live Tv
13-11-13
26
XBMC EPG
13-11-13
27
Features
Use other devices to connect your set-top box.
Android with native tvheadend client: TvHGuide
13-11-13
28
Android - TvHGuide
13-11-13
29
XBMC on other devices can connect in
13-11-13
30
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
- a lot of cables
13-11-13
31
Raspberry Pi
13-11-13
32
LCD
HD44780 compatible 16x2 LCD display
Ebay <3 USD
13-11-13
33
LCD
13-11-13
34
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
35
LCD
13-11-13
36
LCD
13-11-13
37
USB Hub
Active USB Hub with 5V2A adapter
Dx 15.90 USD
13-11-13
38
USB Hub
13-11-13
39
DVB-T Tuners, IT9135rev2
http://logout.hu/bejegyzes/azbest/usb_dvb-t_tuner_it9135_rev2/hsz_1-100.html
13-11-13
40
Smartcard reader
13-11-13
41
Smartcard reader
13-11-13
42
Smartcard reader
13-11-13
43
Cables
13-11-13
44
Remote controller
13-11-13
45
Box
13-11-13
46
Back side
13-11-13
47
Upgrades: Bluetooth, Wifi, pendrive
13-11-13
48
Upgrades: I2C, RTC
13-11-13
49
Upgrades: ambilight
13-11-13
50
13-11-13
51