Project

General

Profile

Tvheadend oscam ziggo » History » Version 22

ruud -, 2010-11-19 20:45

1 1 William Peters
This article describes how to build and configure oscam.
2 10 William Peters
3 9 William Peters
Note that this oscam configuration is configured to work with Ziggo as provider.
4
It might work with other providers, but that needs to be confirmed.
5 1 William Peters
6
Make sure you have cmake and subversion installed, these are required for checking out and building oscam.
7
8 19 William Peters
Create a user for oscam and add it to the uucp group
9
10
{{{
11
useradd oscam -s /sbin/nologin -m -d /opt/oscam/
12
gpasswd -a oscam uucp
13
}}}
14
15 1 William Peters
create the required directories
16
17
{{{
18 19 William Peters
mkdir /opt/oscam/src/
19 1 William Peters
}}}
20
21
Now we need to checkout the oscam source code using SVN
22
23
{{{
24 17 William Peters
svn co http://streamboard.gmc.to/svn/oscam /opt/oscam/src/
25 1 William Peters
}}}
26
27 17 William Peters
Now we need to configure oscam
28 1 William Peters
{{{
29 20 ruud -
cd /opt/oscam/src/trunk
30 17 William Peters
./config.sh
31
}}}
32
33
This is my configuration
34
{{{
35
Addons:
36
  [*] WEBIF
37
  [*] HAVE_DVBAPI
38
  [*] IRDETO_GUESSING
39
  [*] CS_ANTICASC
40
  [*] WITH_DEBUG
41
  [ ] CS_WITH_DOUBLECHECK
42
  [*] CS_LED
43
  [*] CS_LOGHISTORY
44
45
Protocols:
46
  [*] MODULE_CAMD33
47
  [*] MODULE_CAMD35
48
  [*] MODULE_CAMD35_TCP
49
  [*] MODULE_NEWCAMD
50
  [*] MODULE_CCCAM
51
  [*] MODULE_RADEGAST
52
  [*] MODULE_SERIAL
53
  [*] MODULE_MONITOR
54
  [*] MODULE_CONSTCW
55
56
Reader:
57
  [*] READER_NAGRA
58
  [*] READER_IRDETO
59
  [*] READER_CONAX
60
  [*] READER_CRYPTWORKS
61
  [*] READER_SECA
62
  [*] READER_VIACCESS
63
  [*] READER_VIDEOGARD
64
  [*] READER_DRE
65
  [*] READER_TONGFANG
66
}}}
67
68
Now compile oscam
69
{{{
70 1 William Peters
make
71
}}}
72 2 William Peters
73 18 William Peters
After oscam is built you should have a file like 'oscam-1.00-unstable_svnxxxx-i686-pc-linux' in /opt/oscam/src/Distribution/.
74 2 William Peters
We need to copy this file to an alternate location
75
76
{{{
77
cd /opt/oscam/src/Distribution/
78 21 ruud -
cp ./oscam-* /opt/oscam/oscam.bin
79 2 William Peters
}}}
80
81
Ok, the binaries are installed :)
82
Now we need to configure oscam first create the configuration directories
83
84
{{{
85
mkdir -p /opt/oscam/etc/
86
mkdir -p /opt/oscam/etc/cw/
87
}}}
88
89
Note: /opt/oscam/etc/cw/ is used for caching keys. 
90
91 1 William Peters
Now, create oscam.conf in /opt/oscam/etc/oscam.conf
92 22 ruud -
93 21 ruud -
Note: replace example CAID with your own CAID (e.g. 0602)
94 2 William Peters
95 1 William Peters
{{{
96
[global]
97 14 William Peters
usrfile                       = /opt/oscam/oscamuser.log
98
logfile                       = /opt/oscam/oscam.log
99
cwlogdir                      = /opt/oscam/etc/cw
100
disablelog                    = 0
101
disableuserfile               = 0
102
usrfileflag                   = 0
103
clienttimeout                 = 2000
104
fallbacktimeout               = 1500
105
clientmaxidle                 = 120
106
failbantime                   = 0
107
bindwait                      = 120
108
netprio                       = 0
109
clientdyndns                  = 0
110
resolvedelay                  = 2
111
unlockparental                = 0
112
nice                          = -1
113
serialreadertimeout           = 1000
114
maxlogsize                    = 10
115
waitforcards                  = 1
116
preferlocalcards              = 1
117
saveinithistory               = 0
118
readerrestartseconds          = 5
119
lb_mode                       = 0
120 1 William Peters
lb_save                       = 0
121 14 William Peters
lb_nbest_readers              = 1
122
lb_nfb_readers                = 1
123
lb_min_ecmcount               = 5
124
lb_max_ecmcount               = 500
125
lb_reopen_seconds             = 900
126
resolvegethostbyname          = 0
127 1 William Peters
128
[newcamd]
129 14 William Peters
port                          = 15050@0604:000000
130
key                           = 0102030405060708091011121314
131
allowed                       =
132
keepalive                     = 1
133
mgclient                      = 0
134
135
[webif]
136
httpport                      = 15080
137
httpuser                      = username
138
httppwd                       = password
139
httprefresh                   = 0
140
httpallowed                   = 127.0.0.1,YourIpRange
141
httphideidleclients           = 0
142
httpreadonly                  = 0
143 1 William Peters
}}}
144
145
Now create oscam.server in /opt/oscam/etc/oscam.server
146
147
{{{
148
[reader]
149
Label = Ziggo
150
Device = /dev/ttyUSB0
151
mhz = 600
152
cardmhz = 600
153
Protocol = mouse
154
EMMCache = 1,3,2
155
Group = 1
156
caid = 0604:0000
157
rsakey = 3C8633AAC0D367533DEC7BB2EEEDEB8CA3ADA52E58B99BB34672783277A1DAAC3B6106AD0909774E031B2A6E30195B437683AD0FC599B87D08CEA47BE1B6C76A
158
boxkey = 1122334455667788
159
fallback = 0
160
}}}
161
162
Now create oscam.user in /opt/oscam/etc/oscam.user
163
164
{{{
165
[account]
166
user = tvheadend
167
pwd = tvheadend
168
uniq = 0
169
group = 1
170
ident = 0604:000000
171
caid = 0604
172
au = Ziggo
173
}}}
174
175 19 William Peters
Now you need to change the owner and group of /opt/oscam to oscam (because you should run oscam as a unprivileged user)
176 14 William Peters
177
{{{
178 19 William Peters
chown -R oscam:oscam /opt/oscam
179 14 William Peters
}}}
180
181 1 William Peters
Ok, if everything is configured correctly we can test the oscam installation
182
183
{{{
184
/opt/oscam/oscam.bin -c /opt/oscam/etc/& touch /opt/oscam/oscam.log ; tail -f /opt/oscam/oscam.log ; killall oscam.bin
185 2 William Peters
}}}
186
187
this should create some output like this
188
189
{{{
190
-------------------------------------------------------------------------------
191 14 William Peters
>> OSCam <<  cardserver started at Thu Oct 28 11:06:01 2010
192 2 William Peters
-------------------------------------------------------------------------------
193 14 William Peters
2010/10/28 11:06:01 B73DF6C0 s version=1.00-unstable_svn, build #, system=i686-pc-linux, nice=-1
194
2010/10/28 11:06:01 B73DF6C0 s client max. idle=120 sec, debug level=0
195
2010/10/28 11:06:01 B73DF6C0 s max. logsize=10 Kb
196
2010/10/28 11:06:01 B73DF6C0 s client timeout=2000 ms, fallback timeout=1500 ms, cache delay=0 ms
197
2010/10/28 11:06:01 B73DF6C0 s auth size=4788
198
2010/10/28 11:06:01 B73DF6C0 s Cannot open file "/opt/oscam/etc//oscam.services" (errno=2)
199
2010/10/28 11:06:01 B73DF6C0 s userdb reloaded: 0 accounts freed, 2 accounts loaded, 0 expired, 0 disabled
200
2010/10/28 11:06:01 B73DF6C0 s signal handling initialized (type=sysv)
201
2010/10/28 11:06:01 B73DF6C0 s can't open file "/opt/oscam/etc//oscam.srvid" (err=2), no service-id's loaded
202
2010/10/28 11:06:01 B73DF6C0 s can't open file "/opt/oscam/etc//oscam.tiers" (err=2), no tier-id's loaded
203
2010/10/28 11:06:01 B73DF6C0 s can't open file "/opt/oscam/etc//oscam.provid" (err=2), no provids's loaded
204
2010/10/28 11:06:01 B73DF6C0 s can't open file "/opt/oscam/etc//oscam.ird" (errno=2) irdeto guessing not loaded
205
2010/10/28 11:06:01 B73DF6C0 s monitor: initialized (fd=7, port=988)
206
2010/10/28 11:06:01 B73DF6C0 s camd33: disabled
207
2010/10/28 11:06:01 B73DF6C0 s camd35: disabled
208
2010/10/28 11:06:01 B73DF6C0 s cs378x: disabled
209
2010/10/28 11:06:01 B73DF6C0 s newcamd: initialized (fd=8, port=15050, crypted)
210
2010/10/28 11:06:01 B73DF6C0 s CAID: 0604
211
2010/10/28 11:06:01 B73DF6C0 s provid #0: 000000
212
2010/10/28 11:06:01 B73DF6C0 s cccam: disabled
213
2010/10/28 11:06:01 B73DF6C0 s radegast: disabled
214
2010/10/28 11:06:01 B73DF6C0 s http thread started
215
2010/10/28 11:06:01 B73DF6C0 s creating thread for device /dev/ttyUSB0 slot 0
216
2010/10/28 11:06:01 B73DF6C0 s waiting for local card init
217
2010/10/28 11:06:01 B7375280 r reader thread started (thread=B7375280, device=/dev/ttyUSB0, detect=cd, mhz=600, cardmhz=600)
218
2010/10/28 11:06:01 B76EA280 h HTTP Server listening on port 15080
219
2010/10/28 11:06:04 B7375280 r card detected
220
2010/10/28 11:06:08 B7375280 r ATR: 3B 9F 21 0E 49 52 44 45 54 4F 20 41 43 53 20 56 35 2E 37 9A
221
2010/10/28 11:06:09 B7375280 r Maximum frequency for this card is formally 6 Mhz, clocking it to 6.00 Mhz
222
2010/10/28 11:06:10 B7375280 r detect irdeto card
223
2010/10/28 11:06:10 B7375280 r caid: 0604, acs: 6.08, country code: NLD
224
2010/10/28 11:06:10 B7375280 r providers: 4, ascii serial: xxxxxxxxxxx, hex serial: XXXXXX, hex base: XX
225
2010/10/28 11:06:13 B7375280 r active providers: 4 (xxxxxx,xxxxxx,xxxxxx,xxxxxx)
226
2010/10/28 11:06:13 B7375280 r found cardsystem
227
2010/10/28 11:06:14 B7375280 r entitlements for provider: 1, id: XXXXXX
228
2010/10/28 11:06:14 B7375280 r chid: 0001, date: 2004/08/16 - 2004/09/15
229
2010/10/28 11:06:14 B7375280 r chid: 000B, date: 2004/08/16 - 2004/09/15
230
2010/10/28 11:06:14 B7375280 r chid: FFE0, date: 2004/08/16 - 2004/08/20
231
2010/10/28 11:06:14 B7375280 r chid: 0384, date: 2004/08/16 - 2004/09/15
232
2010/10/28 11:06:14 B7375280 r chid: 000D, date: 2004/08/16 - 2004/09/15
233
2010/10/28 11:06:19 B7375280 r [irdeto-reader] ready for requests
234
2010/10/28 11:06:19 B73DF6C0 s init for all local cards done
235
2010/10/28 11:06:19 B73DF6C0 s anti cascading disabled
236
2010/10/28 11:06:19 B736E280 c client connected to 15050 port
237
2010/10/28 11:06:19 B7367280 c client connected to 15050 port
238
2010/10/28 11:06:19 B7367280 c Connection closed to client
239
2010/10/28 11:06:19 B736E280 c Connection closed to client
240
2010/10/28 11:06:19 B7367280 c thread B7367280 ended!
241
2010/10/28 11:06:19 B736E280 c thread B736E280 ended!
242 12 William Peters
}}}
243 2 William Peters
244 1 William Peters
Oscam is now running on serverip:15050.
245
Open your tvheadend web interface.
246
Go to Configuration -> Code Word Client
247
Click Add Entry
248
Doubleclick 'hostname' type your server ip or hostname that is runnin oscam. 
249 2 William Peters
Doubleclick 'port' type the port number (if you made no changes to config files it should be 15050).
250 11 William Peters
Doubleclick 'username' type the username as configured in oscam.user.
251 2 William Peters
Doubleclick 'password' type the password as configured in oscam.user.
252
Doubleclick 'DES key' here you can insert your DES key. If you haven't changed it in oscam.conf (you should!) then this should be: 01:02:03:04:05:06:07:08:09:10:11:12:13:14
253 16 William Peters
Check 'Update Card', ~~at this moment tvheadend does not support EMM updates this option won't be used anyway~~ support for Irdeto EMM updates was added in r4359.
254 5 William Peters
Now check Enabled and click 'Save Changes'
255
256
When you click Save Changes you will see something like this in the system logs
257
258
{{{
259
Mar 24 20:55:38 cwc: 10.2.0.2: Connected as user 0x0x to a Irdeto-card [0x0604 : xx.xx.xx.xx.xx.xx.xx.xx] with 5 providers
260
Mar 24 20:55:38 cwc: 10.2.0.2: irdeto card
261 2 William Peters
Mar 24 20:55:38 cwc: 10.2.0.2: Provider ID #1: 0x000000 xx.xx.xx.xx.xx.xx.xx.xx
262
Mar 24 20:55:38 cwc: 10.2.0.2: Provider ID #2: 0x000001 xx.xx.xx.xx.xx.xx.xx.xx
263
Mar 24 20:55:38 cwc: 10.2.0.2: Provider ID #3: 0x000002 xx.xx.xx.xx.xx.xx.xx.xx
264
Mar 24 20:55:38 cwc: 10.2.0.2: Provider ID #4: 0x000003 xx.xx.xx.xx.xx.xx.xx.xx
265
Mar 24 20:55:38 cwc: 10.2.0.2: Provider ID #5: 0x000004 xx.xx.xx.xx.xx.xx.xx.xx
266
Mar 24 20:55:38 cwc: 10.2.0.2: Will forward EMMs
267 7 Lars Op den Kamp -
}}}
268 2 William Peters
269 7 Lars Op den Kamp -
now to kill oscam press ctrl+c in the console.
270 2 William Peters
271
Ok tvheadend is now connected to oscam and is able to descramble channels that your card gives you access to.
272
273
~~At this moment tvheadend does not support EMM updates, this means you have to update your card atleast once a week.
274
This can be done by inserting your smartcard for 30 minutes in the retail dvb-c setop box.
275
After that restart oscam.~~
276
277
278
== For Gentoo users i have an init script ==
279
280
nano -w /etc/init.d/oscam
281
{{{
282 15 William Peters
#!/sbin/runscript
283 2 William Peters
# Copyright 1999-2010 Gentoo Foundation
284
# Distributed under the terms of the GNU General Public License v2
285
# $Header:
286
287 14 William Peters
depend() {
288 2 William Peters
        use net
289
}
290
291
start() {
292 14 William Peters
        ebegin "Starting oscam"
293
        start-stop-daemon \
294
                --start \
295
                --user $OSCAMUSER \
296
                --name $OSCAMNAME \
297 2 William Peters
                --exec $OSCAMBIN -- $OSCAMOPTS
298
        eend $?
299
}
300
301
stop() {
302 1 William Peters
        ebegin "Stopping oscam"
303 2 William Peters
        start-stop-daemon --stop --signal 2 --name $OSCAMNAME
304
        eend $?
305
}
306
}}}
307
308
nano -w /etc/conf.d/oscam
309 1 William Peters
{{{
310
# /etc/conf.d/oscam: config file for /etc/init.d/oscam
311 14 William Peters
312
OSCAMOPTS="-b -c /opt/oscam/etc/"
313 19 William Peters
OSCAMUSER="oscam"
314 14 William Peters
OSCAMNAME="oscam.bin"
315
OSCAMBIN="/opt/oscam/${OSCAMNAME}"
316 1 William Peters
}}}