Tvheadend oscam ziggo » History » Version 2
William Peters, 2010-03-14 13:20
1 | 1 | William Peters | This article describes how to build and configure oscam. |
---|---|---|---|
2 | |||
3 | Make sure you have cmake and subversion installed, these are required for checking out and building oscam. |
||
4 | |||
5 | create the required directories |
||
6 | |||
7 | {{{ |
||
8 | mkdir -p /opt/oscam/src/ |
||
9 | }}} |
||
10 | |||
11 | Now we need to checkout the oscam source code using SVN |
||
12 | |||
13 | {{{ |
||
14 | svn co http://oscam.ump2002.net/svn/oscam/trunk/ /opt/oscam/src/ |
||
15 | }}} |
||
16 | |||
17 | Now we need to build oscam |
||
18 | |||
19 | {{{ |
||
20 | cd /opt/oscam/src/ |
||
21 | make |
||
22 | }}} |
||
23 | 2 | William Peters | |
24 | After oscam is built you should have a file like 'oscam-0.99.4svn1920-i686-pc-linux' in /opt/oscam/src/Distribution/. |
||
25 | We need to copy this file to an alternate location |
||
26 | |||
27 | {{{ |
||
28 | cd /opt/oscam/src/Distribution/ |
||
29 | cp ./oscam-0.99.4svn1920-i686-pc-linux /opt/oscam/oscam.bin |
||
30 | }}} |
||
31 | |||
32 | Ok, the binaries are installed :) |
||
33 | Now we need to configure oscam first create the configuration directories |
||
34 | |||
35 | {{{ |
||
36 | mkdir -p /opt/oscam/etc/ |
||
37 | mkdir -p /opt/oscam/etc/cw/ |
||
38 | }}} |
||
39 | |||
40 | Note: /opt/oscam/etc/cw/ is used for caching keys. |
||
41 | |||
42 | Now, create oscam.conf in /opt/oscam/etc/oscam.conf |
||
43 | |||
44 | {{{ |
||
45 | [global] |
||
46 | nice = -1 |
||
47 | WaitForCards = 1 |
||
48 | pidfile = /opt/oscam/oscam.pid |
||
49 | logfile = /opt/oscam/oscam.log |
||
50 | usrfile = /opt/oscam/oscamuser.log |
||
51 | cwlogdir = /opt/oscam/etc/cw |
||
52 | clienttimeout = 1 |
||
53 | |||
54 | [monitor] |
||
55 | port = 988 |
||
56 | aulow = 120 |
||
57 | monlevel = 0 |
||
58 | |||
59 | [newcamd] |
||
60 | key = 0102030405060708091011121314 #Note this is the DES key used for encrypting communication between oscam and tvheadend |
||
61 | port = 15050@0604:000000 |
||
62 | }}} |
||
63 | |||
64 | Now create oscam.server in /opt/oscam/etc/oscam.server |
||
65 | |||
66 | {{{ |
||
67 | [reader] |
||
68 | Label = Ziggo |
||
69 | Device = /dev/ttyUSB0 #In this case my 6MHz usb smartcard reader |
||
70 | mhz = 600 |
||
71 | cardmhz = 600 |
||
72 | Protocol = mouse |
||
73 | EMMCache = 1,3,2 |
||
74 | Group = 1 |
||
75 | caid = 0604:0000 |
||
76 | rsakey = 3C8633AAC0D367533DEC7BB2EEEDEB8CA3ADA52E58B99BB34672783277A1DAAC3B6106AD0909774E031B2A6E30195B437683AD0FC599B87D08CEA47BE1B6C76A # only change this when it is required! |
||
77 | boxkey = 1122334455667788 # only change this when it is required! |
||
78 | fallback = 0 |
||
79 | }}} |
||
80 | |||
81 | Now create oscam.user in /opt/oscam/etc/oscam.user |
||
82 | |||
83 | {{{ |
||
84 | [account] |
||
85 | user = tvheadend |
||
86 | pwd = tvheadend |
||
87 | uniq = 0 |
||
88 | group = 1 |
||
89 | ident = 0604:000000 |
||
90 | caid = 0604 |
||
91 | }}} |
||
92 | |||
93 | Ok, if everything is configured correctly we can test the oscam installation |
||
94 | |||
95 | {{{ |
||
96 | /opt/oscam/oscam.bin -c /opt/oscam/etc/& touch /opt/oscam/oscam.log ; tail -f /opt/oscam/oscam.log ; killall oscam.bin |
||
97 | }}} |
||
98 | |||
99 | this should create some output like this |
||
100 | |||
101 | {{{ |
||
102 | ------------------------------------------------------------------------------- |
||
103 | >> OSCam << cardserver started at Sun Mar 14 13:04:17 2010 |
||
104 | ------------------------------------------------------------------------------- |
||
105 | 2010/03/14 13:04:17 2726 s version=0.99.4svn, build #1276, system=i686-pc-linux, nice=-1 |
||
106 | 2010/03/14 13:04:17 2726 s max. clients=509, client max. idle=120 sec |
||
107 | 2010/03/14 13:04:17 2726 s max. logsize=unlimited |
||
108 | 2010/03/14 13:04:17 2726 s client timeout=1000 ms, fallback timeout=2500 ms, cache delay=0 ms |
||
109 | 2010/03/14 13:04:17 2726 s shared memory initialized (size=4182108, id=1376260) |
||
110 | 2010/03/14 13:04:17 2726 s WARNING: fallbacktimeout adjusted to 900 ms (must be smaller than clienttimeout (1000 ms)) |
||
111 | 2010/03/14 13:04:17 2726 s WARNING: fallbacktimeout adjusted to 1600 ms (must be greater than serialreadertimeout (1500 ms)) |
||
112 | 2010/03/14 13:04:17 2726 s WARNING: clienttimeout adjusted to 1600 ms (must be greater than serialreadertimeout (1500 ms)) |
||
113 | 2010/03/14 13:04:17 2726 s auth size=4744 |
||
114 | 2010/03/14 13:04:17 2726 s Cannot open file "/opt/oscam/etc//oscam.services" (errno=2) |
||
115 | 2010/03/14 13:04:17 2726 s userdb reloaded: 0 accounts freed, 2 accounts loaded, 0 expired, 0 disabled |
||
116 | 2010/03/14 13:04:17 2726 s signal handling initialized (type=sysv) |
||
117 | 2010/03/14 13:04:17 2726 s can't open file "/opt/oscam/etc//oscam.srvid" (err=2), no service-id's loaded |
||
118 | 2010/03/14 13:04:17 2726 s monitor: initialized (fd=7, port=988) |
||
119 | 2010/03/14 13:04:17 2726 s camd 3.3x: disabled |
||
120 | 2010/03/14 13:04:17 2726 s camd 3.5x: disabled |
||
121 | 2010/03/14 13:04:17 2726 s cs378x: disabled |
||
122 | 2010/03/14 13:04:17 2726 s newcamd: initialized (fd=8, port=15050, crypted) |
||
123 | 2010/03/14 13:04:17 2726 s CAID: 0604 |
||
124 | 2010/03/14 13:04:17 2726 s provid #0: 000000 |
||
125 | 2010/03/14 13:04:17 2726 s radegast: disabled |
||
126 | 2010/03/14 13:04:17 2726 s resolver thread started |
||
127 | 2010/03/14 13:04:17 2726 s logger started (pid=2730) |
||
128 | 2010/03/14 13:04:17 2726 s resolver started (pid=2731, delay=30 sec) |
||
129 | 2010/03/14 13:04:17 2726 s reader started (pid=2732, device=/dev/ttyUSB0, detect=cd, mhz=600, cardmhz=600) |
||
130 | 2010/03/14 13:04:17 2726 s Waiting for local card init .... |
||
131 | 2010/03/14 13:04:20 2732 r02 card detected |
||
132 | 2010/03/14 13:04:23 2732 r02 ATR: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX |
||
133 | 2010/03/14 13:04:24 2732 r02 type: irdeto, caid: 0604, acs: 6.08 |
||
134 | 2010/03/14 13:04:24 2732 r02 ascii serial: XXXXXXXXXX, hex serial: XXXXXX, hex base: XX |
||
135 | 2010/03/14 13:04:27 2732 r02 ready for requests |
||
136 | 2010/03/14 13:04:27 2732 r02 card detected |
||
137 | 2010/03/14 13:04:27 2732 r02 type: irdeto |
||
138 | 2010/03/14 13:04:27 2732 r02 providers: 4 (0645bd,005500,005500,005500) |
||
139 | 2010/03/14 13:04:27 2732 r02 provider: 1, id: 0645BD |
||
140 | 2010/03/14 13:04:27 2732 r02 chid: 0001, date: 2003/12/26 - 2004/01/25 |
||
141 | 2010/03/14 13:04:27 2732 r02 chid: 000B, date: 2003/12/26 - 2004/01/25 |
||
142 | 2010/03/14 13:04:27 2732 r02 chid: FFE0, date: 2003/12/26 - 2003/12/30 |
||
143 | 2010/03/14 13:04:27 2732 r02 chid: 0384, date: 2003/12/26 - 2004/01/25 |
||
144 | 2010/03/14 13:04:27 2732 r02 chid: 000D, date: 2003/12/26 - 2004/01/25 |
||
145 | 2010/03/14 13:04:32 2726 s Init for all local cards done ! |
||
146 | 2010/03/14 13:04:32 2726 s anti cascading disabled |
||
147 | }}} |
||
148 | |||
149 | Oscam is now running on serverip:15050. |
||
150 | Open your tvheadend web interface. |
||
151 | Go to Configuration -> Code Word Client |
||
152 | Click Add Entry |
||
153 | Doubleclick 'hostname' type your server ip or hostname that is runnin oscam. |
||
154 | Doubleclick 'port' type the port number (if you made no changes to config files it should be 15050). |
||
155 | Doubleclick 'username' type the username as configured in oscam.user. |
||
156 | Doubleclick 'password' type the password as configured in oscam.user. |
||
157 | Doubleclick 'DES key' here you can insert your DES key. If you haven't changed oscam.conf (you should!) then this should be: 01:02:03:04:05:06:07:08:09:10:11:12:13:14 |
||
158 | Leave Update Card unchecked, at this moment tvheadend does not support EMM updates this option won't be used anyway. |
||
159 | Now check Enabled and click 'Save Changes' |
||
160 | |||
161 | When you click Save Changes you will something like this in the system logs |
||
162 | |||
163 | {{{ |
||
164 | Mar 14 13:11:55 cwc: Attemping to connect to serverip:15050 |
||
165 | Mar 14 13:11:55 cwc: Connected to serverip:15050 |
||
166 | Mar 14 13:11:55 cwc: serverip: Connected as user 0x0e to a Irdeto-card [0x0604 : 00.00.00.00.00.00.00.00] with 1 providers |
||
167 | Mar 14 13:11:55 cwc: serverip: Provider ID #1: 0x000000 00.00.00.00.00.00.00.00 |
||
168 | }}} |
||
169 | |||
170 | now to kill oscam press ctrl+c in the console. |
||
171 | |||
172 | Ok tvheadend is now connected to oscam and is able to descramble channels that your card gives you access to. |
||
173 | |||
174 | At this moment tvheadend does not support EMM updates, this means you have to update your card atleast once a week. |
||
175 | This can be done by inserting your smartcard for 30 minutes in the retail dvb-c setop box. |
||
176 | After that restart oscam. |
||
177 | |||
178 | |||
179 | == For Gentoo users i have an init script == |
||
180 | |||
181 | nano -w /etc/init.d/oscam |
||
182 | {{{ |
||
183 | #!/sbin/runscript |
||
184 | # Copyright 1999-2010 Gentoo Foundation |
||
185 | # Distributed under the terms of the GNU General Public License v2 |
||
186 | # $Header: |
||
187 | |||
188 | CONF="${myservice##*.}" |
||
189 | |||
190 | depend() { |
||
191 | need net |
||
192 | } |
||
193 | |||
194 | start() { |
||
195 | ebegin "Starting oscam" |
||
196 | start-stop-daemon --start --pidfile ${OSCAM_PID} \ |
||
197 | --exec ${OSCAM_BIN} -- ${OSCAM_OPTS} |
||
198 | eend $? |
||
199 | } |
||
200 | |||
201 | stop() { |
||
202 | ebegin "Stopping oscam" |
||
203 | start-stop-daemon --stop --quiet --pidfile ${OSCAM_PID} --signal 2 |
||
204 | eend $? |
||
205 | rm -f ${PIDFILE} |
||
206 | } |
||
207 | }}} |
||
208 | |||
209 | nano -w /etc/conf.d/oscam |
||
210 | {{{ |
||
211 | # /etc/conf.d/oscam: config file for /etc/init.d/oscam |
||
212 | |||
213 | OSCAM_OPTS="-b -c /opt/oscam/etc/" |
||
214 | OSCAM_BIN="/opt/oscam/oscam.bin" |
||
215 | OSCAM_PID="/opt/oscam/oscam.pid" |
||
216 | }}} |