Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-09

SNAPI Driver and USB HID

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Johann Glaser

Hi!

I've bought a barcode scanner (Symbol MS4407) with an USB interface and want to use that with Linux. Unfortunately Motorola (who bought Symbol a few years ago) do not provide Linux drivers and also do not provide USB protocol documentation, even after some pushy support questions.

For Windows they provide a SNAPI DLL plus a .h file. Does anybody know a Linux version of the SNAPI driver, preferably written in FreePascal?

As I'm not very confident that such a driver does exist, I've also evaluated the USB descriptors and such stuff. The scanner offers an USB HID class interface. Some search in this mailing list archives reveals, that Jonas pointed to a freelance job to provide some USB HID reader on 2009-07-21 and 2009-09-16. Are there any (freely) available results from these jobs? Does anybody else have information on how to use the Linux /dev/hid... stuff with Pascal? Or how to work with the USB HID descriptor stuff?

Thanks
Hansi

Luca Olivetti
to Johann Glaser

Al 06/09/10 19:07, En/na Johann Glaser ha escrit:

As I'm not very confident that such a driver does exist, I've also evaluated the USB descriptors and such stuff. The scanner offers an USB HID class interface.

From the manual I see that it also offers com port emulation. In that case it should provide a serial interface (e.g. /dev/ttyUSB0) that you can simply read with synaser or another serial port library. I don't know (yet) how the usb model works, but the plain serial one can be configured to send the barcode terminated with cr+lf, and that's easy to read.

Bye.

Luca
Johann Glaser
to Luca Olivetti

Hi Luca!

Show quoted text 10 lines
> As I'm not very confident that such a driver does exist, I've also > evaluated the USB descriptors and such stuff. The scanner offers an USB > HID class interface. From the manual I see that it also offers com port emulation. In that case it should provide a serial interface (e.g. /dev/ttyUSB0) that you can simply read with synaser or another serial port library. I don't know (yet) how the usb model works, but the plain serial one can be configured to send the barcode terminated with cr+lf, and that's easy to read.

Thank you for looking this up. I also investigated this, but unfortunately there is no "driver" for the /dev/ttyUSB0. A year ago I used a DataLogic scanner which uses the /dev/ttyACM0 interface, which is a standardized interface defined by the USB organization. Unfortunately, /dev/ttyUSB0 is not standardized but requires different drivers for every chip (e.g. cp2101, ft232, ...). For the MS4407 scanner I didn't yet find a serial driver. So, unfortunately, the RS232 emulation does not work too. :-(

Thanks
Hansi

Henry Vermaak
to Johann Glaser: Hi! I've bought a barcode scanner (Symbol MS4407) with an USB interface and want to use…
Johann Glaser wrote 18 lines
Hi! I've bought a barcode scanner (Symbol MS4407) with an USB interface and want to use that with Linux. Unfortunately Motorola (who bought Symbol a few years ago) do not provide Linux drivers and also do not provide USB protocol documentation, even after some pushy support questions. For Windows they provide a SNAPI DLL plus a .h file. Does anybody know a Linux version of the SNAPI driver, preferably written in FreePascal? As I'm not very confident that such a driver does exist, I've also evaluated the USB descriptors and such stuff. The scanner offers an USB HID class interface. Some search in this mailing list archives reveals, that Jonas pointed to a freelance job to provide some USB HID reader on 2009-07-21 and 2009-09-16. Are there any (freely) available results from these jobs? Does anybody else have information on how to use the Linux /dev/hid... stuff with Pascal? Or how to work with the USB HID descriptor stuff?

I know about libhid, maybe that helps?

Henry

Johann Glaser
to Henry Vermaak

Hi Henry!

Henry Vermaak wrote 21 lines
On 6 September 2010 18:07, Johann Glaser wrote: > Hi! > > I've bought a barcode scanner (Symbol MS4407) with an USB interface and > want to use that with Linux. Unfortunately Motorola (who bought Symbol a > few years ago) do not provide Linux drivers and also do not provide USB > protocol documentation, even after some pushy support questions. > > For Windows they provide a SNAPI DLL plus a .h file. Does anybody know a > Linux version of the SNAPI driver, preferably written in FreePascal? > > As I'm not very confident that such a driver does exist, I've also > evaluated the USB descriptors and such stuff. The scanner offers an USB > HID class interface. Some search in this mailing list archives reveals, > that Jonas pointed to a freelance job to provide some USB HID reader on > 2009-07-21 and 2009-09-16. Are there any (freely) available results from > these jobs? Does anybody else have information on how to use the > Linux /dev/hid... stuff with Pascal? Or how to work with the USB HID > descriptor stuff? I know about libhid, maybe that helps?

Thanks for the hint. I must have overlooked this in my previous searches.

Thanks!
Hansi

Luca Olivetti
to Johann Glaser: Hi Luca! Thank you for looking this up. I also investigated this, but unfortunately there…

Al 06/09/10 22:28, En/na Johann Glaser ha escrit:

Unfortunately, /dev/ttyUSB0 is not standardized but requires different drivers for every chip (e.g. cp2101, ft232, ...). For the MS4407 scanner I didn't yet find a serial driver. So, unfortunately, the RS232 emulation does not work too. :-(

That's worrying, since I'm going to have to use a similar symbol scanner in the near future.
Did you actually try to plug it in when configured in com port emulation? If so, what did you see in dmesg, /var/log/syslog?

Bye

Luca
Johann Glaser
to Luca Olivetti

Hi!

Luca Olivetti wrote 11 lines
Al 06/09/10 22:28, En/na Johann Glaser ha escrit: > Unfortunately, /dev/ttyUSB0 is not standardized but requires different > drivers for every chip (e.g. cp2101, ft232, ...). For the MS4407 scanner > I didn't yet find a serial driver. So, unfortunately, the RS232 > emulation does not work too. :-( That's worrying, since I'm going to have to use a similar symbol scanner in the near future. Did you actually try to plug it in when configured in com port emulation? If so, what did you see in dmesg, /var/log/syslog?

Just that it is a HID device. Looking at lsusb -d showed a much smaller amount of endpoints like with the SNAPI interface. But the kernel did not load any serial driver.

Probably the scanner does emulate an UART chip which resembles one of those the kernel has drivers (e.g. cp2101 or so), but playing around is tedious.

OTOH the Sub-D-9 connector also provides real RS232 signals (with TTL level) besides the USB signals. But this is not an option for me.

Bye
Hansi