Tvheadend oscam ziggo » History » Version 20
ruud -, 2010-11-19 18:40
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 | 18 | William Peters | cp ./oscam-1.00-unstable_svnxxxx-i686-pc-linux /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 | Now, create oscam.conf in /opt/oscam/etc/oscam.conf |
||
92 | |||
93 | 1 | William Peters | {{{ |
94 | [global] |
||
95 | 14 | William Peters | usrfile = /opt/oscam/oscamuser.log |
96 | logfile = /opt/oscam/oscam.log |
||
97 | cwlogdir = /opt/oscam/etc/cw |
||
98 | disablelog = 0 |
||
99 | disableuserfile = 0 |
||
100 | usrfileflag = 0 |
||
101 | clienttimeout = 2000 |
||
102 | fallbacktimeout = 1500 |
||
103 | clientmaxidle = 120 |
||
104 | failbantime = 0 |
||
105 | bindwait = 120 |
||
106 | netprio = 0 |
||
107 | clientdyndns = 0 |
||
108 | resolvedelay = 2 |
||
109 | unlockparental = 0 |
||
110 | nice = -1 |
||
111 | serialreadertimeout = 1000 |
||
112 | maxlogsize = 10 |
||
113 | waitforcards = 1 |
||
114 | preferlocalcards = 1 |
||
115 | saveinithistory = 0 |
||
116 | readerrestartseconds = 5 |
||
117 | lb_mode = 0 |
||
118 | 1 | William Peters | lb_save = 0 |
119 | 14 | William Peters | lb_nbest_readers = 1 |
120 | lb_nfb_readers = 1 |
||
121 | lb_min_ecmcount = 5 |
||
122 | lb_max_ecmcount = 500 |
||
123 | lb_reopen_seconds = 900 |
||
124 | resolvegethostbyname = 0 |
||
125 | 1 | William Peters | |
126 | [newcamd] |
||
127 | 14 | William Peters | port = 15050@0604:000000 |
128 | key = 0102030405060708091011121314 |
||
129 | allowed = |
||
130 | keepalive = 1 |
||
131 | mgclient = 0 |
||
132 | |||
133 | [webif] |
||
134 | httpport = 15080 |
||
135 | httpuser = username |
||
136 | httppwd = password |
||
137 | httprefresh = 0 |
||
138 | httpallowed = 127.0.0.1,YourIpRange |
||
139 | httphideidleclients = 0 |
||
140 | httpreadonly = 0 |
||
141 | 1 | William Peters | }}} |
142 | |||
143 | Now create oscam.server in /opt/oscam/etc/oscam.server |
||
144 | |||
145 | {{{ |
||
146 | [reader] |
||
147 | Label = Ziggo |
||
148 | Device = /dev/ttyUSB0 |
||
149 | mhz = 600 |
||
150 | cardmhz = 600 |
||
151 | Protocol = mouse |
||
152 | EMMCache = 1,3,2 |
||
153 | Group = 1 |
||
154 | caid = 0604:0000 |
||
155 | rsakey = 3C8633AAC0D367533DEC7BB2EEEDEB8CA3ADA52E58B99BB34672783277A1DAAC3B6106AD0909774E031B2A6E30195B437683AD0FC599B87D08CEA47BE1B6C76A |
||
156 | boxkey = 1122334455667788 |
||
157 | fallback = 0 |
||
158 | }}} |
||
159 | |||
160 | Now create oscam.user in /opt/oscam/etc/oscam.user |
||
161 | |||
162 | {{{ |
||
163 | [account] |
||
164 | user = tvheadend |
||
165 | pwd = tvheadend |
||
166 | uniq = 0 |
||
167 | group = 1 |
||
168 | ident = 0604:000000 |
||
169 | caid = 0604 |
||
170 | au = Ziggo |
||
171 | }}} |
||
172 | |||
173 | 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) |
174 | 14 | William Peters | |
175 | {{{ |
||
176 | 19 | William Peters | chown -R oscam:oscam /opt/oscam |
177 | 14 | William Peters | }}} |
178 | |||
179 | 1 | William Peters | Ok, if everything is configured correctly we can test the oscam installation |
180 | |||
181 | {{{ |
||
182 | /opt/oscam/oscam.bin -c /opt/oscam/etc/& touch /opt/oscam/oscam.log ; tail -f /opt/oscam/oscam.log ; killall oscam.bin |
||
183 | 2 | William Peters | }}} |
184 | |||
185 | this should create some output like this |
||
186 | |||
187 | {{{ |
||
188 | ------------------------------------------------------------------------------- |
||
189 | 14 | William Peters | >> OSCam << cardserver started at Thu Oct 28 11:06:01 2010 |
190 | 2 | William Peters | ------------------------------------------------------------------------------- |
191 | 14 | William Peters | 2010/10/28 11:06:01 B73DF6C0 s version=1.00-unstable_svn, build #, system=i686-pc-linux, nice=-1 |
192 | 2010/10/28 11:06:01 B73DF6C0 s client max. idle=120 sec, debug level=0 |
||
193 | 2010/10/28 11:06:01 B73DF6C0 s max. logsize=10 Kb |
||
194 | 2010/10/28 11:06:01 B73DF6C0 s client timeout=2000 ms, fallback timeout=1500 ms, cache delay=0 ms |
||
195 | 2010/10/28 11:06:01 B73DF6C0 s auth size=4788 |
||
196 | 2010/10/28 11:06:01 B73DF6C0 s Cannot open file "/opt/oscam/etc//oscam.services" (errno=2) |
||
197 | 2010/10/28 11:06:01 B73DF6C0 s userdb reloaded: 0 accounts freed, 2 accounts loaded, 0 expired, 0 disabled |
||
198 | 2010/10/28 11:06:01 B73DF6C0 s signal handling initialized (type=sysv) |
||
199 | 2010/10/28 11:06:01 B73DF6C0 s can't open file "/opt/oscam/etc//oscam.srvid" (err=2), no service-id's loaded |
||
200 | 2010/10/28 11:06:01 B73DF6C0 s can't open file "/opt/oscam/etc//oscam.tiers" (err=2), no tier-id's loaded |
||
201 | 2010/10/28 11:06:01 B73DF6C0 s can't open file "/opt/oscam/etc//oscam.provid" (err=2), no provids's loaded |
||
202 | 2010/10/28 11:06:01 B73DF6C0 s can't open file "/opt/oscam/etc//oscam.ird" (errno=2) irdeto guessing not loaded |
||
203 | 2010/10/28 11:06:01 B73DF6C0 s monitor: initialized (fd=7, port=988) |
||
204 | 2010/10/28 11:06:01 B73DF6C0 s camd33: disabled |
||
205 | 2010/10/28 11:06:01 B73DF6C0 s camd35: disabled |
||
206 | 2010/10/28 11:06:01 B73DF6C0 s cs378x: disabled |
||
207 | 2010/10/28 11:06:01 B73DF6C0 s newcamd: initialized (fd=8, port=15050, crypted) |
||
208 | 2010/10/28 11:06:01 B73DF6C0 s CAID: 0604 |
||
209 | 2010/10/28 11:06:01 B73DF6C0 s provid #0: 000000 |
||
210 | 2010/10/28 11:06:01 B73DF6C0 s cccam: disabled |
||
211 | 2010/10/28 11:06:01 B73DF6C0 s radegast: disabled |
||
212 | 2010/10/28 11:06:01 B73DF6C0 s http thread started |
||
213 | 2010/10/28 11:06:01 B73DF6C0 s creating thread for device /dev/ttyUSB0 slot 0 |
||
214 | 2010/10/28 11:06:01 B73DF6C0 s waiting for local card init |
||
215 | 2010/10/28 11:06:01 B7375280 r reader thread started (thread=B7375280, device=/dev/ttyUSB0, detect=cd, mhz=600, cardmhz=600) |
||
216 | 2010/10/28 11:06:01 B76EA280 h HTTP Server listening on port 15080 |
||
217 | 2010/10/28 11:06:04 B7375280 r card detected |
||
218 | 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 |
||
219 | 2010/10/28 11:06:09 B7375280 r Maximum frequency for this card is formally 6 Mhz, clocking it to 6.00 Mhz |
||
220 | 2010/10/28 11:06:10 B7375280 r detect irdeto card |
||
221 | 2010/10/28 11:06:10 B7375280 r caid: 0604, acs: 6.08, country code: NLD |
||
222 | 2010/10/28 11:06:10 B7375280 r providers: 4, ascii serial: xxxxxxxxxxx, hex serial: XXXXXX, hex base: XX |
||
223 | 2010/10/28 11:06:13 B7375280 r active providers: 4 (xxxxxx,xxxxxx,xxxxxx,xxxxxx) |
||
224 | 2010/10/28 11:06:13 B7375280 r found cardsystem |
||
225 | 2010/10/28 11:06:14 B7375280 r entitlements for provider: 1, id: XXXXXX |
||
226 | 2010/10/28 11:06:14 B7375280 r chid: 0001, date: 2004/08/16 - 2004/09/15 |
||
227 | 2010/10/28 11:06:14 B7375280 r chid: 000B, date: 2004/08/16 - 2004/09/15 |
||
228 | 2010/10/28 11:06:14 B7375280 r chid: FFE0, date: 2004/08/16 - 2004/08/20 |
||
229 | 2010/10/28 11:06:14 B7375280 r chid: 0384, date: 2004/08/16 - 2004/09/15 |
||
230 | 2010/10/28 11:06:14 B7375280 r chid: 000D, date: 2004/08/16 - 2004/09/15 |
||
231 | 2010/10/28 11:06:19 B7375280 r [irdeto-reader] ready for requests |
||
232 | 2010/10/28 11:06:19 B73DF6C0 s init for all local cards done |
||
233 | 2010/10/28 11:06:19 B73DF6C0 s anti cascading disabled |
||
234 | 2010/10/28 11:06:19 B736E280 c client connected to 15050 port |
||
235 | 2010/10/28 11:06:19 B7367280 c client connected to 15050 port |
||
236 | 2010/10/28 11:06:19 B7367280 c Connection closed to client |
||
237 | 2010/10/28 11:06:19 B736E280 c Connection closed to client |
||
238 | 2010/10/28 11:06:19 B7367280 c thread B7367280 ended! |
||
239 | 2010/10/28 11:06:19 B736E280 c thread B736E280 ended! |
||
240 | 12 | William Peters | }}} |
241 | 2 | William Peters | |
242 | 1 | William Peters | Oscam is now running on serverip:15050. |
243 | Open your tvheadend web interface. |
||
244 | Go to Configuration -> Code Word Client |
||
245 | Click Add Entry |
||
246 | Doubleclick 'hostname' type your server ip or hostname that is runnin oscam. |
||
247 | 2 | William Peters | Doubleclick 'port' type the port number (if you made no changes to config files it should be 15050). |
248 | 11 | William Peters | Doubleclick 'username' type the username as configured in oscam.user. |
249 | 2 | William Peters | Doubleclick 'password' type the password as configured in oscam.user. |
250 | 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 |
||
251 | 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. |
252 | 5 | William Peters | Now check Enabled and click 'Save Changes' |
253 | |||
254 | When you click Save Changes you will see something like this in the system logs |
||
255 | |||
256 | {{{ |
||
257 | 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 |
||
258 | Mar 24 20:55:38 cwc: 10.2.0.2: irdeto card |
||
259 | 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 |
260 | Mar 24 20:55:38 cwc: 10.2.0.2: Provider ID #2: 0x000001 xx.xx.xx.xx.xx.xx.xx.xx |
||
261 | Mar 24 20:55:38 cwc: 10.2.0.2: Provider ID #3: 0x000002 xx.xx.xx.xx.xx.xx.xx.xx |
||
262 | Mar 24 20:55:38 cwc: 10.2.0.2: Provider ID #4: 0x000003 xx.xx.xx.xx.xx.xx.xx.xx |
||
263 | Mar 24 20:55:38 cwc: 10.2.0.2: Provider ID #5: 0x000004 xx.xx.xx.xx.xx.xx.xx.xx |
||
264 | Mar 24 20:55:38 cwc: 10.2.0.2: Will forward EMMs |
||
265 | 7 | Lars Op den Kamp - | }}} |
266 | 2 | William Peters | |
267 | 7 | Lars Op den Kamp - | now to kill oscam press ctrl+c in the console. |
268 | 2 | William Peters | |
269 | Ok tvheadend is now connected to oscam and is able to descramble channels that your card gives you access to. |
||
270 | |||
271 | ~~At this moment tvheadend does not support EMM updates, this means you have to update your card atleast once a week. |
||
272 | This can be done by inserting your smartcard for 30 minutes in the retail dvb-c setop box. |
||
273 | After that restart oscam.~~ |
||
274 | |||
275 | |||
276 | == For Gentoo users i have an init script == |
||
277 | |||
278 | nano -w /etc/init.d/oscam |
||
279 | {{{ |
||
280 | 15 | William Peters | #!/sbin/runscript |
281 | 2 | William Peters | # Copyright 1999-2010 Gentoo Foundation |
282 | # Distributed under the terms of the GNU General Public License v2 |
||
283 | # $Header: |
||
284 | |||
285 | 14 | William Peters | depend() { |
286 | 2 | William Peters | use net |
287 | } |
||
288 | |||
289 | start() { |
||
290 | 14 | William Peters | ebegin "Starting oscam" |
291 | start-stop-daemon \ |
||
292 | --start \ |
||
293 | --user $OSCAMUSER \ |
||
294 | --name $OSCAMNAME \ |
||
295 | 2 | William Peters | --exec $OSCAMBIN -- $OSCAMOPTS |
296 | eend $? |
||
297 | } |
||
298 | |||
299 | stop() { |
||
300 | 1 | William Peters | ebegin "Stopping oscam" |
301 | 2 | William Peters | start-stop-daemon --stop --signal 2 --name $OSCAMNAME |
302 | eend $? |
||
303 | } |
||
304 | }}} |
||
305 | |||
306 | nano -w /etc/conf.d/oscam |
||
307 | 1 | William Peters | {{{ |
308 | # /etc/conf.d/oscam: config file for /etc/init.d/oscam |
||
309 | 14 | William Peters | |
310 | OSCAMOPTS="-b -c /opt/oscam/etc/" |
||
311 | 19 | William Peters | OSCAMUSER="oscam" |
312 | 14 | William Peters | OSCAMNAME="oscam.bin" |
313 | OSCAMBIN="/opt/oscam/${OSCAMNAME}" |
||
314 | 1 | William Peters | }}} |