* Connect with various serial devices
@ 2003-12-10 20:33 Albert Cervera Areny
2003-12-11 1:38 ` whitnl73
0 siblings, 1 reply; 11+ messages in thread
From: Albert Cervera Areny @ 2003-12-10 20:33 UTC (permalink / raw)
To: linux-serial
Hi,
I need to use various external devices which include (just in case
somebody has been able to do it already) an omron Card reader (V2X) and a
note dispenser.
The thing is that I've been able to use the note dispenser with the
following code:
fd = open( tty.ascii(), O_RDWR|O_NOCTTY);
bzero( &t, sizeof(t) );
t.c_cflag = B4800 | CS7 | CLOCAL | CREAD | PARENB;
t.c_iflag = IGNPAR | ICRNL;
t.c_oflag = 0;
t.c_lflag = ICANON;
tcflush(fd, TCIFLUSH);
tcsetattr(fd,TCSANOW,&t);
But when I try to connect with the Omron Card Reader (and other devices) I
cant contact them. I've configured CS, parity and speed as they should,
but there seems to be some other reason for these no to work.
The thing is that, those periferals work ok with a program in Windows2000
with Visual C++ where the code to initialize looks something like this for
one periferal:
hCom = CreateFile((char *)sCom,GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, 0, (long) 0);
if(hCom == INVALID_HANDLE_VALUE) {
dwError = GetLastError();
printf(bufrec,"Error:%d\n", dwError);
Close();
}
fSuccess = GetCommState(hCom, &dcbPort);
if(!fSuccess) {
Close();
}
dcbPort.BaudRate = 9600;
dcbPort.ByteSize = 8;
dcbPort.Parity = NOPARITY;
dcbPort.StopBits = TWOSTOPBITS;
fSuccess = SetCommState(hCom, &dcbPort);
if(!fSuccess) {
Close();
}
The same periferal I try to inicialize it with Linux with:
bzero( &t, sizeof(t) );
t.c_cflag = B9600 | CS8 | CLOCAL | CREAD | CSTOPB;
t.c_iflag = IGNPAR | IGNBRK;
t.c_oflag = 0;
t.c_lflag = ICANON;
tcflush( fd, TCIFLUSH );
tcsetattr( fd, TCSANOW, &t );
Can somebody see a reason why this shouldn't work for Linux or why it is
different from the windows code? The device seems to receive something as
a led shows it but doesn't do what it should, so it seems as the data
received must be garbage. If the device receives a command it doesn't
understand should send a NACK.
I send information using (no error returned):
write( fd, s.ascii(), s.length() )
And receive with (it waits forever):
read( fd, c, 1 )
Sorry for this long e-mail, but I'm really desperate. Hope somebody can help!
Thanks in advance!
Albert
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Connect with various serial devices
2003-12-10 20:33 Connect with various serial devices Albert Cervera Areny
@ 2003-12-11 1:38 ` whitnl73
2003-12-11 8:14 ` Albert Cervera Areny
0 siblings, 1 reply; 11+ messages in thread
From: whitnl73 @ 2003-12-11 1:38 UTC (permalink / raw)
To: informatic; +Cc: linux-serial
On Wed, 10 Dec 2003, Albert Cervera Areny wrote:
> Hi,
> I need to use various external devices which include (just in case
> somebody has been able to do it already) an omron Card reader (V2X) and a
> note dispenser.
> The thing is that I've been able to use the note dispenser with the
> following code:
>
> fd = open( tty.ascii(), O_RDWR|O_NOCTTY);
> bzero( &t, sizeof(t) );
> t.c_cflag = B4800 | CS7 | CLOCAL | CREAD | PARENB;
> t.c_iflag = IGNPAR | ICRNL;
> t.c_oflag = 0;
> t.c_lflag = ICANON;
> tcflush(fd, TCIFLUSH);
> tcsetattr(fd,TCSANOW,&t);
>
> But when I try to connect with the Omron Card Reader (and other devices) I
> cant contact them. I've configured CS, parity and speed as they should,
> but there seems to be some other reason for these no to work.
> The thing is that, those periferals work ok with a program in Windows2000
> with Visual C++ where the code to initialize looks something like this for
> one periferal:
>
> hCom = CreateFile((char *)sCom,GENERIC_READ | GENERIC_WRITE, 0, NULL,
> OPEN_EXISTING, 0, (long) 0);
>
> if(hCom == INVALID_HANDLE_VALUE) {
> dwError = GetLastError();
> printf(bufrec,"Error:%d\n", dwError);
> Close();
> }
>
> fSuccess = GetCommState(hCom, &dcbPort);
> if(!fSuccess) {
> Close();
> }
> dcbPort.BaudRate = 9600;
> dcbPort.ByteSize = 8;
> dcbPort.Parity = NOPARITY;
> dcbPort.StopBits = TWOSTOPBITS;
> fSuccess = SetCommState(hCom, &dcbPort);
> if(!fSuccess) {
> Close();
> }
>
> The same periferal I try to inicialize it with Linux with:
>
> bzero( &t, sizeof(t) );
> t.c_cflag = B9600 | CS8 | CLOCAL | CREAD | CSTOPB;
> t.c_iflag = IGNPAR | IGNBRK;
> t.c_oflag = 0;
> t.c_lflag = ICANON;
> tcflush( fd, TCIFLUSH );
> tcsetattr( fd, TCSANOW, &t );
>
> Can somebody see a reason why this shouldn't work for Linux or why it is
> different from the windows code? The device seems to receive something as
> a led shows it but doesn't do what it should, so it seems as the data
> received must be garbage. If the device receives a command it doesn't
> understand should send a NACK.
>
> I send information using (no error returned):
> write( fd, s.ascii(), s.length() )
>
> And receive with (it waits forever):
> read( fd, c, 1 )
>
> Sorry for this long e-mail, but I'm really desperate. Hope somebody can help!
>
> Thanks in advance!
>
> Albert
> -
Seems I remember a case on linux-serial or -newbie recently where read
would hang waiting for DCD to come up even though CLOCAL was set. He
solved it by strapping his carrier-detect line, but I think O_NONBLOCK
or O_NDELEAY in the fd will also work (just feed it to open(), FI).
What, BTW are s.ascii() and s.length() ?
Lawson
--
---oops---
________________________________________________________________
The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Connect with various serial devices
2003-12-11 1:38 ` whitnl73
@ 2003-12-11 8:14 ` Albert Cervera Areny
2003-12-11 9:33 ` Michael Westermann
0 siblings, 1 reply; 11+ messages in thread
From: Albert Cervera Areny @ 2003-12-11 8:14 UTC (permalink / raw)
To: whitnl73; +Cc: linux-serial
Thanks for your suggestion, but it doesn't work either. If I set
O_NONBLOCK it doesn't block in the read statement but it never receives
anything. The problem must be that data isn't sent correctly either as the
device would do something if it received it correctly (though I might not
receive a response).
Any other ideas?
Thanks again.
Albert
> On Wed, 10 Dec 2003, Albert Cervera Areny wrote:
>
>> Hi,
>> I need to use various external devices which include (just in case
>> somebody has been able to do it already) an omron Card reader (V2X) and
>> a
>> note dispenser.
>> The thing is that I've been able to use the note dispenser with the
>> following code:
>>
>> fd = open( tty.ascii(), O_RDWR|O_NOCTTY);
>> bzero( &t, sizeof(t) );
>> t.c_cflag = B4800 | CS7 | CLOCAL | CREAD | PARENB;
>> t.c_iflag = IGNPAR | ICRNL;
>> t.c_oflag = 0;
>> t.c_lflag = ICANON;
>> tcflush(fd, TCIFLUSH);
>> tcsetattr(fd,TCSANOW,&t);
>>
>> But when I try to connect with the Omron Card Reader (and other devices)
>> I
>> cant contact them. I've configured CS, parity and speed as they should,
>> but there seems to be some other reason for these no to work.
>> The thing is that, those periferals work ok with a program in
>> Windows2000
>> with Visual C++ where the code to initialize looks something like this
>> for
>> one periferal:
>>
>> hCom = CreateFile((char *)sCom,GENERIC_READ | GENERIC_WRITE, 0, NULL,
>> OPEN_EXISTING, 0, (long) 0);
>>
>> if(hCom == INVALID_HANDLE_VALUE) {
>> dwError = GetLastError();
>> printf(bufrec,"Error:%d\n", dwError);
>> Close();
>> }
>>
>> fSuccess = GetCommState(hCom, &dcbPort);
>> if(!fSuccess) {
>> Close();
>> }
>> dcbPort.BaudRate = 9600;
>> dcbPort.ByteSize = 8;
>> dcbPort.Parity = NOPARITY;
>> dcbPort.StopBits = TWOSTOPBITS;
>> fSuccess = SetCommState(hCom, &dcbPort);
>> if(!fSuccess) {
>> Close();
>> }
>>
>> The same periferal I try to inicialize it with Linux with:
>>
>> bzero( &t, sizeof(t) );
>> t.c_cflag = B9600 | CS8 | CLOCAL | CREAD | CSTOPB;
>> t.c_iflag = IGNPAR | IGNBRK;
>> t.c_oflag = 0;
>> t.c_lflag = ICANON;
>> tcflush( fd, TCIFLUSH );
>> tcsetattr( fd, TCSANOW, &t );
>>
>> Can somebody see a reason why this shouldn't work for Linux or why it is
>> different from the windows code? The device seems to receive something
>> as
>> a led shows it but doesn't do what it should, so it seems as the data
>> received must be garbage. If the device receives a command it doesn't
>> understand should send a NACK.
>>
>> I send information using (no error returned):
>> write( fd, s.ascii(), s.length() )
>>
>> And receive with (it waits forever):
>> read( fd, c, 1 )
>>
>> Sorry for this long e-mail, but I'm really desperate. Hope somebody can
>> help!
>>
>> Thanks in advance!
>>
>> Albert
>> -
> Seems I remember a case on linux-serial or -newbie recently where read
> would hang waiting for DCD to come up even though CLOCAL was set. He
> solved it by strapping his carrier-detect line, but I think O_NONBLOCK
> or O_NDELEAY in the fd will also work (just feed it to open(), FI).
>
> What, BTW are s.ascii() and s.length() ?
>
> Lawson
> --
> ---oops---
>
>
>
> ________________________________________________________________
> The best thing to hit the internet in years - Juno SpeedBand!
> Surf the web up to FIVE TIMES FASTER!
> Only $14.95/ month - visit www.juno.com to sign up today!
>
>
Albert Cervera Areny
Dept. Informàtica Sedifa, S.L.
Av. Can Bordoll, 149
08202 - Sabadell (Barcelona)
Tel. 93 715 51 11
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Connect with various serial devices
2003-12-11 8:14 ` Albert Cervera Areny
@ 2003-12-11 9:33 ` Michael Westermann
2003-12-11 12:12 ` Albert Cervera Areny
0 siblings, 1 reply; 11+ messages in thread
From: Michael Westermann @ 2003-12-11 9:33 UTC (permalink / raw)
To: linux-serial
Hello,
On Thu, Dec 11, 2003 at 09:14:35AM +0100, Albert Cervera Areny wrote:
> Thanks for your suggestion, but it doesn't work either. If I set
> O_NONBLOCK it doesn't block in the read statement but it never receives
> anything. The problem must be that data isn't sent correctly either as the
> device would do something if it received it correctly (though I might not
> receive a response).
I think you you will read raw from the device, please set
t.c_iflag = 0;
t.c_oflag = 0;
t.c_cflag = B4800 | CS7 | CLOCAL | CREAD | PARENB;
t.c_cc[VMIN] = count;
t.c_cc[VTIME] = time;
t.c_cc[VSTOP] = 0;
t.c_cc[VSTART] = 0;
t.c_lflag = 0;
t.c_oflag = 0;
VMIN and VTIM are most probably described in a serial HOWTO
> Any other ideas?
Particulary, I think ICANON is wrong in this context.
Use select(2) ;-)
Michael
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Connect with various serial devices
2003-12-11 9:33 ` Michael Westermann
@ 2003-12-11 12:12 ` Albert Cervera Areny
2003-12-11 12:29 ` Michael Westermann
0 siblings, 1 reply; 11+ messages in thread
From: Albert Cervera Areny @ 2003-12-11 12:12 UTC (permalink / raw)
To: Michael Westermann; +Cc: linux-serial
Hi!
Thanks for your suggestion, in fact now we can receive data from the note
dispenser and see the 'Ok' response. We keep on beeing unable to use the
other devices though. It seems that for some strange (to us) reason,
devices are not receiving data correctly (as they would do the appropiate
thing even if we didn't receive any response). Do you have any ideas on
why the sent data shouldn't be received correctly by the device? I've
looked at the speed, parity, CS and Bstop parameters but they are right.
Could there be any other reason for that strange behaviour in some of the
devices?
> Hello,
>
> On Thu, Dec 11, 2003 at 09:14:35AM +0100, Albert Cervera Areny wrote:
>
>
>> Thanks for your suggestion, but it doesn't work either. If I set
>> O_NONBLOCK it doesn't block in the read statement but it never receives
>> anything. The problem must be that data isn't sent correctly either as
>> the
>> device would do something if it received it correctly (though I might
>> not
>> receive a response).
> I think you you will read raw from the device, please set
>
> t.c_iflag = 0;
> t.c_oflag = 0;
> t.c_cflag = B4800 | CS7 | CLOCAL | CREAD | PARENB;
> t.c_cc[VMIN] = count;
> t.c_cc[VTIME] = time;
> t.c_cc[VSTOP] = 0;
> t.c_cc[VSTART] = 0;
> t.c_lflag = 0;
> t.c_oflag = 0;
>
> VMIN and VTIM are most probably described in a serial HOWTO
>
>> Any other ideas?
>
> Particulary, I think ICANON is wrong in this context.
> Use select(2) ;-)
>
> Michael
> -
> To unsubscribe from this list: send the line "unsubscribe linux-serial" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
Albert Cervera Areny
Dept. Informàtica Sedifa, S.L.
Av. Can Bordoll, 149
08202 - Sabadell (Barcelona)
Tel. 93 715 51 11
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Connect with various serial devices
2003-12-11 12:12 ` Albert Cervera Areny
@ 2003-12-11 12:29 ` Michael Westermann
2003-12-11 13:08 ` Albert Cervera Areny
0 siblings, 1 reply; 11+ messages in thread
From: Michael Westermann @ 2003-12-11 12:29 UTC (permalink / raw)
To: linux-serial
Hello,
On Thu, Dec 11, 2003 at 01:12:54PM +0100, Albert Cervera Areny wrote:
> Thanks for your suggestion, in fact now we can receive data from the note
> dispenser and see the 'Ok' response. We keep on beeing unable to use the
> other devices though. It seems that for some strange (to us) reason,
> devices are not receiving data correctly (as they would do the appropiate
> thing even if we didn't receive any response). Do you have any ideas on
> why the sent data shouldn't be received correctly by the device? I've
> looked at the speed, parity, CS and Bstop parameters but they are right.
> Could there be any other reason for that strange behaviour in some of the
> devices?
I think the Card-Reader need 9600/8bit/None Parity and CRTSCTS
t.c_cflag = baud|parity|bits|stop ;
t.c_cflag |= CRTSCTS;
Use tcdrain with caution, tcdrain blocks forever without a device !
better use in a timed loop;
ioctl(fd, TIOCOUTQ, &bytes) bytes = bytes in outqueue
Michael
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Connect with various serial devices
2003-12-11 12:29 ` Michael Westermann
@ 2003-12-11 13:08 ` Albert Cervera Areny
2003-12-11 13:27 ` Michael Westermann
2003-12-11 14:47 ` Gerald Emig
0 siblings, 2 replies; 11+ messages in thread
From: Albert Cervera Areny @ 2003-12-11 13:08 UTC (permalink / raw)
To: Michael Westermann; +Cc: linux-serial
> Hello,
> On Thu, Dec 11, 2003 at 01:12:54PM +0100, Albert Cervera Areny wrote:
>> Thanks for your suggestion, in fact now we can receive data from the
>> note
>> dispenser and see the 'Ok' response. We keep on beeing unable to use the
>> other devices though. It seems that for some strange (to us) reason,
>> devices are not receiving data correctly (as they would do the
>> appropiate
>> thing even if we didn't receive any response). Do you have any ideas on
>> why the sent data shouldn't be received correctly by the device? I've
>> looked at the speed, parity, CS and Bstop parameters but they are right.
>> Could there be any other reason for that strange behaviour in some of
>> the
>> devices?
> I think the Card-Reader need 9600/8bit/None Parity and CRTSCTS
According to the Card-Reader documentation, the parameters are: 8 bit, 1
bit stop, even parity ant the speed is automaticalli recognized, and I've
tried 9600 (and others too). Trying with the CRTSCTS doesn't work either.
Many thanks for your help.
PS: ioctl(TIOCOUTQ) returns 0 in bytes; So it seems everything is sent,
isn't it?
>
> t.c_cflag = baud|parity|bits|stop ;
> t.c_cflag |= CRTSCTS;
>
> Use tcdrain with caution, tcdrain blocks forever without a device !
> better use in a timed loop;
>
> ioctl(fd, TIOCOUTQ, &bytes) bytes = bytes in outqueue
>
> Michael
> -
> To unsubscribe from this list: send the line "unsubscribe linux-serial" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
Albert Cervera Areny
Dept. Informàtica Sedifa, S.L.
Av. Can Bordoll, 149
08202 - Sabadell (Barcelona)
Tel. 93 715 51 11
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Connect with various serial devices
2003-12-11 13:08 ` Albert Cervera Areny
@ 2003-12-11 13:27 ` Michael Westermann
2003-12-15 19:00 ` Albert Cervera Areny
2003-12-11 14:47 ` Gerald Emig
1 sibling, 1 reply; 11+ messages in thread
From: Michael Westermann @ 2003-12-11 13:27 UTC (permalink / raw)
To: linux-serial
On Thu, Dec 11, 2003 at 02:08:44PM +0100, Albert Cervera Areny wrote:
>
> > Hello,
> > On Thu, Dec 11, 2003 at 01:12:54PM +0100, Albert Cervera Areny wrote:
> >> Thanks for your suggestion, in fact now we can receive data from the
> >> note
> >> dispenser and see the 'Ok' response. We keep on beeing unable to use the
> >> other devices though. It seems that for some strange (to us) reason,
> >> devices are not receiving data correctly (as they would do the
> >> appropiate
> >> thing even if we didn't receive any response). Do you have any ideas on
> >> why the sent data shouldn't be received correctly by the device? I've
> >> looked at the speed, parity, CS and Bstop parameters but they are right.
> >> Could there be any other reason for that strange behaviour in some of
> >> the
> >> devices?
> > I think the Card-Reader need 9600/8bit/None Parity and CRTSCTS
>
> According to the Card-Reader documentation, the parameters are: 8 bit, 1
> bit stop, even parity ant the speed is automaticalli recognized, and I've
> tried 9600 (and others too). Trying with the CRTSCTS doesn't work either.
Test with strace ?
or i
stty -F /dev/ttyS0 raw clocal ispeed 9600 parenb -parodd -echo [crtscts]
check with
stty -a -F /dev/ttyS0
cat /dev/ttyS0 > /tmp/xxxx&
printf "aa\x0d" > /dev/ttyS0 (example)
test with
ls -l /tmp/xxxx
hexdump /tmp/xxxx
check the interrpts with
cat /proc/interrupts (/proc/stat)
>
> PS: ioctl(TIOCOUTQ) returns 0 in bytes; So it seems everything is sent,
> isn't it?
the queue is empty, it's all transmitted.
Michael
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Connect with various serial devices
2003-12-11 13:08 ` Albert Cervera Areny
2003-12-11 13:27 ` Michael Westermann
@ 2003-12-11 14:47 ` Gerald Emig
1 sibling, 0 replies; 11+ messages in thread
From: Gerald Emig @ 2003-12-11 14:47 UTC (permalink / raw)
To: linux-serial; +Cc: Albert Cervera Areny
Hi Albert,
Perhaps you should check your cabling first (or once again). Is it wired
according to the card reader's docu ? Is it short enough ? Are you even
working in industial environment ?
Automatic baudrate detection is rather fool. It can easily hang if
you send the wrong character in the phase of "detection".
BTW: many modems use this detection, but they are always looking for 'A'
or 'a'...
You should try to find out what the reader's default baudrate is, or
which character it expects first.
Also try whether the Win-Software that came with the reader works.
Best regards,
Gerald Emig
On Thu, 11 Dec 2003 14:08:44 +0100 (CET)
"Albert Cervera Areny" <informatic@sedifa.com> wrote:
>
> > Hello,
> > On Thu, Dec 11, 2003 at 01:12:54PM +0100, Albert Cervera Areny
> > wrote:
> >> Thanks for your suggestion, in fact now we can receive data from
> >the> note
> >> dispenser and see the 'Ok' response. We keep on beeing unable to
> >use the> other devices though. It seems that for some strange (to us)
> >reason,> devices are not receiving data correctly (as they would do
> >the> appropiate
> >> thing even if we didn't receive any response). Do you have any
> >ideas on> why the sent data shouldn't be received correctly by the
> >device? I've> looked at the speed, parity, CS and Bstop parameters
> >but they are right.> Could there be any other reason for that strange
> >behaviour in some of> the
> >> devices?
> > I think the Card-Reader need 9600/8bit/None Parity and CRTSCTS
>
> According to the Card-Reader documentation, the parameters are: 8 bit,
> 1 bit stop, even parity ant the speed is automaticalli recognized, and
> I've tried 9600 (and others too). Trying with the CRTSCTS doesn't work
> either.
>
> Many thanks for your help.
>
> PS: ioctl(TIOCOUTQ) returns 0 in bytes; So it seems everything is
> sent, isn't it?
>
> >
> > t.c_cflag = baud|parity|bits|stop ;
> > t.c_cflag |= CRTSCTS;
> >
> > Use tcdrain with caution, tcdrain blocks forever without a device !
> > better use in a timed loop;
> >
> > ioctl(fd, TIOCOUTQ, &bytes) bytes = bytes in outqueue
> >
> > Michael
> > -
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-serial" in the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
> >
>
>
> Albert Cervera Areny
> Dept. Informàtica Sedifa, S.L.
>
> Av. Can Bordoll, 149
> 08202 - Sabadell (Barcelona)
> Tel. 93 715 51 11
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-serial" in the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Gerald Emig
--
EMIG Software, Engelstr. 17, D-66564 Ottweiler, Germany
Tel.+49(0)6858-699567, Fax.699568, gme@emig-software.de
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Connect with various serial devices
2003-12-11 13:27 ` Michael Westermann
@ 2003-12-15 19:00 ` Albert Cervera Areny
2003-12-16 7:23 ` Michael Westermann
0 siblings, 1 reply; 11+ messages in thread
From: Albert Cervera Areny @ 2003-12-15 19:00 UTC (permalink / raw)
To: Michael Westermann; +Cc: linux-serial
Well, finally thanks to your suggestions we were able to make the most
important device work. Thanks!
However, we're now trying to make work an Omron V2XF card reader/writer
but we're stuck again. Maybe somebody in the list has been able to make
work one of these. Does somebody have any piece of work (or help) we can
try with it?
The device is supposed to autodetect connection speed, but it doesn't
return a sigle byte :(
Well, thanks in advance again! ;)
> On Thu, Dec 11, 2003 at 02:08:44PM +0100, Albert Cervera Areny wrote:
>>
>> > Hello,
>> > On Thu, Dec 11, 2003 at 01:12:54PM +0100, Albert Cervera Areny wrote:
>> >> Thanks for your suggestion, in fact now we can receive data from the
>> >> note
>> >> dispenser and see the 'Ok' response. We keep on beeing unable to use
>> the
>> >> other devices though. It seems that for some strange (to us) reason,
>> >> devices are not receiving data correctly (as they would do the
>> >> appropiate
>> >> thing even if we didn't receive any response). Do you have any ideas
>> on
>> >> why the sent data shouldn't be received correctly by the device? I've
>> >> looked at the speed, parity, CS and Bstop parameters but they are
>> right.
>> >> Could there be any other reason for that strange behaviour in some of
>> >> the
>> >> devices?
>> > I think the Card-Reader need 9600/8bit/None Parity and CRTSCTS
>>
>> According to the Card-Reader documentation, the parameters are: 8 bit, 1
>> bit stop, even parity ant the speed is automaticalli recognized, and
>> I've
>> tried 9600 (and others too). Trying with the CRTSCTS doesn't work
>> either.
>
> Test with strace ?
> or i
>
> stty -F /dev/ttyS0 raw clocal ispeed 9600 parenb -parodd -echo [crtscts]
>
> check with
>
> stty -a -F /dev/ttyS0
>
> cat /dev/ttyS0 > /tmp/xxxx&
> printf "aa\x0d" > /dev/ttyS0 (example)
>
> test with
>
> ls -l /tmp/xxxx
> hexdump /tmp/xxxx
>
> check the interrpts with
> cat /proc/interrupts (/proc/stat)
>
>
>>
>> PS: ioctl(TIOCOUTQ) returns 0 in bytes; So it seems everything is sent,
>> isn't it?
> the queue is empty, it's all transmitted.
>
> Michael
> -
> To unsubscribe from this list: send the line "unsubscribe linux-serial" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
Albert Cervera Areny
Dept. Informàtica Sedifa, S.L.
Av. Can Bordoll, 149
08202 - Sabadell (Barcelona)
Tel. 93 715 51 11
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Connect with various serial devices
2003-12-15 19:00 ` Albert Cervera Areny
@ 2003-12-16 7:23 ` Michael Westermann
0 siblings, 0 replies; 11+ messages in thread
From: Michael Westermann @ 2003-12-16 7:23 UTC (permalink / raw)
To: linux-serial
Hello,
On Mon, Dec 15, 2003 at 08:00:53PM +0100, Albert Cervera Areny wrote:
> Well, finally thanks to your suggestions we were able to make the most
> important device work. Thanks!
>
> However, we're now trying to make work an Omron V2XF card reader/writer
> but we're stuck again. Maybe somebody in the list has been able to make
> work one of these. Does somebody have any piece of work (or help) we can
> try with it?
>
> The device is supposed to autodetect connection speed, but it doesn't
> return a sigle byte :(
>
> Well, thanks in advance again! ;)
Can i get the doku ?
I've get a short descrition from the omron home-page. The cardreader
has cts but not rts. Please test without CRTSCTS and set RTS manually
with ioctrl.
void set_rts(fd, int para) {
unsigned int c = TIOCM_RTS;
if (fd >= 0)
ioctl(fd, (para) ? TIOCMBIS : TIOCMBIC, &c);
}
Assemble you a cash dispenser, or a pount of sale ?
Happy Testing,
Michael
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2003-12-16 7:23 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-10 20:33 Connect with various serial devices Albert Cervera Areny
2003-12-11 1:38 ` whitnl73
2003-12-11 8:14 ` Albert Cervera Areny
2003-12-11 9:33 ` Michael Westermann
2003-12-11 12:12 ` Albert Cervera Areny
2003-12-11 12:29 ` Michael Westermann
2003-12-11 13:08 ` Albert Cervera Areny
2003-12-11 13:27 ` Michael Westermann
2003-12-15 19:00 ` Albert Cervera Areny
2003-12-16 7:23 ` Michael Westermann
2003-12-11 14:47 ` Gerald Emig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).