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