Thursday, June 23, 2011

oscam script for linux

#!/bin/sh
if ps x | grep -v grep | grep oscam ;
then
echo 'date' "Oscam working" >> /tmp/Check_Oscam.log
else
echo 'date' "Restarting Oscam...." >> /tmp/Check_Oscam.log
/usr/local/bin/oscam -b
fi



OSCam in AZbug HD with original FW 5303: both server and client at once!

OK, this works - tested with my Conax CD card CAS5!!! - both as a card reader/server, as well as a client, so no need for any other Emus, thanx to various people for sharing info, like I am trying to do now... Augenzwinkern

After plenty of testing, many different configurations on a couple of OSs [original FW and E2] and a couple of original FWs [4890 and 5303], as well as a couple of E2 [RC4 and RC7]...

The version of OSCam I am using, fairly successfully, with all the stops, bumps, reboots and so on, is 4859, with dvbapii!!! You can find it on OSCam forum, in AZbox HD section, the "sticky" thread with bin files... But I will attach it in this thread, if I can! smile

FTP to AZbug HD [use the freeware FileZilla Client] and go to PLUGINS folder, then OpenXCAS and create a folder oscamCAS, then give it CHMOD to 755 [right click on the file -> File permissions -> 755 -> OK].

On your PC you can create various files, using a freeware application Notepad++, which you will FTP to oscamCAS folder. All except oscam module itself, which you get from the net, as mentioned and then give CHMOD to 755, as above. If it is named differently -> right click on it -> rename it to oscam and hit Enter on your keyboard.

So, here are the four main configuration files [do not deviate from them, for starters... later, try different ones...] - thanx primarily to B@mbi but also hperez, gianni, subnixonfire, Siri, belami etc. etc.:

openxcas.conf


code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
[module]
name = oscamCAS
daemon = oscam -d 255
argument = c /PLUGINS/OpenXCAS/oscamCAS/
version = 1.00
api=Yes
wait =5sec
INFO = /tmp/ecm.info
REFRESH = 2
Note: the "-d 255" line is worth its weight in gold, so to speak... Now AZbug HD reads the card consistently and fairly efficiently! Thanx to Siri!

oscam.conf

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
# oscam.conf generated automatically by Streamboard OSCAM 1.00-unstable_svn build #4859
# Read more: http://streamboard.gmc.to/oscam/browser/trunk/Distribution/doc/txt/oscam.conf.txt

[global]
logfile = /tmp/oscam.log
clientmaxidle = 9000
cachedelay = 120
unlockparental = 1
nice = 4
maxlogsize = 100
preferlocalcards = 1
saveinithistory = 1
lb_mode = 100

[monitor]
port = 988
nocrypt = 127.0.0.1,192.168.1.1-192.168.1.253
aulow = 120
hideclient_to = 0
monlevel = 4
appendchaninfo = 1

[newcamd]
port = [b]xxxxxx[/b]@[b]xxxx:xxxxxx[/b]
key = 0102030405060708091011121314
allowed =
keepalive = 1
mgclient = 0

[cccam]
port = [b]xxxxxx[/b]
reshare = 2
ignorereshare = 0
forward_origin_card = 0
version = 2.2.1
updateinterval = 240
minimizecards = 0
keepconnected = 1
stealth = 1
reshare_mode = 0

[dvbapi]
enabled = 1
au = 1
boxtype = none
user = azbox
pmt_mode = 0
request_mode = 0

[webif]
httpport = 80
httphelplang = en
httpuser = [b]xxxxxx[/b]
httppwd = [b]xxxxxx[/b]
httprefresh = 7
httpallowed = 127.0.0.1,192.168.0.1-192.168.255.255
httphideidleclients = 0
httpreadonly = 0
httpsavefullcfg = 0
Note: xxxxxx = this you choose, whatever it is... ergo xxxxxx = whatever you desire or whatever the CAID of your smartcard... Augenzwinkern

You will need to forward the ports here defined, in your modem/router. "Forwarding ports" means to open those ports up to your AZbug HD, so when your peers try to get to you the traffic will not be blocked and it will automatically be directed to AZbox HD, instead of any other device you have hooked onto your home network, via the same modem/router.

oscam.server

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
[reader]
label = azbox-internal
enable = 1
protocol = internal
device = 0
services = [b]whichever_card_you_have[/b]
caid = [b]xxxx[/b]
ident = [b]xxxx:xxxxxx[/b]
detect = cd
mhz = 357
cardmhz = 357
group = 1
emmcache = 1,1,2
lb_weight = 500


[reader]
label = [b]xxxxxx[/b].dyndns.biz
enable = 1
protocol = cccam
device = [b]xxxxxx[/b].dyndns.biz,17000
user = [b]xxxxxx[/b]
password = [b]xxxxxx[/b]
lb_weight = 100
#inactivitytimeout = 1
reconnecttimeout = 30
#audisabled = 1
group = 2
cccversion = 2.2.1
cccmaxhops = 1
ccckeepalive = 1
#emmcache = 1,2,2
#fallback = 1


(...plus as many servers of your colleagues as you have, like the second example above...)
A note, to explain the name of the file: the first [reader] is your [internal or embedded card] reader, the "server" primarily for yourself, to which the OSCam client part hooks onto, internally, to open the channels.

All the following ones are external [readers]. They are also servers but they are the servers of your peers, to which you hook onto, as a client. I.e. their readers read their cards, not just for themselves, but for you, too.

Hence all are simply "readers", whether local [yours] or remote [virtual, via internet].

The details marked xxxxxx in those you get from your colleagues/peers, like username, password, port and dyndns domain name. Those are necessary to be able to hook onto their servers.

As a client in CCcam protocol one does not need to open various ports, Only servers [your colleagues/"peers" giving you access to their cards] need to do that.

For now, let's just say that your embedded cardreader/internal reader/server should be in Group 1, whereas your CCcam peers should be in Group 2. If you have many C lines you can sub-divide them further, to make it all better optimised/efficient. We shall come to that later.

oscam.user

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
[account]
user = azbox
group = 1,2
au = azbox-internal
monlevel = 4
uniq = 0
services = all
betatunnel = 1833.FFFF:1702
keepalive = 1

[account]
user = [b]xxxxxx[/b]
pwd = [b]xxxxxx[/b]
monlevel = 2
uniq = 1
group = 1
au = 1

(...and so on, as many as you have...)
Note: the file is called oscam.user because in it you are setting various "users" or "clients" to your "server". Each "user" in your file has an "account" with the server. I.e. a user will use your server/services, whether internally [the first one is you and you will hook onto your own card reader/server] or externally.

Externally speaking: partially, you allow your peers access to your server right here, by setting up their username and password. The other parts to allow them access to your server, with which you create C (for your CCcam clients) or N (for your Newcamd clients) lines for your peers/colleagues, are from oscam.conf file, which we will discuss a little bit later, in the P.P.S.

You can divide the [readers] and [accounts] into groups.

For instance, your own internal server [the first "reader"] is in group 1.

All the other "readers", are in group 2.

The very first "account", i.e. "user" has to be in both groups 1 and 2, to hook both onto your own server/reader, as well as your colleague's readers/servers. So, this first user [which is yourself] must hook onto both your internal reader/server [group 1], as well as external readers [group 2].

The other users/accounts are, in my case, Newcamd protocol clients of mine [me being a server, in this case, passing my smartcard to them], i.e. they are getting access solely to my smartcard [internal] reader/server by being placed in Group 1. That way they will not draw from anything but my smartcard/reader.

Apparently, Newcamd server is meant for this purpose, so this is how it is supposed to be used. The N-lines you [partially] create from this file [oscam.user] and [partially] from Newcamd part of oscam.conf file, are to be given to your colleagues, people you trust. With those lines you pass only your card and nothing else and this is how it is done. These [users] are connected to my internal reader/server via Group 1 and thereby not connected to the CCcam protocol, which busy traffic is placed in Group 2.

This is enough for you to be both a [Newcamd protocol] server, as well as [mainly CCcam] client. You give your card[s] in return for other people's cards. No need to pay for "CS services", run by our little CS entrepreneurs, spoiling the fun for us!!! Augenzwinkern

I will attach the rest of the files here, including the module itself, so you don't have to search for it too much... Augenzwinkern

Cheers!Beer

OSCam in AZbox HD's E2

usr/bin/cam -> oscam module goes here, then give it -> CHMOD to 755

Does one actually rename it, like to: oscam.mips or oscam.mipsel or just oscam without extension, then reboot AZbug HD?

/var/tuxbox/config [which actually goes to /etc/tuxbox/config - it seems to me - and this is where one creates a symbolic link only] -> config files go here, of which the essential ones are these:

oscam.conf



# oscam.conf generated automatically by Streamboard OSCAM 0.99.4svn build #2940
# Read more: http://streamboard.gmc.to/oscam/browser/.../oscam.conf.txt

[global]
serverip = 127.0.0.1,192.168.x.x
usrfile = /tmp/oscamuser.log
logfile = /tmp/oscam.log
disablelog = 0
disableuserfile = 0
usrfileflag = 0
clienttimeout = 5
fallbacktimeout = 2500
clientmaxidle = 120
failbantime = 60
failbancount = 0
cachedelay = 1
bindwait = 120
netprio = 1
unlockparental = 1
nice = -10
serialreadertimeout = 1500
maxlogsize = 100
waitforcards = 1
preferlocalcards = 1
saveinithistory = 1
readerrestartseconds = 3
readerautoloadbalance = 0
readerautoloadbalance_save = 0
lb_mode = 1

[monitor]
port = 988
nocrypt = 127.0.0.1
aulow = 30
hideclient_to = 0
monlevel = 4
appendchaninfo = 0

[newcamd]
port = xxx@0B00:000000
key = xxxxxxxxxxxxxxxxxxxxxxxxxxxx
allowed = 127.0.0.1,192.168.0.0-192.168.255.255
keepalive = 1
mgclient = 0

[cccam]
port = xxxx
reshare = 2
ignorereshare = 0
forward_origin_card = 0
version = 2.2.1
minimizecards = 0
keepconnected = 1
stealth = 1
reshare_mode = 0

[dvbapi]
enabled = 1
au = 1
boxtype = dreambox
user = localuser
pmt_mode = 0

[webif]
httpport = 80
httphelplang = en
httpuser = xxxx
httppwd = xxxx
httprefresh = 5
httpallowed = 127.0.0.1,192.168.0.1-192.168.255.255
httphideidleclients = 0
httpreadonly = 0

#[anticasc]
#enabled = 1
#numusers = 0
#sampletime = 2
#samples = 10
#penalty = 0
#aclogfile = ./oscam_ac.log
#denysamples = 8
#fakedelay = 1000


oscam.server


# Automatically generated by ccc_to_oscam v. 1.0

# internal reader

[reader]
label = azboxinternal
enable = 1
protocol = internal
device = /dev/sc0
services = canal digital
caid = 0B00
ident = 0B00:000000
detect = cd
group = 1
emmcache = 1,3,2
fallback = 0


[reader]
label = xxxxxx.dyndns.biz
protocol = cccam
device = xxxxxx.dyndns.biz,17000
account = xxxxxx,xxxxxx
group = 1
lb_weight = 100
audisabled = 1
enable = 1
fallback = 1


[...as above, a few times...]


oscam.user


# Automatically generated by ccc_to_oscam v. 1.0

#[account]
user = localuser
group = 1
au = azboxinternalreader
#pwd = azbox
monlevel = 1
uniq = 0
services = all
betatunnel = 1833.FFFF:1702
keepalive = 1

[account]
user = account1
pwd = pwd1
disabled = 0
monlevel = 2
uniq = 0
group = 1
au = 0
#services = Cdigital
ident = 0B00:000000

[...and so on, as above, a few more times, only username and pass change...]

Oscam to OScam share

So on the client it would be something like this:-

#[reader]
#label = Remotereadercam35
#enable = 1
#protocol = camd35
#device = dyndns.no-ip.info,556677
#account = username,password
#inactivitytimeout = 1
#reconnecttimeout = 30
#fix9993 = 0
#group = 3

than in conf of server

[camd35]
port = 556677
updateinterval = 240
minimizecards = 0
#######################################
On the server

oscam.confg

[cs357x]
port = 25550

[account]
user = user1
pwd = pass1
group = 1
au = 1

client machine


[reader]
label = label of reader
protocol = camd35
device = ipservert,25550
user = user1
password = pass1
services = ,,,,,,
caid = ?????
group = 1
emmcache = 1,3,2

This is an exemple of a configuration that works

script oscam auto restart when down working or not?

This script verify if oscam is running and if not they start oscam:
################################################
#!/bin/sh
if ps x |grep -v grep |grep -c oscam >/dev/null
then
echo "oscam... ok"
else
echo "oscam... restarting"
/var/script/CCcam_2.1.4_oscam_0.99.4_cam.sh start
################################################

1. put this lines into a file for ex: /var/script/Autooscam.sh
2. from blue pannel: Services/Daemons > activate crond
3. add a line in /var/spool/cron/crontabs/root for run AutoCCcam.sh at 32 minutes after the hour, or adjust the interval for your needs

# Run hourly cron jobs at 32 minutes after the hour:
32 * * * * /usr/script/Autooscam.sh

or "crontab -e root" to add the cron job: 32 * * * * /var/script/Autooscam.sh

MCAfrica-Ku-Band- Setting CAID 606 Irdeto 2 v5

[reader]
label = mck
enable = 1
protocol = internal
device = /dev/sci0
services =
caid = 0606
rsakey = 000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000
force_irdeto = 1
boxkey = 0000000000000000
detect = cd
mhz = 600
cardmhz = 600
ident = 0606:000000
group = 1
emmcache = 1,3,10
lb_weight = 100
deprecated = 1


i hope help this config

Oscam For Evolution Image

Oscam For Evolution Image

Oscam tbz2 file manuall install /tmp (after unzipping).
Attached Files

CCcam / oscam Check - Restart

CCcam / oscam Check - Restart




new update for test
Attached Files

CCcam/Oscam Automated Installation

CCcam/Oscam Automated Installation

This is an automated installation script for Linux PC based cardsevers. The original scripts written by Youknowwho (R.I.P), this is his CCcam and Oscam script put together. A few modifications had to be done to the script incorporate Oscam and its dependencies, so other than the normal programs its installs (compared to the original script), it will install a few other ones that are need for oscam and various devices to fully function.

Oscam has been compiled, x86 (not 64bit), version #5376, it has webIF and smartreader support, smargo's and serial readers are pretty much ready to go. PCSC devices (Omnikey, etc) haven't been tested so I don't know if it works, feel free to test and report if they do.

Before installation open the CCcamOscamInstall.sh script and fill in the owner name with your user login name for linux i.e. login username = server, put server next to owner. Copy files to /tmp folder, chmod 755 the script file and as root in terminal(sudo -i, for ubuntu) run the script, it will put the neccessary files where they belong. A CCcam.cfg file is included with this, however all it has is a N line for Oscam to connect to CCcam, either copy your existing cfg file into this or copy the n line to your cfg file, one or the other, otherwise it will not work. Oscam.conf, Oscam.server and Oscam.user files are included too, however these need to be edited to incorporate your setup, i.e. smargo or serial reader, caid, there is plenty of info and guides on the forums to get it properly configured.

I have tried to get this to work on Ubuntu 8.0.4.4, sadly I couldn't get it to work (common glibc2.8 not installed error), an experienced linux user probably can get it working, I couldn't. Tested and working very well in Ubuntu 10.4. I take no credit for this, just someone trying to give back to the community, anything related to the script please put in forum and i shall get back to you. Please don't contact me about card setups, etc.

A
Attached Files
File Type: zip CCcam Oscam.zip (771.9 KB, 70 views)

OScam Cards List and Configurations, all cards that can read !!!

OScam Cards List and Configurations, all cards that can read !!!

OScam Cards List and Configurations, all cards that can read !!!
How setup card with Oscam
== TV Cabo N3 (internal cardreader) ==
= Polsat N3 (internal cardreader) ===
== KabelKiosk Conax (internal cardreader) ==
== Viasat 93E NDS (internal cardreader) ==
== Viasat 90F NDS (internal cardreader) ==
== TotalTV (internal cardreader) ==
== RTV Slovenia (internal cardreader) ==
== HRT Viaccess (internal cardreader) ==
== ORF ICE (internal cardreader) ==
== Sly DE 1702 (internal cardreader) ==
== Sly DE 1702 (internal cardreader) ==
== Sly DE NDS (internal cardreader) ==
== Sly UK white – advanced config (internal cardreader) ==
== Sly UK white card (internal cardreader) ==
== SRG Suisse Viaccess 4.0 (internal cardreader) ==
== Sly IT 93b (internal cardreader) ==
== Sly IT 919 (internal cardreader) ==
== Tivusat (internal cardreader) ==
Attached Files
File Type: rar OScam Cards List and Configurations.rar (22.5 KB, 617 views)