Skip to contentSkip to conversation

Linux cdc-acm-driver

DISCUSSION Manavendra Nath Manav 2 participants 9 messages Mar 1, 2012 – Mar 6, 2012 8 messages not in the archive

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive

Hi Johan

Quoted 25 lines · Johan Hovold
Quoted 10 lines · Stefan Dreyer

Hello Johan,

i hope, you can help me. I try to get a barcode-Scanner (Metrologic Focus MS 1690) to work. If i take a look at the Windows driver, this scanner should work in serial-mode as CDC ACM.
i have added the device:
? ? ? { USB_DEVICE(0x0c2e, 0x0720), /*Metro Metrologic MS7120 Barcode Scanner (bi-directional serial mode) ?*/
? ? ? },

Quoted 2 lines

and recompile the module. If i plug the device in, the module cdc-acm is loaded. But no device ttyACM0 appears.

What does lsusb -v say? If it is a cdc-acm device you should not need to add the pid/vid to the cdc-acm driver.

What is written to the system logs?

Quoted 2 lines

Is there a possibility to debug the module? I would like to know, what happens.

If your recompiling the module you can enable debugging by changing the following "undef"

Quoted 7 lines

? ? ? ?#undef DEBUG

to "define", or you can enable dynamic debugging (see Documentation/dynamic-debug-howto.txt).

Thanks,
Johan

Sorry for jumping in the middle of the thread, but I too have a similar problem with Metrologic Focus MS1690 Barcode scanner. Currently, I am getting the device as bi-directional serial mode but I want to make it work as a USB HID Keyboard device. In the manufacturer's manual there is a barcode to configure the device as such. After this I can see from dmesg that first the device gets registered as USB HID v1.11 Keyboard, the I guess the scanner power cycles disconnecting the USB and again gets registered as a new device.

*** dmesg snip ***

[69818.065741] input: Honeywell Scanning and Mobility Honeywell
Scanning and Mobility Scanner as
/devices/pci0000:00/0000:00:1d.1/usb7/7-1/7-1:1.0/input/input6
[69818.065810] generic-usb 0003:0C2E:0200.0003: input,hidraw2: USB HID
v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and
Mobility Scanner] on usb-0000:00:1d.1-1/input0
[69823.804854] usb 7-1: USB disconnect, address 2
[69827.180717] usb 7-1: new low speed USB device using uhci_hcd and address 3
[69827.355585] usb 7-1: New USB device found, idVendor=0c2e, idProduct=0720
[69827.355590] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[69827.355593] usb 7-1: Product: Honeywell Scanning and Mobility Scanner
[69827.355596] usb 7-1: Manufacturer: Honeywell Scanning and Mobility

[root at pe1800xs ~]# lsusb -v
Bus 007 Device 003: ID 0c2e:0720 Metro Metrologic MS7120 Barcode
Scanner (bi-dir ectional
serial mode)
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10

  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8

idVendor 0x0c2e Metro
idProduct 0x0720 Metrologic MS7120 Barcode Scanner
(bi-directional se rial
mode)
bcdDevice 1.00

  iManufacturer           1 Honeywell Scanning and Mobility
  iProduct                2 Honeywell Scanning and Mobility Scanner
  iSerial                 0
  bNumConfigurations      1

Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 41
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 3 POS USB
bmAttributes 0x80
(Bus Powered)
MaxPower 450mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
** UNRECOGNIZED: 09 21 11 01 00 01 22 3f 00 Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Status: 0x0000
(Bus Powered)

[root at pe1800xs ~]# cat /proc/bus/usb/devices

T:  Bus=07 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0c2e ProdID=0720 Rev= 1.00
S:  Manufacturer=Honeywell Scanning and Mobility
S:  Product=Honeywell Scanning and Mobility Scanner
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=02(O) Atr=03(Int.) MxPS=   8 Ivl=10ms
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

How to make this device work on Linux?

Please note this link http://forums.gentoo.org/viewtopic-t-852806.html
says that "They tracked it down to the scanner registering itself as a keyboard and then power cycling and registering as a custom POS device. I contacted the manufacturer and they sent me a barcode (99940) which when scanned locked the device into USB keyboard mode. It then worked fine as a standard keyboard."

Signature · 1 line
Manavendra Nath Manav
#5 lore raw
In reply to a message not in the archive
Quoted 5 lines · Stefan Dreyer

Hi,

allthough the answer is offtopic for cdc-acm-driver, i will answer, because maybe it helps other people in future.

Quoted 7 lines

I can tell you exactly, what is going on. If the scanner switches to ProductId=0720 (0c2e:0720) the scanner is working in Serial-Mode. If you want the scanner let work as serial device, you have to use the driver metro-usb. The manufacturer has this driver, but that one is outdatet and doesn't compile on actual Linux kernel.
I found an actual driver, which compiles even with kernel 3.2
<https://gitorious.org/other/metro-usb/commits/master>

Thanks a lot for the prompt reply, this should adequately solve my problem. I am able to download the driver source and compile. However, I have run into a trivial module format error.

[root at pe1800xs serial]# modinfo metro-usb.ko
filename: ? ? ? metro-usb.ko
description: ? ?Metrologic Instruments Inc. - USB-POS driver
author: ? ? ? ? Aleksey Babahin <[email protected]>
author: ? ? ? ? Philip Nicastro
license: ? ? ? ?GPL
srcversion: ? ? AF4C7DDE2804EBB1578A05F
alias: ? ? ? ? ?usb:v0C2Ep0710d*dc*dsc*dp*ic*isc*ip*
alias: ? ? ? ? ?usb:v0C2Ep0720d*dc*dsc*dp*ic*isc*ip*
depends: ? ? ? ?usbserial
vermagic: ? ? ? 2.6.35.6-45.fc14.i686 SMP mod_unload modversions 686
parm: ? ? ? ? ? debug:Print debug info (bool 1=on, 0=off) (bool)
parm: ? ? ? ? ? vendor:User specified vendor ID (ushort) (ushort)
parm: ? ? ? ? ? product:User specified product ID (ushort) (ushort)

[root at pe1800xs serial]# modprobe -f -v metro-usb
insmod /lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko
FATAL: Error inserting metro_usb (/lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko):
Invalid module format

[root at pe1800xs serial]# uname -a
Linux pe1800xs 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC 2010 i686 i686 i386 GNU/Linux

[root at pe1800xs serial]# dmesg

[84119.755750] metro_usb: version magic '2.6.35.6-45.fc14.i686 SMP

mod_unload modversions 686 ' should be '2.6.35.6-45.fc14.i686 SMP mod_unload 686 '

I am running Fedora14 with "Force module loading option disabled". How can I turn it ON without recompiling the kernel. Or, since I have the souce files of the driver (attached), how can I modify the metro-usb.c file to provide suitable "module version".

--
Manavendra Nath Manav
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 836 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120301/53914940/attachment-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: metro-usb.c
Type: text/x-csrc
Size: 19456 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120301/53914940/attachment-0002.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: metro-usb.h
Type: text/x-chdr
Size: 1808 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120301/53914940/attachment-0003.bin

#11 lore raw
In reply to a message not in the archive
Quoted 45 lines · Manavendra Nath Manav
Quoted 5 lines · Stefan Dreyer

Hi,

allthough the answer is offtopic for cdc-acm-driver, i will answer, because maybe it helps other people in future.

Quoted 7 lines

I can tell you exactly, what is going on. If the scanner switches to ProductId=0720 (0c2e:0720) the scanner is working in Serial-Mode. If you want the scanner let work as serial device, you have to use the driver metro-usb. The manufacturer has this driver, but that one is outdatet and doesn't compile on actual Linux kernel.
I found an actual driver, which compiles even with kernel 3.2
<https://gitorious.org/other/metro-usb/commits/master>

Thanks a lot for the prompt reply, this should adequately solve my problem. I am able to download the driver source and compile. However, I have run into a trivial module format error.

[root at pe1800xs serial]# modinfo metro-usb.ko
filename: ? ? ? metro-usb.ko
description: ? ?Metrologic Instruments Inc. - USB-POS driver
author: ? ? ? ? Aleksey Babahin <[email protected]>
author: ? ? ? ? Philip Nicastro
license: ? ? ? ?GPL
srcversion: ? ? AF4C7DDE2804EBB1578A05F
alias: ? ? ? ? ?usb:v0C2Ep0710d*dc*dsc*dp*ic*isc*ip*
alias: ? ? ? ? ?usb:v0C2Ep0720d*dc*dsc*dp*ic*isc*ip*
depends: ? ? ? ?usbserial
vermagic: ? ? ? 2.6.35.6-45.fc14.i686 SMP mod_unload modversions 686
parm: ? ? ? ? ? debug:Print debug info (bool 1=on, 0=off) (bool)
parm: ? ? ? ? ? vendor:User specified vendor ID (ushort) (ushort)
parm: ? ? ? ? ? product:User specified product ID (ushort) (ushort)

[root at pe1800xs serial]# modprobe -f -v metro-usb
insmod /lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko
FATAL: Error inserting metro_usb (/lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko):
Invalid module format

[root at pe1800xs serial]# uname -a
Linux pe1800xs 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC 2010 i686 i686 i386 GNU/Linux

[root at pe1800xs serial]# dmesg

Quoted 9 lines
[84119.755750] metro_usb: version magic '2.6.35.6-45.fc14.i686 SMP

mod_unload modversions 686 ' should be '2.6.35.6-45.fc14.i686 SMP mod_unload 686 '

I am running Fedora14 with "Force module loading option disabled". How can I turn it ON without recompiling the kernel. Or, since I have the souce files of the driver (attached), how can I modify the metro-usb.c file to provide suitable "module version".

I am able to load the metro-usb.ko module now and the scanner works perfectly. I opened the serial console using
bash# serial /dev/ttyUSB0 9600
and can see the 1D and 2D scanned barcodes. Thanks :)

[89073.533413] metro-usb 7-1:1.0: Metrologic USB to serial converter.
converter detected
[89073.533489] usb 7-1: Metrologic USB to serial converter. converter

now attached to ttyUSB0

The workaround I did to remove "invalid module format" error is that I modified the vermagic.h file.

[root at pe1800xs e518816]# diff /usr/src/kernels/2.6.35.6-45.fc14.i686/include/linux/vermagic.h.old /usr/src/kernels/2.6.35.6-45.fc14.i686/include/linux/vermagic.h.new 32,33c32
< MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS \
< MODULE_ARCH_VERMAGIC
---

Quoted 1 line

MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC

Is this the correct way to resolve the error, although it works for me? I am sure there would be other better ways to resolve vermagic conflict errors.

Signature · 1 line
Manavendra Nath Manav
#12 lore raw

Hi Stefan

Quoted 77 lines · Manavendra Nath Manav
Quoted 45 lines · Manavendra Nath Manav
Quoted 5 lines · Stefan Dreyer

Hi,

allthough the answer is offtopic for cdc-acm-driver, i will answer, because maybe it helps other people in future.

Quoted 7 lines

I can tell you exactly, what is going on. If the scanner switches to ProductId=0720 (0c2e:0720) the scanner is working in Serial-Mode. If you want the scanner let work as serial device, you have to use the driver metro-usb. The manufacturer has this driver, but that one is outdatet and doesn't compile on actual Linux kernel.
I found an actual driver, which compiles even with kernel 3.2
<https://gitorious.org/other/metro-usb/commits/master>

Thanks a lot for the prompt reply, this should adequately solve my problem. I am able to download the driver source and compile. However, I have run into a trivial module format error.

[root at pe1800xs serial]# modinfo metro-usb.ko
filename: ? ? ? metro-usb.ko
description: ? ?Metrologic Instruments Inc. - USB-POS driver
author: ? ? ? ? Aleksey Babahin <[email protected]>
author: ? ? ? ? Philip Nicastro
license: ? ? ? ?GPL
srcversion: ? ? AF4C7DDE2804EBB1578A05F
alias: ? ? ? ? ?usb:v0C2Ep0710d*dc*dsc*dp*ic*isc*ip*
alias: ? ? ? ? ?usb:v0C2Ep0720d*dc*dsc*dp*ic*isc*ip*
depends: ? ? ? ?usbserial
vermagic: ? ? ? 2.6.35.6-45.fc14.i686 SMP mod_unload modversions 686
parm: ? ? ? ? ? debug:Print debug info (bool 1=on, 0=off) (bool)
parm: ? ? ? ? ? vendor:User specified vendor ID (ushort) (ushort)
parm: ? ? ? ? ? product:User specified product ID (ushort) (ushort)

[root at pe1800xs serial]# modprobe -f -v metro-usb
insmod /lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko
FATAL: Error inserting metro_usb (/lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko):
Invalid module format

[root at pe1800xs serial]# uname -a
Linux pe1800xs 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC 2010 i686 i686 i386 GNU/Linux

[root at pe1800xs serial]# dmesg

Quoted 9 lines
[84119.755750] metro_usb: version magic '2.6.35.6-45.fc14.i686 SMP

mod_unload modversions 686 ' should be '2.6.35.6-45.fc14.i686 SMP mod_unload 686 '

I am running Fedora14 with "Force module loading option disabled". How can I turn it ON without recompiling the kernel. Or, since I have the souce files of the driver (attached), how can I modify the metro-usb.c file to provide suitable "module version".

I am able to load the metro-usb.ko module now and the scanner works perfectly. ?I opened the serial console using
bash# serial /dev/ttyUSB0 9600
and can see the 1D and 2D scanned barcodes. Thanks :)

[89073.533413] metro-usb 7-1:1.0: Metrologic USB to serial converter.
converter detected
[89073.533489] usb 7-1: Metrologic USB to serial converter. converter

now attached to ttyUSB0

The workaround I did to remove "invalid module format" error is that I modified the vermagic.h file.

[root at pe1800xs e518816]# diff /usr/src/kernels/2.6.35.6-45.fc14.i686/include/linux/vermagic.h.old /usr/src/kernels/2.6.35.6-45.fc14.i686/include/linux/vermagic.h.new 32,33c32
< ? ? ? MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS ? ? ? \
< ? ? ? MODULE_ARCH_VERMAGIC
---

Quoted 6 lines
Quoted 1 line

? ? ? MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC

Is this the correct way to resolve the error, although it works for me? I am sure there would be other better ways to resolve vermagic conflict errors.

The Metrologic scanner is working perfectly in bi-directional serial mode. But when I configure it as USB HID Keyboard mode as shown in the link and keyboard layout as US-English, I am not getting any data from Scanner. I have opened a terminal and scanned multiple barcodes but no output on screen.

[root at pe1800xs e518816]# dmesg

[98498.945783] input: Honeywell Scanning and Mobility Honeywell
Scanning and Mobility Scanner as
/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input20
[98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID

v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and Mobility Scanner] on usb-0000:00:1d.1-2/input0

[root at pe1800xs e518816]# lsusb -v
Bus 007 Device 020: ID 0c2e:0200 Metro Metrologic Scanner Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10

  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0c2e Metro
  idProduct          0x0200 Metrologic Scanner
  bcdDevice           58.88
  iManufacturer           1 Honeywell Scanning and Mobility
  iProduct                2 Honeywell Scanning and Mobility Scanner
  iSerial                 0
  bNumConfigurations      1

Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 3 HID Keyboard
bmAttributes 0x80
(Bus Powered)
MaxPower 450mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 1 Keyboard
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 63
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Status: 0x0000
(Bus Powered)

[root at pe1800xs e518816]# cat /proc/bus/usb/devices

T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0c2e ProdID=0200 Rev=58.88
S:  Manufacturer=Honeywell Scanning and Mobility
S:  Product=Honeywell Scanning and Mobility Scanner

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=01 Driver=usbhid
E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=10ms

Can you help me in getting data from Scanner in USB HID Keyboard Emulation mode as this would reduce the burden of using an extra driver and the application program can read directly from the emulation keyboard instead of listening to serial device.

Thanks & Regards,
Manavendra Nath Manav

#6 lore raw
In reply to Manavendra Nath Manav
Quoted 19 lines · Manavendra Nath Manav
Quoted 5 lines · Stefan Dreyer

Hi,

allthough the answer is offtopic for cdc-acm-driver, i will answer, because maybe it helps other people in future.

Quoted 7 lines

I can tell you exactly, what is going on. If the scanner switches to ProductId=0720 (0c2e:0720) the scanner is working in Serial-Mode. If you want the scanner let work as serial device, you have to use the driver metro-usb. The manufacturer has this driver, but that one is outdatet and doesn't compile on actual Linux kernel.
I found an actual driver, which compiles even with kernel 3.2
<https://gitorious.org/other/metro-usb/commits/master>

Thanks a lot for the prompt reply, this should adequately solve my problem. I am able to download the driver source and compile. However, I have run into a trivial module format error.

Quoted 14 lines

[root at pe1800xs serial]# modinfo metro-usb.ko
filename: ? ? ? metro-usb.ko
description: ? ?Metrologic Instruments Inc. - USB-POS driver
author: ? ? ? ? Aleksey Babahin <[email protected]>
author: ? ? ? ? Philip Nicastro
license: ? ? ? ?GPL
srcversion: ? ? AF4C7DDE2804EBB1578A05F
alias: ? ? ? ? ?usb:v0C2Ep0710d*dc*dsc*dp*ic*isc*ip*
alias: ? ? ? ? ?usb:v0C2Ep0720d*dc*dsc*dp*ic*isc*ip*
depends: ? ? ? ?usbserial
vermagic: ? ? ? 2.6.35.6-45.fc14.i686 SMP mod_unload modversions 686
parm: ? ? ? ? ? debug:Print debug info (bool 1=on, 0=off) (bool)
parm: ? ? ? ? ? vendor:User specified vendor ID (ushort) (ushort)
parm: ? ? ? ? ? product:User specified product ID (ushort) (ushort)

Aleksey, any reason this driver hasn't been submitted upstream yet? If you don't mind, I'll be glad to forward port it and get it merged to the main kernel.org tree. Or is there some reason we can't do that?

thanks,

greg k-h

#14 lore raw
In reply to a message not in the archive

Hi Stefan

Quoted 45 lines · Stefan Dreyer

Hi,

Am 01.03.2012 14:57, schrieb Manavendra Nath Manav:

Quoted 26 lines

The Metrologic scanner is working perfectly in bi-directional serial mode. But when I configure it as USB HID Keyboard mode as shown in the link and keyboard layout as US-English, I am not getting any data from Scanner. I have opened a terminal and scanned multiple barcodes but no output on screen.

[root at pe1800xs e518816]# dmesg

[98498.945783] input: Honeywell Scanning and Mobility Honeywell
Scanning and Mobility Scanner as
/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input20
[98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID

v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and Mobility Scanner] on usb-0000:00:1d.1-2/input0

[root at pe1800xs e518816]# lsusb -v
Bus 007 Device 020: ID 0c2e:0200 Metro Metrologic Scanner [root at pe1800xs e518816]# cat /proc/bus/usb/devices
T: ?Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
D: ?Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= ?1
P: ?Vendor=0c2e ProdID=0200 Rev=58.88
S: ?Manufacturer=Honeywell Scanning and Mobility
S: ?Product=Honeywell Scanning and Mobility Scanner
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ?) Sub=01 Prot=01 Driver=usbhid
E: ?Ad=81(I) Atr=03(Int.) MxPS= ? 8 Ivl=10ms

Quoted 4 lines

Can you help me in getting data from Scanner in USB HID Keyboard Emulation mode as this would reduce the burden of using an extra driver and the application program can read directly from the emulation keyboard instead of listening to serial device.

For me, that looks good. But i never have any problems using the scanner in Keyboard-Mode. Are all the necessary drivers loaded (usbcore,hid,usbhid,...)
What happens, if you plug a new USB-Keyboard in. Does it works? Did you try to recall factory-settings before? Maybe the Keyboard-mode is disabled somewhere else.

Quoted 7 lines

you can test all the input-devices, in directory /dev/input there must be device-files named event0 ... eventN (You could identify it via directory:
/dev/input/by-id, if you have it on fedora 14)
you can test them via

# cat /dev/input/event9 | hexdump
If you scan codes, the hexdump of the keycodes is shown.

I scanned all the required bar-codes to make Metrologic MS1690 work as USB HID Keyboard, it is being detected and driver usbhid attached to it, but I am not able to see any output on console. The output is fine when it is configured in serial mode. However, hexdump shows keycodes. I attached another standard USB Dell keyboard and it is working fine.

[98498.945783] input: Honeywell Scanning and Mobility Honeywell
Scanning and Mobility Scanner as
/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input20
[98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID

v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and Mobility Scanner] on usb-0000:00:1d.1-2/input0

[root at pe1800xs input]# cat /proc/bus/usb/devices

T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0c2e ProdID=0200 Rev=58.88
S:  Manufacturer=Honeywell Scanning and Mobility
S:  Product=Honeywell Scanning and Mobility Scanner

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=01 Driver=usbhid
E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=10ms

[root at pe1800xs ~]# ll /dev/input/by-id/
total 0
lrwxrwxrwx 1 root root 9 Feb 29 15:46 usb-Dell_Dell_QuietKey_Keyboard-event-kbd -> ../event2
lrwxrwxrwx 1 root root 9 Feb 29 17:17 usb-Dell_Dell_USB_Entry_Keyboard-event-kbd -> ../event5
lrwxrwxrwx 1 root root 9 Mar 1 19:10 usb-Honeywell_Scanning_and_Mobility_Honeywell_Scanning_and_Mobility_Scanner-event-kbd -> ../event6

[root at pe1800xs input]# cat event6 | hexdump
0000000 8be0 4f50 ef90 0009 0004 0004 0027 0007
0000010 8be0 4f50 ef97 0009 0001 000b 0001 0000
0000020 8be0 4f50 ef98 0009 0000 0000 0000 0000
0000030 8be0 4f50 0ecf 000a 0004 0004 0027 0007
0000040 8be0 4f50 0ed4 000a 0001 000b 0000 0000
0000050 8be0 4f50 0ed5 000a 0000 0000 0000 0000
*** snip ***

I am getting hexdump after scanning bar-codes, but why it is not coming on console as it should like a standard keyboard.

Signature · 1 line
Manavendra Nath Manav
#16 lore raw
In reply to a message not in the archive
Quoted 109 lines · Stefan Dreyer

Hi,

Am 02.03.2012 10:05, schrieb Manavendra Nath Manav:

Quoted 105 lines

Hi Stefan

Quoted 49 lines · On Thu, Mar 1, 2012 at 7:51 PM, Stefan Dreyer <[email protected]>…

Hi,

Am 01.03.2012 14:57, schrieb Manavendra Nath Manav:

Quoted 26 lines

The Metrologic scanner is working perfectly in bi-directional serial mode. But when I configure it as USB HID Keyboard mode as shown in the link and keyboard layout as US-English, I am not getting any data from Scanner. I have opened a terminal and scanned multiple barcodes but no output on screen.

[root at pe1800xs e518816]# dmesg

[98498.945783] input: Honeywell Scanning and Mobility Honeywell
Scanning and Mobility Scanner as
/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input20
[98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID

v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and Mobility Scanner] on usb-0000:00:1d.1-2/input0

[root at pe1800xs e518816]# lsusb -v
Bus 007 Device 020: ID 0c2e:0200 Metro Metrologic Scanner [root at pe1800xs e518816]# cat /proc/bus/usb/devices
T: ?Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
D: ?Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= ?1
P: ?Vendor=0c2e ProdID=0200 Rev=58.88
S: ?Manufacturer=Honeywell Scanning and Mobility
S: ?Product=Honeywell Scanning and Mobility Scanner
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ?) Sub=01 Prot=01 Driver=usbhid
E: ?Ad=81(I) Atr=03(Int.) MxPS= ? 8 Ivl=10ms

Quoted 4 lines

Can you help me in getting data from Scanner in USB HID Keyboard Emulation mode as this would reduce the burden of using an extra driver and the application program can read directly from the emulation keyboard instead of listening to serial device.

For me, that looks good. But i never have any problems using the scanner in
Keyboard-Mode. Are all the necessary drivers loaded (usbcore,hid,usbhid,...)
What happens, if you plug a new USB-Keyboard in. Does it works? Did you try
to recall factory-settings before? Maybe the Keyboard-mode is disabled somewhere else.

Quoted 8 lines

you can test all the input-devices, in directory /dev/input there must be device-files named event0 ... eventN (You could identify it via directory:
/dev/input/by-id, if you have it on fedora 14)
you can test them via

# cat /dev/input/event9 | hexdump
If you scan codes, the hexdump of the keycodes is shown.

I scanned all the required bar-codes to make Metrologic MS1690 work as USB HID Keyboard, it is being detected and driver usbhid attached to it, but I am not able to see any output on console. The output is fine when it is configured in serial mode. However, hexdump shows keycodes. I attached another standard USB Dell keyboard and it is working fine.

[98498.945783] input: Honeywell Scanning and Mobility Honeywell
Scanning and Mobility Scanner as
/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input20
[98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID

v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and Mobility Scanner] on usb-0000:00:1d.1-2/input0

[root at pe1800xs input]# cat /proc/bus/usb/devices
T: ?Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
D: ?Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= ?1
P: ?Vendor=0c2e ProdID=0200 Rev=58.88
S: ?Manufacturer=Honeywell Scanning and Mobility
S: ?Product=Honeywell Scanning and Mobility Scanner
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ?) Sub=01 Prot=01 Driver=usbhid
E: ?Ad=81(I) Atr=03(Int.) MxPS= ? 8 Ivl=10ms

[root at pe1800xs ~]# ll /dev/input/by-id/ total 0
lrwxrwxrwx 1 root root 9 Feb 29 15:46 usb-Dell_Dell_QuietKey_Keyboard-event-kbd -> ?../event2 lrwxrwxrwx 1 root root 9 Feb 29 17:17 usb-Dell_Dell_USB_Entry_Keyboard-event-kbd -> ?../event5 lrwxrwxrwx 1 root root 9 Mar ?1 19:10

usb-Honeywell_Scanning_and_Mobility_Honeywell_Scanning_and_Mobility_Scanner-event-kbd -> ?../event6

[root at pe1800xs input]# cat event6 | hexdump
0000000 8be0 4f50 ef90 0009 0004 0004 0027 0007
0000010 8be0 4f50 ef97 0009 0001 000b 0001 0000
0000020 8be0 4f50 ef98 0009 0000 0000 0000 0000
0000030 8be0 4f50 0ecf 000a 0004 0004 0027 0007
0000040 8be0 4f50 0ed4 000a 0001 000b 0000 0000
0000050 8be0 4f50 0ed5 000a 0000 0000 0000 0000
*** snip ***

Quoted 8 lines
Quoted 2 lines

I am getting hexdump after scanning bar-codes, but why it is not coming on console as it should like a standard keyboard.

If you get the hexdump, your scanner is configured and working correctly. There must be a problem with your console or your X-configuration.

Thanks Stefan, you are right that if I get hexdump then the scanner is working properly. This test was failing before because I was trying to get barcodes over Putty terminal emulation which is basically a SSH session and will not display the keyboard inputs from the host machine. When I checked on the host machine, it?s working properly.

Thanks a tonne !!!
Manavendra Nath Manav

#8 lore raw
In reply to a message not in the archive
Quoted 2 lines · On Mon, Mar 05, 2012 at 03:24:17PM +0400, tamerlan311 wrote:

This kernel module was completely stable.
But i think that i should do some clean up code before upstream it.

There's no need to do that now, you can always send follow-on patches doing that.

Quoted 3 lines

Was planned for future developments:
implement write to device support. (I do not know why, but this feature was implemented in original source)

How can a barcode scanner be written to?

Quoted 3 lines

implement work in UNI-Directional mode (0c2e:0710)

I am busy working, but I'll try to finish in few week.

How about I take what you have now, that ensures we make the 3.4 kernel release deadline, and then you send follow-on patches for the other things as you work on them? That way people can use the driver now, which is what they want to do :)

thanks,

greg k-h

#10 lore raw
In reply to a message not in the archive
Quoted 29 lines · On Tue, Mar 06, 2012 at 11:30:33AM +0400, tamerlan311 wrote:

2012/3/6 Greg KH <[email protected]>

On Mon, Mar 05, 2012 at 03:24:17PM +0400, tamerlan311 wrote:
> This kernel module was completely stable.
> But i think that i should do some clean up code before upstream it.

There's no need to do that now, you can always send follow-on patches doing that.

Ok.
?

Quoted 2 lines

Was planned for future developments:
implement write to device support. (I do not know why, but this feature

was
> implemented in original source)

How can a barcode scanner be written to?

Official service software can configure scanner via Bi-Directional port mode. Instead of special barcode for config.

Quoted 3 lines

implement work in UNI-Directional mode (0c2e:0710)

I am busy working, but I'll try to finish in few week.

Quoted 8 lines

How about I take what you have now, that ensures we make the 3.4 kernel release deadline, and then you send follow-on patches for the other things as you work on them? ?That way people can use the driver now, which is what they want to do :)

I do not mind, it's a great idea!
still need some kind of reaction from me at now?

No, I can take the code as-is and create a patch and add it to the tree if you don't want to do that. I'll try to do it by the end of this week and I'll cc: you on the patch.

thanks,

greg k-h