Skip to contentSkip to conversation

Simple Newbie question

DISCUSSION Steve Castellotti 3 participants 6 messages May 4, 2005 – May 6, 2005

lore
Share & tools
lore
#0 lore raw

hey all-

I recently came across a USB touchscreen I'm trying to get to work
under linux. If I plug it in under windows it registers as an HID- compliant device, and starts working with no additional drivers, so I don't believe this should be very difficult. (I'm running Fedora Core 3 with linux kernel2.6.10-1.770_14.rhfc3.at incidentally)

By diffing changes to /proc/bus/usb/devices, I've gotten a the info:

P: Vendor00 ProdIDÿff Rev= 1.00

which I've confirmed is the correct device.

I've then edited /etc/hotplug/usb.usermap and added the following lines:

usbhid 0x0000 0x0000 0xffff 0x0000 0x0000
0x00 0x00 0x00 0x00 0x00
0x00 0x00000000
keybdev 0x0000 0x0000 0xffff 0x0000 0x0000
0x00 0x00 0x00 0x00 0x00
0x00 0x00000000
mousedev 0x0000 0x0000 0xffff 0x0000 0x0000
0x00 0x00 0x00 0x00 0x00
0x00 0x00000000

(The device appears three times in /var/log/messages, as a "USB HID
v1.00 Mouse" a "USB HID v1.00 Device" and a "USB HID v1.00 Keyboard" but of course I'm only interested in the mouse functionality)

Diffing the changes to /sys/bus/usb/drivers/usbhid, the device is
appearing on 2-1, so I've created a rules file in /etc/udev/rules.d:

BUS="usb", PLACE="2-1", NAME="input/mouse0"

The device seems to be recognized as a usbhid device even without
the hotplug or udev changes, but gpm fails to recognize it. Even after the changes, while /dev/input/mouse0 will appear correctly, gpm still will not recognize the mouse.

Can anyone please point me in the right direction? Am I missing
something obvious here?

Cheers!

Steve Castellotti

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 38 lines · Steve Castellotti

hey all-

I recently came across a USB touchscreen I'm trying to get to work
under linux. If I plug it in under windows it registers as an HID- compliant device, and starts working with no additional drivers, so I don't believe this should be very difficult. (I'm running Fedora Core 3 with linux kernel2.6.10-1.770_14.rhfc3.at incidentally)

By diffing changes to /proc/bus/usb/devices, I've gotten a the info:

P: Vendor00 ProdIDÿff Rev= 1.00

which I've confirmed is the correct device.

I've then edited /etc/hotplug/usb.usermap and added the following lines:

usbhid 0x0000 0x0000 0xffff 0x0000 0x0000
0x00 0x00 0x00 0x00 0x00
0x00 0x00000000
keybdev 0x0000 0x0000 0xffff 0x0000 0x0000
0x00 0x00 0x00 0x00 0x00
0x00 0x00000000
mousedev 0x0000 0x0000 0xffff 0x0000 0x0000
0x00 0x00 0x00 0x00 0x00
0x00 0x00000000

(The device appears three times in /var/log/messages, as a "USB HID
v1.00 Mouse" a "USB HID v1.00 Device" and a "USB HID v1.00 Keyboard" but of course I'm only interested in the mouse functionality)

Diffing the changes to /sys/bus/usb/drivers/usbhid, the device is
appearing on 2-1, so I've created a rules file in /etc/udev/rules.d:

Quoted 8 lines

BUS="usb", PLACE="2-1", NAME="input/mouse0"

The device seems to be recognized as a usbhid device even without
the hotplug or udev changes, but gpm fails to recognize it. Even after the changes, while /dev/input/mouse0 will appear correctly, gpm still will not recognize the mouse.

You should not need any hotplug or udev changes.

But you should point gpm to use the new /dev/input/mouse0 or the /dev/input/mice device node. Good luck with that.

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Steve Castellotti

Thanks .. but the device doesn't create the /dev/input/mouse0 (or
any other device entry) unless I manually create that udev rule file. That being said, when I do use the udev rule file, stopping the gpm daemon via init.d script and than calling gpm via:

# gpm -m /dev/input/mouse0 -t ps2

doesn't seem have any effect. I've tried with /dev/input/mice and
with types "imps2" "pnp" and "ms" as well to no effect.

Might I have to somehow modify the usb mouse driver module to recognize
this device? Is there a table that I simply need to make an entry into?

Again, thanks

Steve Castellotti

Quoted 13 lines · Greg KH
Quoted 4 lines

The device seems to be recognized as a usbhid device even without
the hotplug or udev changes, but gpm fails to recognize it. Even after the changes, while /dev/input/mouse0 will appear correctly, gpm still will not recognize the mouse.

You should not need any hotplug or udev changes.

But you should point gpm to use the new /dev/input/mouse0 or the /dev/input/mice device node. Good luck with that.

greg k-h

Quoted 9 lines

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

Steve Castellotti
Technical Director
Eye Magnet - New Zealand

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Steve Castellotti

On Thu, May 05, 2005 at 12:49:12PM +1200, Steve Castellotti was heard to remark:

Quoted 8 lines

Thanks .. but the device doesn't create the /dev/input/mouse0 (or
any other device entry) unless I manually create that udev rule file. That being said, when I do use the udev rule file, stopping the gpm daemon via init.d script and than calling gpm via:

# gpm -m /dev/input/mouse0 -t ps2
Quoted 7 lines

doesn't seem have any effect. I've tried with /dev/input/mice and
with types "imps2" "pnp" and "ms" as well to no effect.

Might I have to somehow modify the usb mouse driver module to recognize
this device? Is there a table that I simply need to make an entry into?

I think there's a way of getting gpm to report any raw input it recieves ... is it receiving any input at all?

--linas

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Steve Castellotti

Well, I'm learning anyway.

If I remove all of my modifications to udev and hotplug, and just
plug the device in as normal, four devices are created when I plug in the device:

Mouse:
/dev/input/event2
/dev/input/js0

Keyboard:
/dev/usbhid0
/dev/input/event3

Three device entries are created under /sys/bus/usb/devices, one for
the Mouse, one for "Comms" and one for "Keyboard"

Comparing to when I plug in a USB microsoft intellimouse, I get two
devices:

/dev/input/mouse0
/dev/input/event4

Now if I try:

#gpm -D -m /dev/input/event4 -Rraw (the "event" device created for
the microsoft mouse)

I get:

[root@eyemagnet hotplug]# gpm -D -m /dev/input/event4 -Rraw *** info [startup.c(95)]: Started gpm successfully. Entered daemon mode. *** debug [console.c(125)]: Screen size: 80 - 25
*** debug [gpm.c(159)]: x 10, y 20

...which stays like that until I move the mouse. Once I move the mouse
I endlessly get:

*** err [gpm.c(89)]: Error in read()ing first: No such file or directory *** debug [gpm.c(533)]: selected 1 times

...to standard out.

The *identical* thing happens if I do:

# gpm -D -m /dev/input/event2 -Rraw (the "event" device created by the
touchscreen)

...with the looping error messages not appearing until I touch the
screen somewhere. So there's definitely a form of interaction going on. It seems that Linux is creating a "/dev/input/js0" (joystick) device for the "mouse" portion of the touchscreen, instead of
creating /dev/input/mouse0 like it knows to do with the Intellimouse.

Surely I'm getting close and its a matter of telling hotplug's
input.agent (or similar) to recognize the screen as a mouse instead of a joystick?

Is the correct file to modify:

/lib/modules/<kernel version>/modules.inputmap

(?)

and if so is there a reference for how to determine the correct values?

Thanks heaps for all the help everyone!

Steve Castellotti

Quoted 7 lines · Linas Vepstas
Quoted 7 lines
# gpm -m /dev/input/mouse0 -t ps2

doesn't seem have any effect. I've tried with /dev/input/mice and
with types "imps2" "pnp" and "ms" as well to no effect.

Quoted 7 lines
Quoted 2 lines

Might I have to somehow modify the usb mouse driver module to recognize
this device? Is there a table that I simply need to make an entry into?

I think there's a way of getting gpm to report any raw input it recieves ... is it receiving any input at all?

--linas

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw
In reply to Steve Castellotti

Well, I'm learning anyway.

If I remove all of my modifications to udev and hotplug, and just
plug the device in as normal, four devices are created when I plug in the device:

Mouse:
/dev/input/event2
/dev/input/js0

Keyboard:
/dev/usbhid0
/dev/input/event3

Three device entries are created under /sys/bus/usb/devices, one for
the Mouse, one for "Comms" and one for "Keyboard"

Comparing to when I plug in a USB microsoft intellimouse, I get two
devices:

/dev/input/mouse0
/dev/input/event4

Now if I try:

#gpm -D -m /dev/input/event4 -Rraw (the "event" device created for
the microsoft mouse)

I get:

[root@eyemagnet hotplug]# gpm -D -m /dev/input/event4 -Rraw *** info [startup.c(95)]: Started gpm successfully. Entered daemon mode. *** debug [console.c(125)]: Screen size: 80 - 25
*** debug [gpm.c(159)]: x 10, y 20

...which stays like that until I move the mouse. Once I move the mouse
I endlessly get:

*** err [gpm.c(89)]: Error in read()ing first: No such file or directory *** debug [gpm.c(533)]: selected 1 times

...to standard out.

The *identical* thing happens if I do:

# gpm -D -m /dev/input/event2 -Rraw (the "event" device created by the
touchscreen)

...with the looping error messages not appearing until I touch the
screen somewhere. So there's definitely a form of interaction going on. It seems that Linux is creating a "/dev/input/js0" (joystick) device for the "mouse" portion of the touchscreen, instead of
creating /dev/input/mouse0 like it knows to do with the Intellimouse.

Surely I'm getting close and its a matter of telling hotplug's
input.agent (or similar) to recognize the screen as a mouse instead of a joystick?

Is the correct file to modify:

/lib/modules/<kernel version>/modules.inputmap

(?)

and if so is there a reference for how to determine the correct values?

Thanks heaps for all the help everyone!

Steve Castellotti

Quoted 7 lines · Linas Vepstas
Quoted 7 lines
# gpm -m /dev/input/mouse0 -t ps2

doesn't seem have any effect. I've tried with /dev/input/mice and
with types "imps2" "pnp" and "ms" as well to no effect.

Quoted 7 lines
Quoted 2 lines

Might I have to somehow modify the usb mouse driver module to recognize
this device? Is there a table that I simply need to make an entry into?

I think there's a way of getting gpm to report any raw input it recieves ... is it receiving any input at all?

--linas

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel