Scanning barcodes on Linux

Issues related to using our fonts in Crystal Reports

Scanning barcodes on Linux

Postby vnaum(Legacy Member) on Fri Nov 21, 2003 2:00 am

If it isn't offtopic...
Does anybody have expirience on reading barcodes on Linux?

A little introduction.
Everything is pretty simple (on a first sight).
We have barcode scanner connected to serial port.
The device is accessible as file '/dev/ttyS0' or '/dev/ttyS1', so all that you need is open this pseudo-file and read data from it.
like this (perl source):
===8<===
open(SERIAL,"</dev/ttyS1") or die "can't open port\n";
while (<SERIAL>)
{
print "$_"
}
===8<===
but, of course, port does need some configuration before opening. 'stty' is a command to do this, and it has a lot of options. This seems to fit our needs:
'stty -F /dev/ttyS1 9600 -parenb -parodd clocal raw'
(set baud rate to 9600, disable all translations)

And now the problem.
Everything OK for ASCII data.
And everything OK with binary data.
Unless that binary data is spread across number of Macro PDF417 symbols.
Even in this case 90% barcodes are read OK, but remaining 10% make scanner stop responding.

It seems to me that stty settings aren't just all right, but I cannot figure out what I've missed...
vnaum(Legacy Member)
 

Re: Scanning barcodes on Linux

Postby vnaum(Legacy Member) on Mon Nov 24, 2003 3:16 am

Well, everything was pretty simple.
Port options were ok, the problem was in terminal settings.
(In Linux serial ports are terminal lines).
Turning echo off ("-echo") does the right things.
So, my final stty settings are:
stty -F /dev/ttyS0 9600 raw -parenb -parodd clocal -echo

(Just guess) It seems like one of "interrupt, quit, and suspend special characters" was echoed back to port when scanner was unready (between PDF segments).
vnaum(Legacy Member)
 

Re: Scanning barcodes on Linux

Postby kingmonty(Legacy Member) on Sat Jan 24, 2004 5:09 am

Hi,

I am interested in your perl/barcode solution, kind of confused as to how to implement it. Could you give some more information,



Thanks in Advance,

M
kingmonty(Legacy Member)
 

Re: Scanning barcodes on Linux

Postby vnaum(Legacy Member) on Sun Jan 25, 2004 11:12 pm

Well, it isn't too much of a solution :-)
It's mostly an example of how you can do this. But here you are:

http://www.lab321.ru/~nvy/barcode/download/autoscan.zip

Yes, you are free to use it as you want - it's GPL :-)
Of course, patches, additions and fixes are welcome.
vnaum(Legacy Member)
 

Re: Scanning barcodes on Linux

Postby kingmonty(Legacy Member) on Mon Jan 26, 2004 3:13 am

Hi Vnaum,

thank you very much :)

It works perfectly. I will send you an example of how we implemented it.

Ta,

M
kingmonty(Legacy Member)
 

Re: Scanning barcodes on Linux

Postby Guest on Fri Jun 25, 2004 6:55 am

Why do I read the following message while I am trying to access the URL -

http://lab321.ru/~nvy/barcode/download/autoscan.zip wrote:

Forbidden
You don't have permission to access /~nvy/barcode/download/autoscan.zip on this server.



--------------------------------------------------------------------------------

Apache/1.3.26 Server at www.lab321.ru Port 80


vnaum wrote:
Well, it isn't too much of a solution :-)
It's mostly an example of how you can do this. But here you are:

http://www.lab321.ru/~nvy/barcode/download/autoscan.zip

Yes, you are free to use it as you want - it's GPL :-)
Of course, patches, additions and fixes are welcome.


Is it still open to the public ?

Thanks
Guest
 

Re: Scanning barcodes on Linux

Postby vnaum(Legacy Member) on Fri Jun 25, 2004 7:40 am

Oops...
Server misconfiguration :-)
Try once again, if it fails - contact me vnaum@lab321.ru
vnaum(Legacy Member)
 


Return to Crystal Reports

Who is online

Users browsing this forum: No registered users and 1 guest