2
votes

Currently I am working on USB port programming for Linux to fully control USB ports. I am running Ubuntu 13.04 and am trying to read data from ttySX files for USB port and also from /dev/bus/usb. But I am not getting any results.

I searched and found ttyUSBX port, but in my case there is no tty. Also, the problem is that the manufacturer of my USB barcode scanner does not provide a driver for linux. So can any one suggest me how to read data from USB port without a driver?

1
Open a Terminal and type lsusb to find your scanner, the name and manufacturer will be listed (which could be different than the printed brand on the scanner/box) and you might find drivers. You can use the xxxx:yyyy digits to find more information as these numbers uniquely define the model (you can post the output of lsusb here, limit only the line about your scanner)JScoobyCed
You'll have to write a kernel-mode driver for this device yourself. ttyUSBx appears only if you're dealing with a USB-to-serial converter, which was detected by the kernel and a node in /dev was created for it. If you don't have a driver, then you don't have a node in /dev. Unless you could somehow directly send USB packets to the device (I'm fairly sure there was an option like that in the kernel, but I can't be certain), I don't see this working without a driver.Daniel Kamil Kozar
Or libusb. It claims to be able to access USB devices without any kernel-land drivers.user529758

1 Answers

4
votes

Most barcode scanners can work as simple usb-to-serial converters and thus you get a ttyusbx device in /dev. The way this usually works is you download some software or manual from the manufacturer's website and scan a barcode or a series of barcodes that put the device in this mode.

Even simpler, ALL barcode scanners should work as HID devices(keyboard)...again this requires downloading some sort of software or manual and scanning a couple barcodes.

Any chance you could provide the scanner's make and model?