# USB mouse works only if plugged in at boot

## tofor

If I have my usb optical mouse plugged in during boot, it is properly recognized, and works fine.  However, if I plug it in after boot, it does not work and the light does not come on.  I also get the following message repeatedly in dmesg:

hub 2-0:1.0: Cannot enable port 2.  Maybe the USB cable is bad?

This is a Microsoft Basic Optical Mouse.

I know the port works, because like I said, it works if I boot with the mouse plugged in, and I tested with an external hd which also worked.

Is there a trick for making it recognize it after boot?

----------

## dafi

I have Logitech mouse. Try:

```
lsusb
```

 *Quote:*   

> 
> 
> Bus 003 Device 001: ID 0000:0000  
> 
> Bus 002 Device 002: ID 046d:c510 Logitech, Inc. 
> ...

 

Also if the system recognized the mouse try

```
cat /dev/input/mice
```

 and move your mouse. Lots of characters should be seen in your console. 

Tip2. Maybe you should recompile the kernel sources, with USB support, but not as a module ?? Or try 

```
modprobe usbhid
```

----------

## tofor

Thanks very much for your tips.  Unfortunately, they all fail:

 *Quote:*   

> lsusb

 

gave "command not found" (yes, I tried running it as root).  Is that part of usbutils?  This is not installed. 

 *Quote:*   

> cat /dev/input/mice

 

Naturally, since the light doesn't come on, there is not input.

 *Quote:*   

> 
> 
> recompile the kernel sources, with USB support, but not as a module ?? Or try
> 
> Code:
> ...

 

I suspect my usb support is not modularized, since if I try to modprobe usbhid it says the module is not found.  However, there are many usb kernel options, and as a relative noob I am not certain which should be selected.  HID input layer support is compiled as part of the kernel.  I suspect this might be the critical option.

----------

## dafi

 *Quote:*   

> Is that part of usbutils? This is not installed. 

 

Try to install ubsutils. 

Also in kernel sources --> Device Drivers --> USB Support --> USB Human Interface Device (full HID) support. You should enable this option. If you compile this driver as a module, then it will be called usbhid  .

----------

## tofor

I installed usbutils.  Now lsusb gives the following output:

Bus 002 Device 001: ID 0000:0000  

Bus 003 Device 001: ID 0000:0000  

Bus 001 Device 001: ID 0000:0000  

The HID kernel option you specify is already selected, not as a module, but as part of the kernel.

There is no reason I should have to reboot after installing usbutils, is there?

----------

## dafi

 *Quote:*   

> There is no reason I should have to reboot after installing usbutils, is there?

 

No.

Really I am out of ideas.  I'm not Linux mastermind  :Smile: 

Did you try another Linux kernel ??

----------

## LiquidAcid

Can you post the USB part of your kernel config?

----------

## tofor

<*> Support for Host-side USB                                    x x  

  x x    [ ]   USB verbose debug messages                                 x x  

  x x    ---   Miscellaneous USB options                                  x x  

  x x    [*]   USB device filesystem                                      x x  

  x x    [ ]   Enforce USB bandwidth allocation (EXPERIMENTAL)            x x  

  x x    [ ]   Dynamic USB minor allocation (EXPERIMENTAL)                x x  

  x x    [ ]   USB selective suspend/resume and wakeup (EXPERIMENTAL)     x x  

  x x    ---   USB Host Controller Drivers                                x x  

  x x    <*>   EHCI HCD (USB 2.0) support                                 x x  

  x x    [ ]     Full speed ISO transactions (EXPERIMENTAL)               x x  

  x x    [ ]     Root Hub Transaction Translators (EXPERIMENTAL)          x x  

  x x    [ ]     Improved Transaction Translator scheduling (EXPERIMENTAL)x x  

  x x    < >   ISP116X HCD support                                        x x  

  x x    <*>   OHCI HCD support                                           x x  

  x x    <*>   UHCI HCD (most Intel and VIA) support                      x x  

  x x    < >   SL811HS HCD support                                        x x  

  x x    ---   USB Device Class drivers                                   x x  

  x x    < >   USB Modem (CDC ACM) support                                x x  

  x x    <*>   USB Printer support                                        x x  

  x x    --- NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'      x x  

  x x    --- may also be needed; see USB_STORAGE Help for more informationx x  

  x x    <*> USB Mass Storage support                                     x x  

  x x    [ ]   USB Mass Storage verbose debug                             x x  

  x x    [ ]   Datafab Compact Flash Reader support (EXPERIMENTAL)        x x  

  x x    [ ]   Freecom USB/ATAPI Bridge support                           x x  

  x x    [ ]   ISD-200 USB/ATA Bridge support                             x x  

  x x    [ ]   Microtech/ZiO! CompactFlash/SmartMedia support             x x  

  x x    [ ]   USBAT/USBAT02-based storage support (EXPERIMENTAL)         x x  

  x x    [ ]   SanDisk SDDR-09 (and other SmartMedia) support (EXPERIMENTAx x  

  x x    [ ]   SanDisk SDDR-55 SmartMedia support (EXPERIMENTAL)          x x  

  x x    [ ]   Lexar Jumpshot Compact Flash Reader (EXPERIMENTAL)         x x  

  x x    [ ]   Olympus MAUSB-10/Fuji DPC-R1 support (EXPERIMENTAL)        x x  

  x x    [ ]   Support for Rio Karma music player                         x x  

  x x    [ ] The shared table of common (or usual) storage devices        x x  

  x x    --- USB Input Devices                                            x x  

  x x    <*> USB Human Interface Device (full HID) support                x x  

  x x    [*]   HID input layer support                                    x x  

  x x    [ ]     Enable support for iBook/PowerBook special keys          x x  

  x x    [ ]     Force feedback support (EXPERIMENTAL)                    x x  

  x x    [ ]   /dev/hiddev raw HID device support      

 < > Aiptek 6000U/8000U tablet support                            x x  

  x x    < > Wacom Intuos/Graphire tablet support                         x x  

  x x    < > Acecad Flair tablet support                                  x x  

  x x    < > KB Gear JamStudio tablet support                             x x  

  x x    < > Griffin PowerMate and Contour Jog support                    x x  

  x x    < > USB Touchscreen Driver                                       x x  

  x x    < > Yealink usb-p1k voip phone                                   x x  

  x x    < > X-Box gamepad support                                        x x  

  x x    < > ATI / X10 USB RF remote control                              x x  

  x x    < > ATI / Philips USB RF remote control                          x x  

  x x    < > Keyspan DMR USB remote control (EXPERIMENTAL)                x x  

  x x    < > Apple USB Touchpad support                                   x x  

  x x    --- USB Imaging devices                                          x x  

  x x    < > USB Mustek MDC800 Digital Camera support (EXPERIMENTAL)      x x  

  x x    < > Microtek X6USB scanner support                               x x  

  x x        USB Network Adapters  --->                                   x x  

  x x    [*] USB Monitor                                                  x x  

  x x    --- USB port drivers                                             x x  

  x x        USB Serial Converter support  --->                           x x  

  x x    --- USB Miscellaneous drivers                                    x x  

  x x    < > EMI 6|2m USB Audio interface support                         x x  

  x x    < > EMI 2|6 USB Audio interface support                          x x  

  x x    < > ADU devices from Ontrak Control Systems (EXPERIMENTAL)       x x  

  x x    < > USB Auerswald ISDN support (EXPERIMENTAL)                    x x  

  x x    < > USB Diamond Rio500 support (EXPERIMENTAL)                    x x  

  x x    < > USB Lego Infrared Tower support (EXPERIMENTAL)               x x  

  x x    < > USB LCD driver support                                       x x  

  x x    < > USB LED driver support                                       x x  

  x x    < > Cypress CY7C63xxx USB driver support                         x x  

  x x    < > Cypress USB thermometer driver support                       x x  

  x x    < > USB Phidgets drivers                                         x x  

  x x    < > Siemens ID USB Mouse Fingerprint sensor support              x x  

  x x    < > Elan PCMCIA CardBus Adapter USB Client                       x x  

  x x    < > Apple Cinema Display support                                 x x  

  x x    < > USB 2.0 SVGA dongle support (Net2280/SiS315)                 x x  

  x x    < > USB LD driver                                                x x  

  x x    < > PlayStation 2 Trance Vibrator driver support                 x x  

  x x    < > USB testing driver (DEVELOPMENT)                             x x  

  x x        USB DSL modem support  --->                                  x x  

  x x        USB Gadget Support  --->

----------

## tofor

Thanks dafi, for trying  :Smile: 

----------

## LiquidAcid

You should enable USB debug support and modularize the EHCI, OHCI and UHCI. Then reboot the system and check that no xHCI is loaded. Plug in your mouse and load UHCI (or OHCI, but I doubt that you chip is a OHCI-one). Check if this works. EHCI is only used for USB 2.0, so you mouse should work without this.

----------

## Cyker

Maybe udev or hotplug isn't working properly?

----------

## lyallp

udev: Try running 

```
udevcontrol log_priority=info
```

 then monitor your system messages file using 

```
tail -f /var/log/messages
```

 then plug/unplug your USB device(s). You should see quite a bit of info...

Hopefully, this may give some insight.

----------

## tofor

 *Quote:*   

> Maybe udev or hotplug isn't working properly?

 

I really think this is likely.  I get message during boot similar to:

udevd [4334] launch program '/sbin/something/something/udevd' failed

udevd [4334] launch program '/sbin/something/something/hotplug' failed

I didn't realize it was related or would have mentioned it earlier.  Where can I find these boot messages so I can copy the exact messages?

 *Quote:*   

> udev: Try running
> 
> Code:
> 
> udevcontrol log_priority=info
> ...

 

udevcontrol: no output

tail:

<a bunch of unrelated stuff>

Aug  1 09:34:59 localhost sudo:      <my username>: TTY=pts/1 ; PWD=/home/<my username>; USER=root ; COMMAND=/sbin/udevcontrol log_priority=info

and that's it .  No more output upon plugging/unplugging a mouse.

Thanks again for your help.

----------

## lyallp

```

/var/log/messages 

```

is the file that is your gospel for system messages and errors.

I did not expect udevcontrol to generate any output.

I did, however, expect to see at least something appear in /var/log/messages when you plugged in your mouse.

If you left the tail running for a while, you should see cron messages (hourly)

----------

## tofor

 *Quote:*   

> I did, however, expect to see at least something appear in /var/log/messages when you plugged in your mouse.

 

Absolutely nothing.  What I did, if this makes a difference, is plug in a second mouse.  I don't really want to reboot my system at the moment to get my first mouse to work again.  This second was a Logitech optical mouse.  It behaved differently than the Microsoft mouse in that the detector light flashes after it's plugged in, rather than being off completely.

 *Quote:*   

> If you left the tail running for a while, you should see cron messages (hourly)

 

```
cat /var/log/messages|grep cron
```

only gives 2 results, both several days ago.

----------

## lyallp

Any other USB devices you can plug in, just to see what happens?

Different USB port?

----------

