Tvheadend oscam ziggo » History » Version 23
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 | 23 | ruud - | <pre> |
11 | 19 | William Peters | useradd oscam -s /sbin/nologin -m -d /opt/oscam/ |
12 | gpasswd -a oscam uucp |
||
13 | 23 | ruud - | </pre> |
14 | 19 | William Peters | |
15 | 1 | William Peters | create the required directories |
16 | |||
17 | 23 | ruud - | <pre> |
18 | 19 | William Peters | mkdir /opt/oscam/src/ |
19 | 23 | ruud - | </pre> |
20 | 1 | William Peters | |
21 | Now we need to checkout the oscam source code using SVN |
||
22 | |||
23 | 23 | ruud - | <pre> |
24 | 17 | William Peters | svn co http://streamboard.gmc.to/svn/oscam /opt/oscam/src/ |
25 | 23 | ruud - | </pre> |
26 | 1 | William Peters | |
27 | 17 | William Peters | Now we need to configure oscam |
28 | 23 | ruud - | <pre> |
29 | 20 | ruud - | cd /opt/oscam/src/trunk |
30 | 17 | William Peters | ./config.sh |
31 | 23 | ruud - | </pre> |
32 | 17 | William Peters | |
33 | This is my configuration |
||
34 | 23 | ruud - | <pre> |
35 | 17 | William Peters | 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 | 23 | ruud - | </pre> |
67 | 17 | William Peters | |
68 | Now compile oscam |
||
69 | 23 | ruud - | <pre> |
70 | 1 | William Peters | make |
71 | 23 | ruud - | </pre> |
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 | 23 | ruud - | <pre> |
77 | 2 | William Peters | cd /opt/oscam/src/Distribution/ |
78 | 21 | ruud - | cp ./oscam-* /opt/oscam/oscam.bin |
79 | 23 | ruud - | </pre> |
80 | 2 | William Peters | |
81 | Ok, the binaries are installed :) |
||
82 | Now we need to configure oscam first create the configuration directories |
||
83 | |||
84 | 23 | ruud - | <pre> |
85 | 2 | William Peters | mkdir -p /opt/oscam/etc/ |
86 | mkdir -p /opt/oscam/etc/cw/ |
||
87 | 23 | ruud - | </pre> |
88 | 2 | William Peters | |
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 | 23 | ruud - | <pre> |
96 | 1 | William Peters | [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 | 23 | ruud - | </pre> |
144 | 1 | William Peters | |
145 | Now create oscam.server in /opt/oscam/etc/oscam.server |
||
146 | |||
147 | 23 | ruud - | <pre> |
148 | 1 | William Peters | [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 | 23 | ruud - | </pre> |
161 | 1 | William Peters | |
162 | Now create oscam.user in /opt/oscam/etc/oscam.user |
||
163 | |||
164 | 23 | ruud - | <pre> |
165 | 1 | William Peters | [account] |
166 | user = tvheadend |
||
167 | pwd = tvheadend |
||
168 | uniq = 0 |
||
169 | group = 1 |
||
170 | ident = 0604:000000 |
||
171 | caid = 0604 |
||
172 | au = Ziggo |
||
173 | 23 | ruud - | </pre> |
174 | 1 | William Peters | |
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 | 23 | ruud - | <pre> |
178 | 19 | William Peters | chown -R oscam:oscam /opt/oscam |
179 | 23 | ruud - | </pre> |
180 | 14 | William Peters | |
181 | 1 | William Peters | Ok, if everything is configured correctly we can test the oscam installation |
182 | |||
183 | 23 | ruud - | <pre> |
184 | 1 | William Peters | /opt/oscam/oscam.bin -c /opt/oscam/etc/& touch /opt/oscam/oscam.log ; tail -f /opt/oscam/oscam.log ; killall oscam.bin |
185 | 23 | ruud - | </pre> |
186 | 2 | William Peters | |
187 | this should create some output like this |
||
188 | |||
189 | 23 | ruud - | <pre> |
190 | 2 | William Peters | ------------------------------------------------------------------------------- |
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 | 23 | ruud - | </pre> |
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 | Doubleclick 'port' type the port number (if you made no changes to config files it should be 15050). |
||
250 | 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 | 11 | William Peters | 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 | 23 | ruud - | 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 | 2 | William Peters | Now check Enabled and click 'Save Changes' |
255 | 16 | William Peters | |
256 | 5 | William Peters | When you click Save Changes you will see something like this in the system logs |
257 | |||
258 | 23 | ruud - | <pre> |
259 | 5 | William Peters | 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 | 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 | 2 | William Peters | 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 | 23 | ruud - | </pre> |
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 | 1 | William Peters | |
273 | 23 | ruud - | -At this moment tvheadend does not support EMM updates, this means you have to update your card atleast once a week. |
274 | 1 | William Peters | This can be done by inserting your smartcard for 30 minutes in the retail dvb-c setop box. |
275 | 23 | ruud - | After that restart oscam.- |
276 | 2 | William Peters | |
277 | |||
278 | |||
279 | 23 | ruud - | h2. For Gentoo users i have an init script |
280 | |||
281 | |||
282 | 2 | William Peters | nano -w /etc/init.d/oscam |
283 | 23 | ruud - | <pre> |
284 | 15 | William Peters | #!/sbin/runscript |
285 | 2 | William Peters | # Copyright 1999-2010 Gentoo Foundation |
286 | # Distributed under the terms of the GNU General Public License v2 |
||
287 | # $Header: |
||
288 | |||
289 | 14 | William Peters | depend() { |
290 | 2 | William Peters | use net |
291 | } |
||
292 | |||
293 | start() { |
||
294 | 14 | William Peters | ebegin "Starting oscam" |
295 | start-stop-daemon \ |
||
296 | --start \ |
||
297 | --user $OSCAMUSER \ |
||
298 | --name $OSCAMNAME \ |
||
299 | 2 | William Peters | --exec $OSCAMBIN -- $OSCAMOPTS |
300 | eend $? |
||
301 | } |
||
302 | |||
303 | stop() { |
||
304 | 1 | William Peters | ebegin "Stopping oscam" |
305 | 2 | William Peters | start-stop-daemon --stop --signal 2 --name $OSCAMNAME |
306 | eend $? |
||
307 | } |
||
308 | 23 | ruud - | </pre> |
309 | 2 | William Peters | |
310 | nano -w /etc/conf.d/oscam |
||
311 | 23 | ruud - | <pre> |
312 | 1 | William Peters | # /etc/conf.d/oscam: config file for /etc/init.d/oscam |
313 | 14 | William Peters | |
314 | OSCAMOPTS="-b -c /opt/oscam/etc/" |
||
315 | 19 | William Peters | OSCAMUSER="oscam" |
316 | 14 | William Peters | OSCAMNAME="oscam.bin" |
317 | OSCAMBIN="/opt/oscam/${OSCAMNAME}" |
||
318 | 23 | ruud - | </pre> |