You are not logged in.

#1 2025-10-20 10:50:23

alkhater
Member
Registered: 2025-02-14
Posts: 5

[Solved] Can't get a 3Dconnexion space mouse to work-permissions issue

I have followed the instructions on the Arch wiki here. After installing libspnav and spacenavd created a udev rule as follows:

/etc/udev/rules.d/71-device-name.rules

ACTION!="remove", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0x046d", ATTRS{idProduct}=="0xc62b", MODE="0660", TAG+="uaccess"

lsusb:

lsusb --verbose -s 007:004

Bus 007 Device 004: ID 046d:c62b Logitech, Inc. 3Dconnexion Space Mouse Pro
Couldn't open device, some information will be missing
Negotiated speed: Low Speed (1Mbps)
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 [unknown]
  bDeviceSubClass         0 [unknown]
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x046d Logitech, Inc.
  idProduct          0xc62b 3Dconnexion Space Mouse Pro
  bcdDevice            4.37
  iManufacturer           1 3Dconnexion
  iProduct                2 SpaceMouse Pro
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0029
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 [unknown]
      bInterfaceProtocol      0
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 (null)
          wDescriptorLength     334
          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
      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

I still get a permissions error when I execute:

spacenavd -v -d 

Spacenav daemon 1.3.1
reading config file: /etc/spnavrc
found usb device [46d:c62b]: "3Dconnexion SpaceMouse Pro" (/dev/input/event5)
adding device (id: 0).
failed to open device: Permission denied
removing device:  (id: 0 path: /dev/input/event5)
failed to bind unix socket: /var/run/spnav.sock: Permission denied
trying to open X11 display ":1"
   XAUTHORITY=/home/abdulaziz/.Xauthority
Using XTEST to send key events

Not sure what I'm missing?

I would appreciate any help.

Last edited by alkhater (2025-10-21 14:33:15)

Offline

#2 2025-10-20 13:19:16

unixman
Member
Registered: 2015-03-12
Posts: 181

Re: [Solved] Can't get a 3Dconnexion space mouse to work-permissions issue

check it to see whether rule apply or not as you NOT as root.

ls -l /dev/input/*

Or is spacenavd use its own  uid different than yours? But its you call it manually, hmm.

check that whether its works or not when you change the 0660 to 0666. (dangerous, only apply temporarly)

run udevadm trigger ... to see device attrs; check that your rule apply or not.

Offline

#3 2025-10-21 06:28:43

alkhater
Member
Registered: 2025-02-14
Posts: 5

Re: [Solved] Can't get a 3Dconnexion space mouse to work-permissions issue

Thank you for your response...

So it seems the rule is not being applied:

➜ ls -l /dev/input/event27
crw-rw---- 13,69 root 21 Oct 09:00 ? /dev/input/event27

When I apply chmod manually to 0666, I do loose the permission error on opening the device but I still get errors related to socket binding and X11 (I'm running Wayland?). The spacemouse stops moving the mouse cursor but it does not work in FreeCAD:

➜ sudo chmod 666 /dev/input/event27
 ~                                                                                                                                 |  98  | 09:22:23
➜ ls -l /dev/input/event27
crw-rw-rw- 13,91 root 21 Oct 09:19 ? /dev/input/event27
 ~                                                                                                                                 |  98  | 09:22:28
➜ spacenavd -v -d
Spacenav daemon 1.3.1
reading config file: /etc/spnavrc
found usb device [46d:c62b]: "3Dconnexion SpaceMouse Pro" (/dev/input/event27)
adding device (id: 0).
device name: 3Dconnexion SpaceMouse Pro
  Number of axes: 6 (0a 6r)
Device 046d:c62b reports 15 buttons before disjointed button remapping
  Number of buttons: 15 (evdev offset: 256)
using device: 3Dconnexion SpaceMouse Pro (/dev/input/event27)
  device flags: swap y-z invert y-z
failed to bind unix socket: /var/run/spnav.sock: Permission denied
trying to open X11 display ":1"
   XAUTHORITY=/home/abdulaziz/.Xauthority
Using XTEST to send key events

Finally, running sudo udevadm trigger produces no output?

Offline

#4 2025-10-21 06:41:37

unixman
Member
Registered: 2015-03-12
Posts: 181

Re: [Solved] Can't get a 3Dconnexion space mouse to work-permissions issue

/var/run/spnav.sock: Permission denied

/var/run is OWN'ed by root normally.

are you setup XDG_RUNTIME_DIR environment variable properly? You must have OWN that dir.
But systemd should be already setup it for you when you login. hmm.
look at: $ env

is FreeCAD has proper wayland support?

Last edited by unixman (2025-10-21 06:46:04)

Offline

#5 2025-10-21 08:51:34

alkhater
Member
Registered: 2025-02-14
Posts: 5

Re: [Solved] Can't get a 3Dconnexion space mouse to work-permissions issue

I'm not sure what would be the proper setting for XDG_RUNTIME_DIR environment variable. I certainly have not done anything custom in that regard. The variable is currently as below:

echo $XDG_RUNTIME_DIR
/run/user/1000

Regarding FreeCAD Wayland support. I did some digging and it seems there can be some compatibility issues. I replaced the repo version with the flatpak version as I read this can help with the compatibility. I noticed when running flatseal that by default an environment variable is exported for the socked as such: SPNAV_SOCKET=/run/spnav.sock. The issue is I cannot locate this socket file anywhere on my system. I am guessing it is installed through one the packages (spacenavd or libspnav) which I have installed.

Offline

#6 2025-10-21 09:51:16

unixman
Member
Registered: 2015-03-12
Posts: 181

Re: [Solved] Can't get a 3Dconnexion space mouse to work-permissions issue

FYI libspnav and spacenavd are X11 specifics software.
You must read its man pages / configs for interesting parts.

You may want to use X11 session to keep away from compability problems on wayland session.
Xserver use udev to discover input devices too.

So WRT udev: isn't it should be SUBSYSTEMS=="input"  instead?

run as root below before login/launch desktop, then run spacenavd, freecad as normal user to check.

$ udevadm trigger -v -w -t subsystems -c add
$ udevadm trigger -v -w -t subsystems -c add -s "*"
$ udevadm trigger -v -w -c add -s input
$ udevadm trigger -v -w -c add -s drm

Last edited by unixman (2025-10-21 10:06:46)

Offline

#7 2025-10-21 10:37:40

alkhater
Member
Registered: 2025-02-14
Posts: 5

Re: [Solved] Can't get a 3Dconnexion space mouse to work-permissions issue

You were right about the subsystem. When running udevadm info --attribute-walk /dev/input/event5
I get the following:

 udevadm info --attribute-walk /dev/input/event5

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:08.3/0000:c7:00.3/usb7/7-1/7-1:1.0/0003:046D:C62B.0018/input/input48/event5':
    KERNEL=="event5"
    SUBSYSTEM=="input"
    DRIVER==""
    ATTR{power/control}=="auto"
    ATTR{power/runtime_active_time}=="0"
    ATTR{power/runtime_status}=="unsupported"
    ATTR{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:08.3/0000:c7:00.3/usb7/7-1/7-1:1.0/0003:046D:C62B.0018/input/input48':
    KERNELS=="input48"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{capabilities/abs}=="0"
    ATTRS{capabilities/ev}=="20017"
    ATTRS{capabilities/ff}=="0"
    ATTRS{capabilities/key}=="7c0f137 0 0 0 0"
    ATTRS{capabilities/led}=="100"
    ATTRS{capabilities/msc}=="10"
    ATTRS{capabilities/rel}=="3f"
    ATTRS{capabilities/snd}=="0"
    ATTRS{capabilities/sw}=="0"
    ATTRS{id/bustype}=="0003"
    ATTRS{id/product}=="c62b"
    ATTRS{id/vendor}=="046d"
    ATTRS{id/version}=="0111"
    ATTRS{inhibited}=="0"
    ATTRS{name}=="3Dconnexion SpaceMouse Pro"
    ATTRS{phys}=="usb-0000:c7:00.3-1/input0"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{properties}=="0"
    ATTRS{uniq}==""

But changing just that in the rule I had still didn't work. With some help from Deepseek I got the udev rule sorted out. The following udev rule worked:

# 3Dconnexion SpaceMouse
SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c62b", MODE="0666", TAG+="uaccess"
SUBSYSTEM=="input", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c62b", MODE="0666", TAG+="uaccess"
KERNEL=="event*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c62b", MODE="0666", TAG+="uaccess"
KERNEL=="js*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c62b", MODE="0666", TAG+="uaccess"

Offline

#8 2025-10-21 11:07:28

alkhater
Member
Registered: 2025-02-14
Posts: 5

Re: [Solved] Can't get a 3Dconnexion space mouse to work-permissions issue

I got it to work! Deepseek helped wink

I edited the systemd .service file and added the following:

[Service]
RuntimeDirectory=spacenavd
RuntimeDirectoryMode=0755

And now it works. In FreeCAD too. Although the axis are wrong but I suspect that will be an easier fix.

Thank you @unixman for your help!

Offline

#9 2025-10-21 12:11:52

unixman
Member
Registered: 2015-03-12
Posts: 181

Re: [Solved] Can't get a 3Dconnexion space mouse to work-permissions issue

Congrats! You may want to apply [Solved] tags to begin of title to help others whom encounter same issue.

Offline

Board footer

Powered by FluxBB