USB mouse not working in 2.12? Here's a solution

Using applications, configuring, problems
Message
Author
User avatar
pakt
Posts: 1157
Joined: Sat 04 Jun 2005, 16:54
Location: Sweden

USB mouse not working in 2.12? Here's a solution

#1 Post by pakt »

There are occasional reports of USB 'mice' not working in Puppy 2.12. Most of the time this is due to the unreliable USB mouse detection code in /etc/rc.d/rc.local0.

Here is line 191 in rc.local0 that looks for a USB mouse:
[ ! "`cat /proc/bus/usb/devices 2>/dev/null | grep -i --extended-regexp "mouse|trackball|netscroll|bt mini\-receiver"`" = "" ] && USBMOUSEDEV="input/mice"
This search relies on the various vendor and product strings that start with the 'S: line'.

From http://www.linux-usb.org/USB-guide/c607.html,
The lines that start with S:, if any, are the vendor and product strings that the device returned.
Note the "if any" in the above quote.

Also the 'S:' lines don't neccessarily contain the search words in the script. Here is one example that was posted on the forum
T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=046d ProdID=c502 Rev=11.40
S: Manufacturer=Logitech
S: Product=USB Receiver
C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr= 50mA
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
I: If#= 1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid
E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=10ms
This mouse is not detected because the string is "USB Receiver".

A more reliable method of detecting USB mice is to search for 'Cls=03(HID ) Sub=01 Prot=02' as in the example above.

I've done quite a bit of checking on the net and this 'InterfaceClass, InterfaceSubClass and InterfaceProtocol' appears to be reserved for USB mice.

(Note that, in the same way, 'Cls=03(HID ) Sub=01 Prot=01' appears to be reserved for USB keyboards.)


If you are experiencing USB mouse problems with Puppy 2.12, please try the modified rc.local0.

EDIT3: There was a request that USB keyboard detection also be modified in the same way - to look for string 'Cls=03(HID ) Sub=01 Prot=01'.
This has been added as an attachment below.

EDIT2: I have updated the attached file - it also had the single space instead of the required two spaces :roll:
Apologies to Kal and others who downloaded the file :oops:

EDIT: The forum has changed the spacing in the line, so I've provided the modified rc.local0 below.
Just backup your old /etc/rc.d/rc.local0 to /etc/rc.d/rc.local0_org, unpack the attached file and copy it to /etc/rc.d/
Save the changed file to pup_save.3fs by rebooting. When rebooting is done, check if your USB mouse works.

Please report your successes/failures in this thread.

Paul
Attachments
rc.local0.gz
Modified /etc/rc.d/rc.local0 [MOUSE & KEYBOARD] - unpack with gunzip
(5.75 KiB) Downloaded 1587 times
rc.local0.gz
Modified /etc/rc.d/rc.local0 [MOUSE ONLY] - unpack with gunzip
(5.69 KiB) Downloaded 1658 times
Last edited by pakt on Mon 11 Dec 2006, 19:35, edited 7 times in total.
Methinks Raspberry Pi were ideal for runnin' Puppy Linux

Kal
Posts: 626
Joined: Thu 05 May 2005, 16:59
Location: California, High Desert

Mod rc.local0

#2 Post by Kal »

Tried modifying rc.local0 on a working usb logitech optical mouse and it was inoperational on two reboots. Went to prompt and ran "modprobe usbhid", which brought it back. I put the original rc.local0 back the way it was.
Good Luck, Kal

User avatar
pakt
Posts: 1157
Joined: Sat 04 Jun 2005, 16:54
Location: Sweden

#3 Post by pakt »

Kal, could you run the following command with your USB mouse plugged in and post the results?

# cat /proc/bus/usb/devices
Methinks Raspberry Pi were ideal for runnin' Puppy Linux

Kal
Posts: 626
Joined: Thu 05 May 2005, 16:59
Location: California, High Desert

#4 Post by Kal »

There is results:

T: Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 6
B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.18.1 ehci_hcd
S: Product=EHCI Host Controller
S: SerialNumber=0000:00:02.2
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=256ms

T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 3
B: Alloc= 11/900 us ( 1%), #Int= 1, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.18.1 ohci_hcd
S: Product=OHCI Host Controller
S: SerialNumber=0000:00:02.1
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms

T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=046d ProdID=c03d Rev=20.00
S: Manufacturer=Logitech
S: Product=USB-PS/2 Optical Mouse
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 98mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid
E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=10ms

T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 3
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.18.1 ohci_hcd
S: Product=OHCI Host Controller
S: SerialNumber=0000:00:02.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms

T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=03f0 ProdID=7404 Rev= 1.00
S: Manufacturer=HP
S: Product=Deskjet 3740
S: SerialNumber=TH53P1621Q045Y
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=07(print) Sub=01 Prot=02 Driver=usblp
E: Ad=01(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
#

Kal

User avatar
pakt
Posts: 1157
Joined: Sat 04 Jun 2005, 16:54
Location: Sweden

#5 Post by pakt »

Well the detection string is there:
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=046d ProdID=c03d Rev=20.00
S: Manufacturer=Logitech
S: Product=USB-PS/2 Optical Mouse
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 98mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid
E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=10ms
So I don't know why it didn't work in your case.

You did copy the new line exactly as shown in the first post? Make sure you don't leave "--extended-regexp" in the line or the search will not work.
Methinks Raspberry Pi were ideal for runnin' Puppy Linux

User avatar
pakt
Posts: 1157
Joined: Sat 04 Jun 2005, 16:54
Location: Sweden

#6 Post by pakt »

Here is my own setup. I'm using an external USB mouse and keyboard with my laptop.

It turns out I have an identical mouse to Kal's and my mod to rc.local0 has no problem detecting the Logitech mouse as a USB mouse:
T: Bus=04 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=046d ProdID=c03d Rev=20.00
S: Manufacturer=Logitech
S: Product=USB-PS/2 Optical Mouse
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 98mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid
E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=10ms
Methinks Raspberry Pi were ideal for runnin' Puppy Linux

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#7 Post by zigbert »

After trying your upgrade I still have to "modprobe usbhid" to get usb mouse to work. The ps2 touchpad works ok. (Puppy 2.12)

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#8 Post by rerwin »

I have a Microsoft wireless optical mouse that was only partially detected in 2.12 -- the pointer would not respond, but the wizard indicated a USB mouse (which I discovered by plugging in my ps/2 mouse).

I copied the new line 191, but it did not work until I added a second space character to it, between "HID" and ")". I suspect the forum text formatter squeezed out the second space character.

Now that the mouse works, I see that it behaves erratically. If I click on an item (button, URL link), nothing happens; but if I move the mouse slightly while clicking, the corresponding action occurs. In addition the response is sluggish and the cpu meter shows significant utilization. I have not checked to see if anyone else has reported this behavior.

I am testing this on a 400MHz, 160MB Aptiva

Richard

Kal
Posts: 626
Joined: Thu 05 May 2005, 16:59
Location: California, High Desert

usb

#9 Post by Kal »

The first times did a cut, copy and paste off the site. Tried it again with your rc.local0 and on reboot the same dead mouse again. Noticed that my network was inop even after modprobing the mouse to life. Put original rc.local0 back and all is well.
Kal

User avatar
pakt
Posts: 1157
Joined: Sat 04 Jun 2005, 16:54
Location: Sweden

#10 Post by pakt »

rerwin wrote:I copied the new line 191, but it did not work until I added a second space character to it, between "HID" and ")". I suspect the forum text formatter squeezed out the second space character.
Thanks, rerwin, that's it - there should be two spaces between "HID" and ")".

I have attached a modified rc.local0 for testing to the first post so that problem should be gone now :)
rerwin wrote:Now that the mouse works, I see that it behaves erratically. If I click on an item (button, URL link), nothing happens; but if I move the mouse slightly while clicking, the corresponding action occurs. In addition the response is sluggish and the cpu meter shows significant utilization. I have not checked to see if anyone else has reported this behavior.
Did you have this problem before using the modified rc.local0?
Methinks Raspberry Pi were ideal for runnin' Puppy Linux

User avatar
pakt
Posts: 1157
Joined: Sat 04 Jun 2005, 16:54
Location: Sweden

Re: usb

#11 Post by pakt »

Kal wrote:Tried it again with your rc.local0 and on reboot the same dead mouse again.
Yes, I was a little too fast there - the attached rc.local0 file had the 'missing space character' problem. That happened because I didn't have my correct test file handy and instead made a new modified file using the incorrect line from the forum :oops:

I've updated the file and tested it to make sure it works.

If you are up to it, please give it one more try :wink:

Paul
Last edited by pakt on Sat 09 Dec 2006, 21:25, edited 1 time in total.
Methinks Raspberry Pi were ideal for runnin' Puppy Linux

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#12 Post by zigbert »

Yepp... This is great....just works

Takk!

Kal
Posts: 626
Joined: Thu 05 May 2005, 16:59
Location: California, High Desert

usb mouse

#13 Post by Kal »

Note, tried it again on other machine here with VIA chip set, using my mouse and no problem. Frugal install and all the same except for it's a Nvidia nforce2 chip set, on my computer it's a NO GO .
Good Luck, Kal

lesliek
Posts: 18
Joined: Thu 09 Nov 2006, 21:41

#14 Post by lesliek »

Paul, you were trying to help me with a USB mouse problem in Puppy v 2.12 some time ago and my last post in that thread left me saying that I'd be buying another USB mouse to use with my MicroClient Jr.

I did that, but I'm afraid the problem's not been resolved by that new USB mouse. When I got back to the problem today, I fortuitously discovered this new thread begun by you.

I understand why you've changed the rc.local0 script to search for "Cls=03(HID ) Sub=01 Prot=02" and, indeed, the new mouse I bought shows that very information when I run "cat /proc/bus/usb/devices". The only problem is that it doesn't show that information when I run that command on my MC Jr with Puppy. The device doesn't even appear in the list of USB devices, nor does it work generally.

On the other hand, that information does appear when I run the command on my MC Jr with Damn Small Linux. (I've put the latter on a bootable USB flash drive, my Puppy being on the CF drive.) Also, the mouse works normally in DSL.

I really have no skill or knowledge in these matters, so I can only approach this very simplistically, but it seems obvious that, at the moment at which the rc.local0 script is run, the OS is not yet aware that it has a mouse hanging off the computer. It must know (or be capable of knowing) that it's got some kind of USB device there, because the mouse is getting power through the USB port (the mouse is lit up from the moment I turn on the computer), but it isn't able to get the necessary information to identify it as a USB mouse.

Can it be that editing some script that runs earlier than rc.local0 could solve my problem?

Thanks again,

Leslie

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#15 Post by zigbert »

:cry: This morning the upgraded script didn't load the usbhid module during bootup. :cry:

User avatar
pakt
Posts: 1157
Joined: Sat 04 Jun 2005, 16:54
Location: Sweden

#16 Post by pakt »

lesliek wrote:I understand why you've changed the rc.local0 script to search for "Cls=03(HID ) Sub=01 Prot=02" and, indeed, the new mouse I bought shows that very information when I run "cat /proc/bus/usb/devices". The only problem is that it doesn't show that information when I run that command on my MC Jr with Puppy. The device doesn't even appear in the list of USB devices, nor does it work generally.

On the other hand, that information does appear when I run the command on my MC Jr with Damn Small Linux. (I've put the latter on a bootable USB flash drive, my Puppy being on the CF drive.) Also, the mouse works normally in DSL.
Leslie, I understand what you're saying about your new mouse not appearing in the output of 'cat /proc/bus/usb/devices' on your MCjr - I also have such a mouse (a Labtec Optical Mouse). That it does appear when you run DSL on the MCjr tells me that there is a USB bug in the 2.6.18.1 kernel. I'm quite certain DSL is using a different kernel (type 'uname -a' in a terminal to find out).
lesliek wrote:I really have no skill or knowledge in these matters, so I can only approach this very simplistically, but it seems obvious that, at the moment at which the rc.local0 script is run, the OS is not yet aware that it has a mouse hanging off the computer. It must know (or be capable of knowing) that it's got some kind of USB device there, because the mouse is getting power through the USB port (the mouse is lit up from the moment I turn on the computer), but it isn't able to get the necessary information to identify it as a USB mouse.
Yes, I believe you are right in your analysis that the OS is not aware of the connected mouse, but it would get power anyway as soon as it is connected - there is always 5V out from the USB connector when the PC is turned on. It's just the OS software that's not working correctly.

Unfortuately, if '/proc/bus/usb/devices' doesn't show the mouse (and it doesn't appear in 'dmesg' either) then AFAIK there is nothing you can do to have Puppy 2.12 automatically find it. The mouse is, for all practical purposes, invisible to Puppy :(

I haven't tried it yet, but it might be interesting to see if Puppy 2.11 'sees' the mouse on you MCjr - it uses an earlier kernel.
Methinks Raspberry Pi were ideal for runnin' Puppy Linux

User avatar
pakt
Posts: 1157
Joined: Sat 04 Jun 2005, 16:54
Location: Sweden

#17 Post by pakt »

zigbert wrote::cry: This morning the upgraded script didn't load the usbhid module during bootup. :cry:
zigbert, please check /etc/rc.d/rc.local0 and see if your modification survived re-booting in case the file was not saved to pup_save.3fs.

Also check that you have two spaces between "HID" and ")" on the new line.
Methinks Raspberry Pi were ideal for runnin' Puppy Linux

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#18 Post by rerwin »

Re weird wireless USB mouse behavior:
Did you have this problem before using the modified rc.local0?
This was the first time I tried my USB mouse with Puppy (or any other linux). It works very snappily on another PC, 450MHz, 256MB, WinXP.

I just now tried it on an Xubuntu PC, 466MHz x 2, 256MB where it is also very snappy and behaves as one expects.

UPDATE: I just tried the mouse with Puppy on those other 2 PCs and it worked normally on both, with and without your fix! The Aptiva must just have a primitive implementation of USB support. So it appears that some old PCs may not fully handle a USB mouse, but Puppy is OK. And I must have been mistaken when I thought the mouse didn't work in the Aptiva without the fix - the old local0 detects "Mouse" in the product line.

Richard
Last edited by rerwin on Sun 10 Dec 2006, 23:34, edited 1 time in total.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#19 Post by zigbert »

pakt wrote:zigbert, please check /etc/rc.d/rc.local0 and see if your modification survived re-booting in case the file was not saved to pup_save.3fs.

Also check that you have two spaces between "HID" and ")" on the new line.
Everything in my /etc/rc.d/rc.local0 seems ok (upgraded).

Like before my usb-mouse is sometimes detected, sometimes not, so I put "modprobe usbhid" in /etc/rc.d/rc.local. One thing seems to be better with your patch. Before, I had to replug my usb-mouse if it was not detected during boot. That issue is gone.

Kal
Posts: 626
Joined: Thu 05 May 2005, 16:59
Location: California, High Desert

#20 Post by Kal »

Feedback: We have just tried your latest download on both machines and they both work. We had an anxious moment until we played with the permissions, then it worked correctly.
Good Luck, Kal, Duke

PS: We were using Konqueror on one of the machines and did not see the permissions until we went to rox.

Post Reply