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