Jump to content


Photo

playing with smart card reader using console commands

sci smartcard

  • Please log in to reply
5 replies to this topic

#1 zember

  • Member
  • 17 posts

0
Neutral

Posted 22 July 2013 - 12:56

hi, would like to get few responses from card, which is in native SC reader.

So I have VU+ DUO and OpenPLi 3.0 . I have two smart card readers /dev/sci0 and /dev/sci1. I would like to connect to one of them from console level. Is this possible? I know that this is not right way. Because cards talking in binary, anyway i need to do this. I wolud like to make just few comands like set_baudrate, make reset/get ATR, send few bytes and get response. Probably i need to talk directly to driver or somethink, can you help me? Please.

Regards,

P.S. I would rather not write python scripts unless it will be short and I can send it to  /tmp/ folder



Re: playing with smart card reader using console commands #2 Erik Slagter

  • PLi® Core member
  • 46,960 posts

+541
Excellent

Posted 22 July 2013 - 12:58

The baudrate you can probably set using this syntax:

 

stty 19200 < /dev/sci1

stty -a < /dev/ttysci1


* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: playing with smart card reader using console commands #3 zember

  • Member
  • 17 posts

0
Neutral

Posted 22 July 2013 - 13:04

unfortunatly not working

 

root@vuduo:~# stty 19200 < /dev/sci1
stty: standard input: Invalid argument
root@vuduo:~# stty -a < /dev/ttysci1
-sh: can't open /dev/ttysci1: no such file
root@vuduo:~# stty -a < /dev/sci1
stty: standard input: Invalid argument
root@vuduo:~#
 



Re: playing with smart card reader using console commands #4 zember

  • Member
  • 17 posts

0
Neutral

Posted 22 July 2013 - 13:22

I'm sorry for writing under my post, but I can't not edit my last post.

root@vuduo:~# tty /dev/sci1
/dev/pts/0
root@vuduo:~# stty 9600 < /dev/pts/0
root@vuduo:~# stty -a < /dev/pts/0
speed 9600 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab3 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
root@vuduo:~#
 

If this is correct answer, what is the next step?



Re: playing with smart card reader using console commands #5 Erik Slagter

  • PLi® Core member
  • 46,960 posts

+541
Excellent

Posted 22 July 2013 - 13:40

Now you're adjusting your current pseudo terminal, that won't work.

 

Also, apparently the sci interface doesn't support the stty interface, so it's probably done using ioctl's. You may want to have a look at the source of oscam.


Edited by Erik Slagter, 22 July 2013 - 13:40.

* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: playing with smart card reader using console commands #6 zember

  • Member
  • 17 posts

0
Neutral

Posted 22 July 2013 - 13:54

It is very hard to read oscam sources I'm not good in C,

what do you think about this? :

 

here is few sci driver commands: http://dev.duckbox.i...c656a21ea775236

 

I'm trying to call them using python:

root@vuduo:/usr/lib# python2.7
Python 2.7.2 (default, Aug 31 2012, 05:24:11)
[GCC 4.6.4 20120303 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> import fcntl
>>> devicehandle = open('/dev/sci1', 'rw')
>>> fcntl.ioctl(devicehandle, IOCTL_SET_RESET, buff)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'IOCTL_SET_RESET' is not defined
 





Also tagged with one or more of these keywords: sci, smartcard

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users