# USB Mouse not working



## Jorg (Jan 22, 2018)

Hi,

Fresh install FreeBSD 11.1 (Guided ZFS Stripe MBR Bios),
usb wired mouse is not working.

There isn't any /dev/ums* device.

USB Dump:

```
usbconfig -u 4 -a 2 dump_info
ugen4.2: <vendor 0x275d USB OPTICAL MOUSE> at usbus4, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)

usbconfig -u 4 -a 2 dump_curr_config_desc
ugen4.2: <vendor 0x275d USB OPTICAL MOUSE> at usbus4, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)


 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0022
    bNumInterfaces = 0x0001
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x00a0
    bMaxPower = 0x0032

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0003  <HID device>
      bInterfaceSubClass = 0x0001
      bInterfaceProtocol = 0x0002
      iInterface = 0x0000  <no string>

      Additional Descriptor

      bLength = 0x09
      bDescriptorType = 0x21
      bDescriptorSubType = 0x11
       RAW dump:
       0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x40,
       0x08 | 0x00

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0005
        bInterval = 0x000a
        bRefresh = 0x0000
        bSynchAddress = 0x0000
```

/var/log/message

```
Jan 22 13:08:25 skalar kernel: Rebooting...
Jan 22 13:08:25 skalar kernel: cpu_reset: Stopping other CPUs
Jan 22 13:08:25 skalar kernel: Copyright (c) 1992-2017 The FreeBSD Project.
Jan 22 13:08:25 skalar kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
Jan 22 13:08:25 skalar kernel: The Regents of the University of California. All rights reserved.
Jan 22 13:08:25 skalar kernel: FreeBSD is a registered trademark of The FreeBSD Foundation.
Jan 22 13:08:25 skalar kernel: FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017
Jan 22 13:08:25 skalar kernel: root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
Jan 22 13:08:25 skalar kernel: FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
...
Jan 22 13:08:25 skalar kernel: uhub4: 2 ports with 2 removable, self powered
Jan 22 13:08:25 skalar kernel: uhub0: 2 ports with 2 removable, self powered
Jan 22 13:08:25 skalar kernel: uhub6: 2 ports with 2 removable, self powered
Jan 22 13:08:25 skalar kernel: uhub1: 2 ports with 2 removable, self powered
Jan 22 13:08:25 skalar kernel: Trying to mount root from zfs:zroot/ROOT/default []...
Jan 22 13:08:25 skalar kernel: uhub5: 2 ports with 2 removable, self powered
Jan 22 13:08:25 skalar kernel: uhub3: 2 ports with 2 removable, self powered
Jan 22 13:08:25 skalar kernel: Root mount waiting for: usbus7 usbus3
Jan 22 13:08:25 skalar kernel: Root mount waiting for: usbus7 usbus3
Jan 22 13:08:25 skalar kernel: uhub2: 6 ports with 6 removable, self powered
Jan 22 13:08:25 skalar kernel: uhub7: 6 ports with 6 removable, self powered
Jan 22 13:08:25 skalar kernel: Root mount waiting for: usbus7 usbus3
Jan 22 13:08:25 skalar kernel: ugen4.2: <vendor 0x275d USB OPTICAL MOUSE> at usbus4
Jan 22 13:08:25 skalar kernel: ugen0.2: <Microsoft Wired Keyboard 600> at usbus0
Jan 22 13:08:25 skalar kernel: ukbd0 on uhub6
Jan 22 13:08:25 skalar kernel: ukbd0: <Microsoft Wired Keyboard 600, class 0/0, rev 2.00/3.00, addr 2> on usbus0
Jan 22 13:08:25 skalar kernel: kbd2 at ukbd0
Jan 22 13:08:25 skalar kernel: re0: link state changed to DOWN
Jan 22 13:08:25 skalar kernel: re0: link state changed to UP
Jan 22 13:08:28 skalar dbus[622]: [system] Activating service name='org.freedesktop.ConsoleKit' (using servicehelper)
Jan 22 13:08:28 skalar dbus[622]: [system] Activating service name='org.freedesktop.PolicyKit1' (using servicehelper)
Jan 22 13:08:28 skalar dbus[622]: [system] Successfully activated service 'org.freedesktop.ConsoleKit'
Jan 22 13:08:28 skalar dbus[622]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
```

And /etc/rc.conf


```
sendmail_enable="NONE"
hostname="skalar"
keymap="pl_PL.ISO8859-2.kbd"
ifconfig_re0="DHCP"
sshd_enable="YES"
#moused_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
dbus_enable="YES"
hald_enable="YES"
```

It's strange for me (I'm not advanced user) but I can't find /boot/loader.conf.

Can you help me?


----------



## SirDice (Jan 22, 2018)

If you run `tail -f /var/log/messages` and unplug and re-plug the mouse, what messages do you see?


----------



## iSiek (Jan 22, 2018)

Jorg said:


> Jan 22 13:08:25 skalar kernel: ugen4.2: <vendor 0x275d USB OPTICAL MOUSE> at usbus4


I can see in your /var/log/messages that mouse is discovered but probably not identified as *vendor 0x275d *hex manufacturer code is displayed instead of its name.

additionally in /etc/rc.conf file, you have commented out *moused* deamon. Can you try to uncomment this line?

```
---> #moused_enable="YES"
```
remove leading _# _sign and save changes

```
moused_enable="YES"
```

Regards,
Krzysztof


----------



## SirDice (Jan 22, 2018)

iSiek said:


> additionally in /etc/rc.conf file, you have commented out *moused* deamon. Can you try to uncomment this line?


Enabling it is only required for PS/2 mice, for USB mice it's automatically loaded by devd(8). If it's correctly recognized.


----------



## Jorg (Jan 22, 2018)

SirDice said:


> If you run  tail -f /var/log/messages and unplug and re-plug the mouse, what messages do you see?




```
Jan 22 16:48:59 skalar kernel: ugen4.2: <vendor 0x275d USB OPTICAL MOUSE> at usbus4 (disconnected)
Jan 22 16:49:06 skalar kernel: ugen4.2: <vendor 0x275d USB OPTICAL MOUSE> at usbus4
```


----------



## Jorg (Jan 22, 2018)

I went back to the installer and noticed that mouse did work there. Reinstall.
And again mouse is not working.

I took also wireless keyboard with mousepad - logitech k400 plus - which I was using with FreeBSD 10.x without any problem.

Keyboard is working touchpad not.

`usbconfig -u 4 -a 2 dump_curr_config_desc`  resulted:


```
ugen4.2: <Logitech USB Receiver> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (98mA)


 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0054
    bNumInterfaces = 0x0003
    bConfigurationValue = 0x0001
    iConfiguration = 0x0004  <RQR24.01_B0023>
    bmAttributes = 0x00a0
    bMaxPower = 0x0031

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0003  <HID device>
      bInterfaceSubClass = 0x0001
      bInterfaceProtocol = 0x0001
      iInterface = 0x0000  <no string>

      Additional Descriptor

      bLength = 0x09
      bDescriptorType = 0x21
      bDescriptorSubType = 0x11
       RAW dump:
       0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x3b,
       0x08 | 0x00

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0008
        bInterval = 0x0008
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 1
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0001
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0003  <HID device>
      bInterfaceSubClass = 0x0001
      bInterfaceProtocol = 0x0002
      iInterface = 0x0000  <no string>

      Additional Descriptor

      bLength = 0x09
      bDescriptorType = 0x21
      bDescriptorSubType = 0x11
       RAW dump:
       0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x94,
       0x08 | 0x00

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0082  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0008
        bInterval = 0x0002
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 2
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0002
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0003  <HID device>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

      Additional Descriptor

      bLength = 0x09
      bDescriptorType = 0x21
      bDescriptorSubType = 0x11
       RAW dump:
       0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x62,
       0x08 | 0x00

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0083  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0020
        bInterval = 0x0002
        bRefresh = 0x0000
        bSynchAddress = 0x0000
```

I read USB Device class specification: http://www.usb.org/developers/hidpage/HID1_11.pdf
Description by usbconfig:

```
Inteface # 0 - default // ok
Interface # 1:
      bInterfaceClass = 0x0003  <HID device> // ok
      bInterfaceSubClass = 0x0001 // devices requiring BIOS support
      bInterfaceProtocol = 0x0002 // mouse???
Interface # 2:
      bInterfaceClass = 0x0003  <HID device> //ok
      bInterfaceSubClass = 0x0000 // No subclass
      bInterfaceProtocol = 0x0000 // protocol none???
```
 
However according to specification - protocol Codes:

```
Protocol Code
0 None
1 Keyboard
2 Mouse
3 - 255
Reserved
```

My conclusion is - data presented by usbconfig are not consistent.
It should looks like:

```
Interface # 1:
      bInterfaceClass = 0x0003  <HID device> // ok
      bInterfaceSubClass = 0x0001 // devices requiring BIOS support
      bInterfaceProtocol = 0x0001 // keyboard

Interface # 2:
      bInterfaceClass = 0x0003  <HID device> //ok
      bInterfaceSubClass = 0x0000 // No subclass
      bInterfaceProtocol = 0x0002 // mouse
```

Can someone tell me how to check which interface is connected to /dev/ukbd node?


----------



## Jorg (Jan 23, 2018)

I went back to installer again to check if it my mouse problem was related to zfs installation.

I installed FreeBSD with standard configuration. And mouse is working now.
I connected also wireless keyboard with touchpad and is working too.

`ls /dev/u*` results:

```
...
/dev/uhid0
/dev/uhid1
/dev/ukbd0
/dev/ukbd1
/dev/ums0
/dev/ums1
...
```

So it is something related to zfs installation.
And I did zfs installation to benchmark it and check how it works as desktop.
What shall I do next ? Who should I ask for help?


----------



## SirDice (Jan 23, 2018)

Jorg said:


> So it is something related to zfs installation.


I can assure you that the type of filesystem being used is completely irrelevant.


----------



## Snurg (Jan 23, 2018)

Jorg said:


> ...mousepad...


Mousepads respective touchpads are NO mice!
Read this please.


----------



## Jorg (Jan 23, 2018)

SirDice said:


> I can assure you that the type of filesystem being used is completely irrelevant.


It's related to zfs installation option in installer not zfs itself.


----------



## tobik@ (Jan 23, 2018)

Snurg said:


> Mousepads respective touchpads are NO mice!
> Read this please.


I'm using the Logitech K400 right now to type this message and I can assure you that the touchpad on it is presented as a normal USB mouse to the system.


----------



## Jorg (Jan 23, 2018)

I found this:


aimeec1995 said:


> For some reason using ZFS on my desktop causes my mouse to endlessly disconnect and reconnect and not work at all.





aimeec1995 said:


> For anyone who is interested, this issue only existed when I used MBR for my partition scheme.



And I've used MBR so I will check it.


----------



## Deleted member 48958 (Dec 18, 2018)

After upgrade from 10.4 to 12.0 via `# freebsd-update`,
my USB mouse stopped working... I see nothing strange or unusual
in /var/log/messages / `# dmesg`, OS recognizes it well, but it isn't working…
Anyone had this issue? Mouse isn't working in console also.


----------



## jb_fvwm2 (Dec 18, 2018)

I've had that happen once, not due to a reinstall though, and either rebooted the machine, or re-plugged in the mouse. Sorry if no help. here.


----------



## Deleted member 48958 (Dec 18, 2018)

Thanks, but I tried to plug/unplug, reboot, spells, black magic... 
But none of this helped.


----------



## Martin Paredes (Dec 19, 2018)

ILUXA said:


> OS recognizes it well


This mean that `dmesg | grep ^ums` display the device attached to the driver (only 1: ums0)

What's the output of `grep moused /etc/rc.conf`

What's the output of `ps axw | grep moused`


----------



## Deleted member 48958 (Dec 19, 2018)

Noticed that moused is unable to start.
When I'm trying to start it manually it prints

```
Starting default mousedmoused: unable to open /dev/psm0: No such file or directory
```
Now the only info that I can find about my mouse via `# dmesg` is

```
Dec 19 03:09:52 HOME kernel: ugen4.2: <PixArt USB Optical Mouse> at usbus4
```

P.S.: mouse works fine - 100%, tested on another machine.


----------



## Martin Paredes (Dec 19, 2018)

I can't help you, if you don't cooperate (I ask you for some output)



ILUXA said:


> When I'm trying to start it manually it prints
> 
> ```
> Starting default mousedmoused: unable to open /dev/psm0: No such file or directory
> ```



What command did you use?

/dev/psm0 is a device file for PS/2 mouse, your is USB, it requires /dev/ums0



ILUXA said:


> Now the only info that I can find about my mouse via `# dmesg` is
> 
> ```
> Dec 19 03:09:52 HOME kernel: ugen4.2: <PixArt USB Optical Mouse> at usbus4
> ```



With the mouse connected, what is the output of `dmesg | grep ^ums`

USB mice are initialized by devd(8), try removing everything related to moused in /etc/rc.conf and reboot


----------



## Deleted member 48958 (Dec 19, 2018)

Martin Paredes said:


> With the mouse connected, what is the output of `dmesg | grep ^ums`
> 
> USB mouses are initialized by devd(8), try removing everything related to moused in /etc/rc.conf and reboot


1. Empty output.

2. I already tried that, the situation is the same.

BTW, google search suggestions shows "freebsd 12 mouse", so probably someone had this problem, but I cannot find any solution.


----------



## Martin Paredes (Dec 19, 2018)

ILUXA said:


> 1. Empty output.


It seems that FreeBSD is not attaching a driver (it is no recognizing your mouse)

Unplug the mouse, go to the console (Ctrl + Alt + F1)

What is printed when you connect your mouse?

Try with another mouse (one more generic) to check if ums(4) is working


----------



## Deleted member 48958 (Dec 19, 2018)

SOLVED 
The solution was very easy, I just had to execute `# kldload ums`.

So, it seems, starting from 12-RELEASE, this kernel module is *not* in GENERIC kernel anymore
(why? may be it is a bug?).

So, if someone also have this issue, add _ums_load="YES"_ to /boot/loader.conf and reboot.


----------



## trev (Feb 10, 2019)

Same problem - same solution. Upgraded from an old (working) 12-CURRENT to 12-STABLE and the mouse device failed to be populated in /dev/ ... `kldload ums` fixes it.


```
Feb 10 22:44:29 citadel kernel: ums0 on uhub3
Feb 10 22:44:29 citadel kernel: ums0: <EP2> on usbus0
Feb 10 22:44:29 citadel kernel: ums0: 3 buttons and [XYZ] coordinates ID=0
```


----------



## trev (Jul 19, 2020)

And again - upgrading from 11.2 to 12-STABLE - no USB mouse until `kldload ums`.


----------



## SirDice (Jul 20, 2020)

ILUXA said:


> So, it seems, starting from 12-RELEASE, this kernel module is *not* in GENERIC kernel anymore
> (why? may be it is a bug?).


That  was done more than 8 years ago.





						[base] Contents of /head/sys/amd64/conf/GENERIC
					






					svnweb.freebsd.org


----------



## kennethcf (Oct 4, 2020)

I spent a few hours on this, but finally got it to work for me.  

My Mouse:  a USB wireless WM123 Dell/Logitech, 2 button w/wheel&button combo.  

Symptoms: left button select and right button region worked, but middle button copy did nothing, both console and X11 xterm

Solution:  Added line moused_flags="-c" to my rc.conf file.  This flag is for mice that send a combo of a left and right button together when the middle button is pressed.  The change fixed the console and X11 xterm.  I have to HOLD the middle mouse button for longer than a left or right click, but it works.

My rc.conf does NOT have:  hald_enabled="YES", dbus_enabled="YES", moused_enabled="YES", moused_type="YES"
I did NOT add kern.evdev.rcpt_mask=12 to /etc/sysctl.conf.
I did NOT change anything in any X11 configure file.  I only followed the steps in the Handbook, 5.4.1 Quick Start.
I am running FreeBSD 12.1-RELEASE-p10 GENERIC amd64.


----------



## neostanniy (May 16, 2021)

Hello everyone!
My mouse behaves even more strange. Nothing of mentioned above helped.
Would be extremely grateful for any help. Thanks!


----------

