Barcode Reader connected to RS232 serial port
Posts: 37
After spending literally days looking for the answer to this, I am confounded.
I'm taking my company off of Windows and onto Linux. I'm using Mepis for the user desktops.
In the parts room, I have a Symbol barcode reader that connects to the serial port. It fully decodes the barcode and (I'm told) sends plain-jane ASCII text to the serial port.
I don't know how to get the text coming in from the serial port to show up in applications.
I went to google and found many developers say that it is trivially easy to do in Linux. The serial port is what was used for teletype machines (hence the "tty" nomenclature). The barcode scanner is sending the exact same signal. It should just work, the way I understand it.
However, I don't find anything that exactly says that. The closest thing I found was in the X11 specs, where it talks about setting up an input device called BARCODE, but doesn't say how to do it.
Barcode readers are everywhere. This work has been done before, but I can't find it to save my life. I do find several references to a "linbar" package that's suppoed to make all this go, but the links to it are all dead.
Is there a way to make it toe-tapping easy to setup a barcode reader? It seems like it should be elegantly easy to do, but I can't figure it out.
Thanks
Loye Young
http://www.iycc.biz
RS232 barcode reader
Posts: 37
Yes, hindsight is a wonderful thing. Problem is that we already have the serial port barcode scanners installed at our parts rooms in four separate locations.
The serial port barcode scanners are industry-standard and are up and running at point of sale and manufacturing sites all across the country. Linux-based POS systems use the serial port as well. I'm obviously missing something simple.
Loye Young
http://www.cmcmaintenance.com
Here is the most promising
Posts: 37
Here is the most promising thing I could find. Looks like the homepage for the utility is down, but it can be downloaded lots of places and may be in the repositories. I do not know if it will work. It's called linbar.
But I also came across mentions of LAMP and using BASH. I have no experience using any of these.
Good luck
http://rpmfind.net/linux/RPM/PLD/dists/ac/ready/i386/linbar-0.5-1.i386.html
Linbar
Posts: 37
Thanks for the tip.
I have tried to install Linbar, but I can't make it work. It's an old utility (circa 1999), and there is zero debian support for it. The particular package you reference is an RPM package. I spent the better part of two days trying to convert it using alien, but ultimately had no luck.
As I said in my original post, the links to the original code for Linbar are broken.
Conceptually, though, even Linbar seems like it's taking the wrong approach. Linux is built around the idea of having the input device drivers abstracted from the application. Linbar circumvents that by reading straight from hardware to screen (unless I misunderstand what little I know about these things).
Somebody out there must see what I do not.
Loye Young
http://www.CMCMaintenance.com
I cannot image that somebody
Posts: 37
I cannot image that somebody doesn't have experience with this.
But I might have hit on a good search phrase this time. Try Googling 'reading barcodes with linux' Some very interesting sites came up that may be of some help.
No luck still
Posts: 37
No luck still. I've googled. I've read HOW-TOs. I've experimented with configuration files.
What am I missing? I don't understand why there is such a dearth of information on this. Barcode readers on a serial port have been around for close to 20 years. They're everywhere. How is it done?
Over the weekend, I bought a Belkin serial-to-USB converter. It claims on the package that I can use "any serial device" via the USB port. My system detects the converter and installs the driver automatically. But alas and alack, I don't know how to make it work either.
I've tried "cat /dev/ttyS0" (connected to the RS232 port) and "cat /dev/ttyUSB0" (connected to the USB port using the converter). No joy.
In poking around on the machine, I see that kinfo doesn't show the IRQ for the serial port on the Interrupts section, but does show the serial ports in the I/O ports. Also, in the Devices section, I see a ttyS but not ttyS0. And shouldn't the serial device be called /dev/ttyS0?
It looks like I'm in for an education on how hardware and software work together.
Loye Young
http://www.CMCMaintenance.com

Rats!
Posts: 5513
Loye, I'm sorry you're having so much difficulty with this. I don't have much to contribute, but I've been lurking on this thread hoping that you would solve your problems because I might have use for the knowledge in the near future 
Can you give some indication of some of the sites that you have found that give even slightly good info?
I did a quick Google search on "linux serial barcode howto" and of course got lots of hits. I went to only one:
http://www.anzio.com/support/vendors/counterpoint.htm
The quotation below is from the site. I am not affiliated in any way with the company or organization, and I don't even know if it will work, but it appears that CounterPoint is recommending software from another company, Rasmussen Software that might do what you want.
Anyway, here's the quotation. And good luck
Jon
CounterPoint
"VirtPort - Virtual Serial Port Software
Rasmussen Software offers a product called VirtPort, that creates a virtual serial port; that is, a serial port on a PC appears (to CounterPoint, etc.) as though it is a Unix/Linux serial port. The port is bidirectional and has full flow control. Baud rate, etc. must be established at the PC side at the time the program is launched."
I have very little
Posts: 37
I have very little experience doing this, but, I will try to be of help.
At where I work, we have a docking port for Symbol portable bar code scanners. We needed to make this work with a Windows 2000 computer. It had in the past worked with a Windows NT4 box. Windows needed a program called ActiveSync. ActiveSync is also used for PDA's and other portable devices.
So, knowing this much. How does Linux talk to portable devices? I don't know, so I ask the question in the hopes that someone can shed light on this.
Consider also, that I ran into a problem with the Win 2K box. ActiveSync required access to certain ports that may have been closed due to network security issues. Firewalls often close the necessary ports, but in this case there was no obvious firewall giving me trouble. But it was decided to not bother our IT people with the problem (who when asked threw their hands up in the air) and I connected an old NT4 box to the old server and worked around the problem.
Could it be that the necessary ports are closed in the firewall. Ports as in ie port 25 etc, not COM1 or COM2. (I don't remember the actual numbers.)
Speaking of COM ports, have you tried the other COM ports and checked their settings? Most likey you have, but I thought I should ask.
Looking at it from the angle
Posts: 37
Looking at it from the angle of connecting a PDA etc. Will the info here help?
http://www.linux.com/article.pl?sid=05/08/17/1847227
Good luck!
have you tried minicom or kermit?
Posts: 13
Maybe as a first step try minicom or kermit to read from that serial port - see if the scanner is transmitting something? might need a null modem cable too (?)
What model is the scanner? I played with some wireless ones a while back - and used minicom on linux and hyperterm on windows to "muck" around with the settings on the Symbol wireless base unit.

Good Point
Posts: 5513
Loye, bucolicbuffalo (love that name) brings up a good point. Try (temporarily) disabling the firewal on your system and see if you have any problems getting stuff from the /dev/ttyS* device. If you get results, then we can track it back to a particular port or device 
Jon
Still no joy
Posts: 37
I've tried the above ideas, and still get no joy.
Does this have anything to do with the way devfs/udev have been incorporated into the 2.6.x kernel?
Does anybody know how to get Warren's attention? I bet he could give some guidance. He's widely seen as a guru on hardware issues. For good reason, too.
Loye Young
http://www.CMCMaintenance.com

Try Sending Here
Posts: 5513
Loye, try sending your info to and perhaps Warren or one of the other developers will have some other ideas 
Jon
Udev? Xorg?
Posts: 37
I sent a note over to our friends at mepis.org as you suggested, but haven't heard back. That's not surprising; they have a lot of irons in the fire right now, and this issue doesn't affect most people out there. I don't expect them to drop everything they're doing to fix my barcode scanner problem.
Still trying to advance the ball, I am trying to figure out how udev loads an RS-232 serial device, and how to configure Xorg to use that device for input. I don't think my scanner is getting loaded by udev on boot-up (though I may not be looking in the right place). And nothing is in the xorg configuration file to cover the barcode scanner.
There would have to be some sort of driver configuration, because RS-232 can be all sorts of devices. I have no problem with having to configure the device driver, xorg, etc., I am just having a difficult time finding any documentation on how to do it.
I've seen a fair number of posts in various message boards asking roughly the same question, but I haven't seen an answer. Mostly, people either go buy a different kind of scanner or write a program that circumvents the normal hardware abstractions to connect directly to the hardware.
Does anyone know of any guidance on this, or at least know where to find documents that would help me figure it out? Even if I had some sort of "serial device drivers for dummies" document, that would work. (The HOW-TOs on how to write serial device drivers that I've found so far are mostly about how to write a device driver for modems, PDAs, and other communication devices, but not input devices.)
By the way, whenever I figure this out, I will post instructions so that this wheel doesn't get reinvented again.
Loye Young
Central Maintenance Corporation
http://www.CMCMaintenance.com
Connect a barcode reader
Posts: 2
Take a look here:
http://www.skandata.com/howto.html
go down to the section titled:
What's a Bar Code Software Keyboard Wedge?
It looks to me like you are in this kind of a spot, you need to decode the signal. The section above it titled:
What's a Bar Code Keyboard Wedge?
mentions a piece of hardware that might take care of the need for you. After a quick google it looks as though you might be better off just buying a new scanner, the first link I tried was here:
http://www.nationalbarcode.com/hhp/st2000r.htm
Seems to me your scanner is not worth a $200 converter.
So far my experience with barcode scanners was discovering there are no more ps2 ports on our office pc's. Picked one up for $30 (web $5), plugged it in and it works the same as a keyboard. This should be platform independent unless the one you have requires the special software. It reminds me of an old pc I once had with a 'modem' that was not usable by anything other than win95 because of the drivers/software.
Hope this helps,
Wayne Becker
www.proace.com

Thanks Wayne
Posts: 5513
Thanks Wayne. Although this is actually a pretty old thread, and I don't know whether Loye is still monitoring things, you have brought up a good idea. "Wedge" technology is very effective because the "wedge" is interpreting the barcode and converting it into text codes. Often you can pass the data into any text-enabled (most every) application. It just appears to the application like the end-user is "a very fast typist".
It doesn't always work, but it's worth a shot.
Perhaps this info will be useful to someone else 
Jon
One more link
Posts: 2
While continuing to research the best scanner for our needs I stumbled upon this little bit:
SKD-USB-RSU
SB to RS-232 Serial Adapter
Provides USB interface to Portable Systems with Serial Interfaces $69.
Found here:
http://www.skandata.com/catalog2.html
This might be just the ticket for the RS232 application.
Wayne Becker
www.proace.com
Hardware solutions to a software problem
Posts: 37
I appreciate the feedback, especially from a fellow Texan. (Hook 'em Horns)
Yes, spending more money on more hardware is theoretically an alternative, but that doesn't go over so well with my boss. He doesn't need to spend money to get a barcode scanner to work on Windows. Anyway, I'm not sure that spending more money on hardware would solve the problem.
The problem I have isn't the hardware. The scanner itself does the decoding and an RS232 connection makes the data available. It is true that serial-to-USB converters abound, and I've tried them. Unfortunately, my experience so far is that the problem is merely moved from an RS232 serial port to the USB bus. The machine still needs to be able to understand that what it's hearing on the USB port should be sent to the screen as character entry. (If you've actually gotten a serial barcode scanner to work via a Serial-to-USB adapter, please let me know how you did it.)
The problem is how to configure the box to send the data coming in from the serial port to where it's supposed to go. As I've said before, this is supposed to be easy. Linus the Great himself has written that the Linux kernel should continue to support the serial port generally, and barcode scanners specifically. Thus, he must think it still works, but I (mere mortal that I am) am at a loss to know how to make it go.
Since my last post here, I have been able to read data from the barcode scanner into a console window. I haven't been able to figure out how to get the data into an application, though.
My current theory is that a 2.6-compliant device driver needs to be written for barcode scanners, both USB and serial. (The old LINBAR driver doesn't work since the demise of kernel 2.4 device drivers.) I've attempted to learn how to write a device driver, but it's for greater minds than mine.
Loye Young
Laredo, Texas
Central Maintenance Corporation
http://www.CMCMaintenance.com
What is the Symbol part number or model number?
Posts: 1
What is the part number or model number of the scanner you are using?
KME Software Solutions, Inc.
http://www.kmess.com
Particular barcode scanner I'm using
Posts: 37
We're using Symbol scanner Model LS4004I-I100.
You have ideas, perhaps? There are a lot of folks out here who are in the same boat.
Loye Young
Central Maintenance Corporation
http://www.CMCMaintenance.com
Reading data from the barcode scanner
Posts: 1
Loye,
I found this thread whilst searching for a solution to the same problem as you are having. I have an application that works fine on windows, and am trying to migrate to linux but cannot read anything from the serial barcode scanner.
you state above that
Since my last post here, I have been able to read data from the barcode scanner into a console window. I haven't been able to figure out how to get the data into an application, though.
Are you able to tell me how you managed to do this?
Thank you
Alex Couper
amcouper at gmail dot com
Continuing saga of barcodes
Posts: 37
Are you able to tell me how you managed to do this?
Yes.
First, configure your serial port. I'm assuming that your scanner is connected to ttyS0. It turns out that mine was ttyS1, which I discovered simply by trying both.
#stty -F /dev/ttyS0 9600
Next, listen to your port.
#cat /dev/ttyS0
The cursor will move to the left margin and stay there. If you are like I am, you have a copy of George Strait's latest CD nearby, so scan the UPC code on the back. Bada-bing-bada-boom, there is the number. To kill the cat, press Cntl-C. (If only it was that easy to do to the one from next door that keeps getting in my garbage!)
I have been fiddling around with /etc/X11/xorg.conf to see what I could come up with. I think I'm onto something, but still no resolution. I tried adding a stanza like the keyboard, except I changed the device to /dev/ttyS0 and the name to "barcode", and adding a line at the end "InputDevice barcode SendCoreEvents". Restarted X and logged back in. Then I opened up Kedit and scanned King George's CD again. This time, all I got was gibberish. Funny thing, though, was that if I scanned something, from that time on, the keyboard gave me gibberish, too. So I used the three finger salute (Cntl-Alt-Bksp) to restart X. Once I was logged back in, I put xorg.conf back the way it was to start with.
What I take from the foregoing is that the built-in serial device driver is all that's needed. I think now that I need to edit xorg.conf somehow to tell X to recognize the ttyS0 as an input device. I've looked at evdev, which looks promising, but I haven't been able to figure out how to configure it nor how to make sure that the event devices would stay put from reboot to reboot.
Loye Young
Central Maintenance Corporation
http://www.CMCMaintenance.com

Pipe The Output?
Posts: 5513
Loye, I want to congratulate you on trying to get these barcode scanners going. I am "indirectly interested" because I think that getting this solved will open up many opportunities to use scanners with the OS. Keep up the good work! 
I have a suggestion. Have you tried to "pipe" the results into a GUI application? Could you try doing something like "cat /dev/ttyS0 | kate" to send results from the serial port into an editor?
I'm just wondering if it is necessary to do some "plumbing" and add a pipe or two, or a socket or three to send the results from one file (/dev/ttyS0) to another (someEditor)...
Jon
SimplyMEPIS Value CD: $17.95
Amount saved not buying Windows Vista Ultimate: $399
Experience gained learning Mepis and helping others: Priceless

I have a bar scanner and it
Posts: 4077
I have a bar scanner and it just sends the text to the application that's active, just like a keyboard, I didn't do anything special (it's a USB device).
--
Check out Mepis wiki: www.mepis.org/docs
Can you name the model number and make of the barcode scanner?
Posts: 1
Hi there, AdrianTM
We're working on migrating point of sales systems to Linux while also evaluating barcode scanners that work with it.
Could you tell us which barcode scanner did you use?
Regards,
Yesudeep.
Sorry, this forum is closed
Posts: 305
Can you please post your question over at http://mepislovers.org? If you have not yet been there, you will need to register again to make a post.
Thanks.
barcode reader
Posts: 4864
i've only played with one which was on the keyboard ps/2 line (physically between the keyboard and the computer). It 'just worked'
I'd check out prices and look for one similar, ask if you can trial it first.