Skip to content

Commit 9f403df

Browse files
committed
Add troubleshooting guidance for Linux permission issues with SpaceMouse
1 parent bd49ade commit 9f403df

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ The library uses `hidapi` as low-level interface to the device and `easyhid` as
7373
</pre>
7474
</details>
7575

76+
- **Note:** If you encounter "Failed to open device" errors, see the [Troubleshooting - Linux](./troubleshooting.md#linux) section for device-specific permission setup.
77+
7678
- ### Windows
7779
- Install the latest release of hidapi.dll and hidapi.lib from
7880
the [hidapi releases](https://github.com/libusb/hidapi/releases) page.

troubleshooting.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,72 @@ Read descriptor from the device (replace `<VID/PID>` with the VID/PID of your de
9696
Closing device
9797
```
9898

99+
<hr>
100+
101+
## Linux
102+
103+
### Failed to open device / Permission denied
104+
105+
If you encounter an error like `Failed to open device` or `Permission denied` when trying to use your SpaceMouse on Linux, this is typically a permissions issue. Normal users don't have permission to access HID devices by default.
106+
107+
**Error example:**
108+
```bash
109+
Traceback (most recent call last):
110+
File "/home/user/.local/lib/python3.8/site-packages/pyspacemouse/pyspacemouse.py", line 183, in open
111+
self.device.open()
112+
File "/home/user/.local/lib/python3.8/site-packages/easyhid/easyhid.py", line 134, in open
113+
raise HIDException("Failed to open device")
114+
easyhid.easyhid.HIDException: Failed to open device
115+
```
116+
117+
**Solution:**
118+
119+
1. **Find your device's Vendor ID and Product ID:**
120+
```bash
121+
lsusb
122+
```
123+
Look for your SpaceMouse device. Example output:
124+
```
125+
Bus 001 Device 013: ID 256f:c652 3Dconnexion Universal Receiver
126+
```
127+
Here, `256f` is the Vendor ID and `c652` is the Product ID.
128+
129+
2. **Create udev rules to grant permissions:**
130+
```bash
131+
cd /etc/udev/rules.d
132+
sudo touch 99-spacemouse.rules
133+
sudo nano 99-spacemouse.rules
134+
```
135+
136+
3. **Add the following rules** (replace `046d` and `c62b` with your Vendor ID and Product ID):
137+
```bash
138+
SUBSYSTEM=="input", GROUP="input", MODE="0660"
139+
KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c62b", MODE="0666"
140+
```
141+
142+
Common SpaceMouse IDs:
143+
- SpaceMouse Compact: `256f:c635`
144+
- SpaceMouse Wireless: `256f:c62e`
145+
- 3Dconnexion Universal Receiver: `256f:c652`
146+
- SpaceNavigator: `046d:c626`
147+
148+
4. **Reload udev rules:**
149+
```bash
150+
sudo udevadm control --reload-rules
151+
sudo udevadm trigger
152+
```
153+
154+
5. **Add your user to the input group:**
155+
```bash
156+
sudo usermod -a -G input $USER
157+
```
158+
159+
6. **Disconnect and reconnect your SpaceMouse**, then log out and log back in to Ubuntu (or restart your computer).
160+
161+
After these steps, your SpaceMouse should work correctly without permission errors.
162+
163+
<hr>
164+
99165
## Windows
100166

101167
!!! info "Error message - OSError: cannot load library 'hidapi.dll'"

0 commit comments

Comments
 (0)