Opened 11 years ago

Closed 11 years ago

#37 closed defect (fixed)

SKY ITALIA CAID 093B + 0919 : system non supported (command len problem)

Reported by: boubaris Owned by: dingo35
Priority: major Component:
Severity: medium Keywords:
Cc: Sensitive: no

Description

My system is described here: http://www.streamboard.tv:8001/oscam/ticket/36

Putting NDS card caid 0919 into Phoenix serial reader, I've the following log:

2009/10/23 6:59:36 10570 s reader started (pid=10574, device=/dev/ttyS0, detect=none, mhz=357)
2009/10/23 6:59:36 10570 s anti cascading disabled
2009/10/23 6:59:38 10574 r02 card detected
2009/10/23 6:59:42 10574 r02 ATR: 3F FF 13 25 03 10 80 33 B0 0E 69 FF 4A 50 70 00 00 49 54 02 00 00
2009/10/23 6:59:43 10574 r02 Type: Videoguard Sky Italia
2009/10/23 6:59:43 10574 r02 /dev/ttyS0: custom: baud_base=115200 baud=64516 divisor=2 -> effective baudrate 57600 (-0.11% off)
2009/10/23 6:59:44 10574 r02 failed to read 7401 cmd length (ff 13)
2009/10/23 6:59:44 10574 r02 card system not supported
2009/10/23 6:59:44 10574 r02 card initializing error
2009/10/23 6:59:49 10570 s cardserver down

viewing reader-videoguard2.c I see:

static int read_cmd_len(const unsigned char *cmd) { 
  unsigned char cmd2[5];
  memcpy(cmd2,cmd,5); 
  cmd2[3]=0x80;
  cmd2[4]=1;
  if(!read_cmd(cmd2,NULL) || cta_res[1] != 0x90 || cta_res[2] != 0x00) { 
    cs_log("failed to read %02x%02x cmd length (%02x %02x)",cmd[1],cmd[2],cta_res[1],cta_res[2]); 
    return -1; 
  }
 return cta_res[0]; 
}

cmd len MUST be 0x90 0x00 but card return 0xff 0x13

Sorry but I don't know why ...

Change History (11)

in reply to:  description comment:1 by knzsys, 11 years ago

I got same Error with my NDS card caid 093B into Phoenix serial reader:

-------------------------------------------------------------------------------
>> OSCam <<  cardserver started at Sat Oct 24 17:56:44 2009
-------------------------------------------------------------------------------
2009/10/24 17:56:44   1409 s   version=0.99.4svn, system=powerpc-dreambox-linux, nice=-1
.
.
.
2009/10/24 17:56:44   1409 s   reader started (pid=1413, device=/dev/tts/0, detect=cd, mhz=600)
2009/10/24 17:56:44   1409 s   Waiting for local card init ....
2009/10/24 17:56:47   1413 r02 card detected
2009/10/24 17:56:50   1413 r02 ATR: 3F FD 13 25 02 50 80 0F 33 B0 13 69 FF 4A 50 D0 80 00 49 54 03
2009/10/24 17:56:51   1413 r02 Type: Videoguard Sky Italia new (093B)
2009/10/24 17:56:53   1413 r02 failed to read 7401 cmd length (fd 13)
2009/10/24 17:56:53   1413 r02 card system not supported
2009/10/24 17:56:53   1413 r02 card initializing error
2009/10/24 17:56:53   1409 s   Init for all local cards done !
2009/10/24 17:56:53   1409 s   anti cascading disabled

Replying to boubaris:

My system is described here: http://www.streamboard.tv:8001/oscam/ticket/36

Putting NDS card caid 0919 into Phoenix serial reader, I've the following log:

2009/10/23 6:59:36 10570 s reader started (pid=10574, device=/dev/ttyS0, detect=none, mhz=357)
2009/10/23 6:59:36 10570 s anti cascading disabled
2009/10/23 6:59:38 10574 r02 card detected
2009/10/23 6:59:42 10574 r02 ATR: 3F FF 13 25 03 10 80 33 B0 0E 69 FF 4A 50 70 00 00 49 54 02 00 00
2009/10/23 6:59:43 10574 r02 Type: Videoguard Sky Italia
2009/10/23 6:59:43 10574 r02 /dev/ttyS0: custom: baud_base=115200 baud=64516 divisor=2 -> effective baudrate 57600 (-0.11% off)
2009/10/23 6:59:44 10574 r02 failed to read 7401 cmd length (ff 13)
2009/10/23 6:59:44 10574 r02 card system not supported
2009/10/23 6:59:44 10574 r02 card initializing error
2009/10/23 6:59:49 10570 s cardserver down

viewing reader-videoguard2.c I see:

static int read_cmd_len(const unsigned char *cmd) { 
  unsigned char cmd2[5];
  memcpy(cmd2,cmd,5); 
  cmd2[3]=0x80;
  cmd2[4]=1;
  if(!read_cmd(cmd2,NULL) || cta_res[1] != 0x90 || cta_res[2] != 0x00) { 
    cs_log("failed to read %02x%02x cmd length (%02x %02x)",cmd[1],cmd[2],cta_res[1],cta_res[2]); 
    return -1; 
  }
 return cta_res[0]; 
}

cmd len MUST be 0x90 0x00 but card return 0xff 0x13

Sorry but I don't know why ...

comment:2 by knzsys, 11 years ago

Summary: SKY ITALIA CAID 0919 : system non supported (command len problem)SKY ITALIA CAID 093B : system non supported (command len problem)

comment:3 by knzsys, 11 years ago

Summary: SKY ITALIA CAID 093B : system non supported (command len problem)SKY ITALIA CAID 093B + 0919 : system non supported (command len problem)

comment:4 by charlie.3ppes, 11 years ago

Hello! For me the problem is the baud rate. In NDS the initial baud rate is 9600. After reset and ATR exchange, baud rate must be changed in 38400.
As the log shows, there is no communication between CARD and READER after ATR. "FD 13" is simply the repetition of 2nd en 3rd bytes of ATR "3F FD 13" ...

In "reader-videoguard2.c" at line 497 there is the code to change baud rate, but only for LINUX and NOT TUXBOX. I have a Linux Tuxbox PPC and I try to find in the APIs how to change baud rate for /dev/sci0 interface... but I'm not so good. :-)

Thanks a lot!
Good working

comment:5 by charlie.3ppes, 11 years ago

Hello! I've read some posts about /dev/sci0 ... there is no baud rate, sorry. It's all do by hardware. So this is the problem, after compiling OSCAM with debug enabled:

IO: Opening serial port /dev/sci0
IFD: Initialicing slot number 0, com=2
CTAPI: CT_init(ctn=1, pn=1)=0
CTAPI: CT_data(ctn=1, *dad=0x01, *sad=0x02, lc=5, *cmd={20 13 01 80 00 }, *lr=259, rsp=[])
IFD: com2 Status = card / change
CTAPI: CT_data(ctn=1, *dad=0x01, *sad=0x01, lc=5, *cmd={}, *lr=3, rsp={05 90 00 })=0
CTAPI: CT_data(ctn=1, *dad=0x01, *sad=0x02, lc=3, *cmd={11 01 00 }, *lr=259, rsp=[])
CTAPI: CT_data(ctn=1, *dad=0x01, *sad=0x01, lc=3, *cmd={}, *lr=2, rsp={6E 00 })=0
CTAPI: CT_data(ctn=1, *dad=0x01, *sad=0x02, lc=5, *cmd={20 13 00 80 00 }, *lr=259, rsp=[])
IFD: com2 Status = card / no change
CTAPI: CT_data(ctn=1, *dad=0x01, *sad=0x01, lc=5, *cmd={}, *lr=3, rsp={05 90 00 })=0
CTAPI: CT_data(ctn=1, *dad=0x01, *sad=0x02, lc=5, *cmd={20 12 01 01 00 }, *lr=259, rsp=[])
IFD: com2 Status = card / no change
IFD: Activating card

1970/01/01 2:11:21 205 r02 card detected

IFD: Resetting card:
ICC: Detected inverse convention processor card T=0
PPS: Protocol T=0 selected
PPS: T=0, F=372, D=4.000000, N=2
Protocol: T=0: WWT=892
CTAPI: CT_data(ctn=1, *dad=0x01, *sad=0x01, lc=5, *cmd={}, *lr=23, rsp={3F FD 13 25 02 50 80 0F 33 B0 13 69 FF 4A 50 D0 80 00 49 54 03 90 01 })=0

1970/01/01 2:11:24 205 r02 ATR: 3F FD 13 25 02 50 80 0F 33 B0 13 69 FF 4A 50 D0 80 00 49 54 03
1970/01/01 2:11:25 205 r02 Type: Videoguard Sky Italia new (093B)

CTAPI: CT_data(ctn=1, *dad=0x00, *sad=0x02, lc=5, *cmd={D0 74 01 80 01 }, *lr=259, rsp=[])
Protocol: T=0 Case 3 short
IFD: Transmit: D0 74 1 80 1
IO: Sending: D0 74 1 80 1
IO: Receiving: TIMEOUT
CTAPI: CT_data(ctn=1, *dad=0x02, *sad=0x00, lc=5, *cmd={}, *lr=0, rsp={})=246

1970/01/01 2:11:26 205 r02 failed to read 7401 cmd length (fd 13)

Thanks again!

comment:6 by charlie.3ppes, 11 years ago

Resolution: fixed
Status: newclosed

Solved! In "ifd_towitoko.c" for this type of ATR { 3F FD 13 25 02 50 80 0F 33 B0 13 69 FF 4A 50 D0 80 00 49 54 03 90 01 } plase set SCI_PARAMETERS to:

T=0
f=9
ETU=93
WWT=0
CWT=0
BWT=0
EGT=2
clock=0
check=0
P=0
I=0
U=0

So the card is readed OK!
Good work!

comment:7 by charlie.3ppes, 11 years ago

Resolution: fixed
Status: closedreopened

As requested from many, please add fix to your SVN trunk.
Thanks again!

comment:8 by dingo35, 11 years ago

Owner: set to dingo35
Status: reopenednew

comment:9 by ilcalmo, 11 years ago

Changing line 500 in file reader-videoguard2.c to

int baud=38400;

solved me the problem reading the card with serial smartmouse reader on a linux box.

Could this affecting other operations?
Regards.

comment:10 by johjoh2k, 11 years ago

Same error with Smargo:

2009/11/11 4:01:04 7216 s reader started (pid=7220, device=/dev/ttyUSB0, detect=cd, mhz=600)
2009/11/11 4:01:04 7216 s Waiting for local card init ....
2009/11/11 4:01:07 7216 s Init for all local cards done !
2009/11/11 4:01:07 7216 s anti cascading disabled
2009/11/11 4:01:07 7216 s serial: initialized (pid=7221, auto@/dev/ttyS0)
2009/11/11 4:01:29 7220 r02 card detected
2009/11/11 4:01:48 7220 r02 ATR: 3F FD 13 25 02 50 80 0F 33 B0 13 69 FF 4A 50 D0 80 00 49 54 03
2009/11/11 4:01:49 7220 r02 Type: Videoguard Sky Italia new (093B)
2009/11/11 4:01:49 7220 r02 Notice: for Sky Italia 'customspeed = 1' will not work; resetting to 'customspeed = 0'
2009/11/11 4:01:49 7220 r02 Warning: for Sky Italia currently only 'mhz = 357' is known to work! Device /dev/ttyUSB0 has mhz = 600
2009/11/11 4:01:49 7220 r02 /dev/ttyUSB0: baud=38400
2009/11/11 4:01:53 7220 r02 failed to read 7401 cmd length (fd 13)
2009/11/11 4:01:53 7220 r02 card system not supported
2009/11/11 4:01:53 7220 r02 card initializing error

comment:11 by dingo35, 11 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.