OSCAM external card reader [TUTORIAL]

jotne

Registered
Messages
20
OSCam with PC/CS card reader support


If you like to setup a Linux Server and using OSCam with a local card, you need a card reader.

Here is a simple tutorial on how to get a card reader up and running.

This tutorial will work for most reader out there:
Omnikey
Keyboard with card reader
Integrated reader in a portable computer


This should work on Ubuntu 12.x and up (and other Linux distro)

Install needed software
Code:
apt-get install subversion make gcc pcscd pcsc-tools libpcsclite-dev
Code:
[B]subversion[/B] -> file/documents controll system, compiling
[B]make[/B] -> compiling tools
[B]gcc[/B] -> compiling tools controlling process
[B]pcscd[/B] -> PC/SC Smart Card Daemon
[B]pcsc-tools[/B] -> Adds pcsc_scan, a too for scanning PC/SC Smart Card
[B]libpcsclite-dev[/B] -> Middleware to access a smart card using PC/SC - files need for compiling and linking app to reader

You can update the card list for the PC/SC software (optional)
Code:
wget http://ludovic.rousseau.free.fr/softwares/pcsc-tools/smartcard_list.txt --output-document=/root/.smartcard_list.txt

Test if cardreader is found and working
Run:
Code:
pcsc_scan
Insert and remove card, and you should see some like this:
Code:
0: HP USB Smart Card Keyboard [CCID Interface] (0819ffc3) 00 00

Wed Apr  9 08:34:44 2014
[B]Reader 0[/B]: HP USB Smart Card Keyboard [CCID Interface] (0819ffc3) 00 00
  Card state: Card inserted,
  ATR: 3C 24 00 20 4A 10 20

ATR: 3C 24 00 20 4A 10 20
+ TS = 3B --> Direct Convention
+ T0 = 24, Y(1): 0010, K: 4 (historical bytes)
  TB(1) = 00 --> VPP is not electrically connected
+ Historical bytes: 30 42 30 30
  Category indicator byte: 30 (proprietary format)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3C 24 00 20 4A 10 20
        ComHem Digital-TV smartcard (Sweden)
        TNK Telewizja Na Karte (Poland) - Conditional access system : Conax (Sweeden)
        http://telewizjanakarte.pl/


Wed Apr  9 08:34:57 2014
[CODE]Reader 0
: HP USB Smart Card Keyboard [CCID Interface] (0819ffc3) 00 00
Card state: Card removed,[/CODE]
Press CTRL-C to exit.
The 0: and Reader 0, tells you that this is reader 0 in OScam

Get and install OSCam (will download latest build)
Code:
cd /tmp
svn checkout http://www.streamboard.tv/svn/oscam/trunk oscam-svn
cd oscam-svn

Compile OSCam with PC/SC support
Code:
make USE_PCSC=1

All this lines should bee included to tell you that PC/CS support is added
Code:
|  CFLAGS   = -DWITH_PCSC=1 -I/usr/include/PCSC
|  LDFLAGS  = -Wl,--gc-sections -DWITH_PCSC=1 -I/usr/include/PCSC
|  LIBS     = -lpcsclite -lpthread -ldl -lrt
|  UseFlags = USE_PCSC=1
|  Binary   : Distribution/oscam-1.20-unstable_svn9646-x86_64-linux-gnu-pcsc
CC      csctapi/ifd_pcsc.c
LINK    Distribution/oscam-1.20-unstable_svn9646-x86_64-linux-gnu-pcsc.debug
STRIP   Distribution/oscam-1.20-unstable_svn9646-x86_64-linux-gnu-pcsc

Copy it to bin directory (replace 9668 with your downloaded version)
Code:
cd Distribution
mkdir /var/bin
cp oscam-1.20-unstable_svn9668-i686-linux-gnu /var/bin/oscam9668

Start OSCam
Code:
/var/bin/oscam9668 -b

Find Web port (normal 8888)
Code:
netstat -topan | grep oscam

Launch webif OSCam
Code:
http://ip:8888


Add reader
Code:
Reader -> Add Reader
# Give a propper name
Enable: X
Device: 0  #Use device name found by pcsc_scan, remember to reboot after adding new device
Group: 1
Emmcache: 1,3,2

To see new reader if OScam is 9668 or newer, do
Code:
Readers -> Reload Readers
for older version
Code:
Reload OScam

Look in Status page to see the new card :)


That's it.
Jotne

Feel free to ask question.
 

maac68

Registered
Messages
4
Hello,
I have just used your tutorial and everything went well,but i have this card from local broadcaster and another irdeto card for xxx channels, i have oscam-svn (latest as of today) on ubuntu with omnikey 3121 as pcsc, after i insert the card it gives me card system not supported for the first card and an error message keeps occuring for the second one (card unresponsive in pcsc_scan), however on DM500HD with oscam 1.20 r1442, both cards work just fine with same config, first one is detected as dgcrypt but no entitelments, but sending normal ecms, and the irdeto is running at 600 mhz with complete entitelments and no problem with ecms, do u know what might be wrong ?
 

steenboston222

Registered
Messages
1
I want to install debian 11 on a PC with an intelligent reader since I have a clear satellite TV card. I have tried it today November 28, 2022 and it does not work. Could you please put the commands to work with Ubuntu or debian 1. I have problems with the PCSC protocol. When compiling I get an error. Thanks for your time and the forum.
 
Top