intellimouse-ctl
                                
                                 intellimouse-ctl copied to clipboard
                                
                                    intellimouse-ctl copied to clipboard
                            
                            
                            
                        Error on MacOS: `OSError: open failed`
I'm having issues running this in MacOS 12.2.1.
$ intellimouse-ctl list
0. ProIntelliMouse @ "DevSrvsID:4295139340"
$ intellimouse-ctl get --dpi 0
Traceback (most recent call last):
  File "/usr/local/bin/intellimouse-ctl", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/intellimouse_ctl/__init__.py", line 119, in main
    with _connected_devices()[namespace.index] as device:
  File "/usr/local/lib/python3.9/site-packages/intellimouse/intellimouse.py", line 33, in __enter__
    self._device.open_path(self._path)
  File "hid.pyx", line 125, in hid.device.open_path
OSError: open failed
Hi, thanks for your bug report!
I think this might be a dupe of #10.
Does the problem resolve itself when you run with sudo?
Nope. Same error with sudo.
Nope. Same error with sudo.
Have you tried giving accesibillity and/or input monitoring rights to your Python install and Terminal?
Like so:
 (This screen shot is from Catalina, the UI might have changed a bit, but the same principal should still apply)
(This screen shot is from Catalina, the UI might have changed a bit, but the same principal should still apply)
I did some digging and I think it might be related to the following issue https://github.com/libusb/hidapi/issues/344, which is related to https://github.com/k-visscher/intellimouse-ctl/issues/10.
Please let me know if allowing input monitoring fixes your issue? (you might be thinking: "huh but a mouse isn't a keyboard?!" and you'd be right, however the IntelliMouse's (Classic/Pro) have two interfaces one being a HID mouse and the other a HID keyboard, the interface that's being used for writing/reading the settings, is unfortunately the keyboard one.)
I really appreciate the support, but unfortunately it still isn't working. I've given iTerm and /usr/local/bin/intellimouse-ctl "Accessibility" and "Input Monitoring", but I got the same error. I then tried Terminal instead of iTerm after giving it the same permissions, but the problem remained. I'm using Python from Homebrew which might be contributing to the problem. After dereferencing the symlinks for the python interpreter in the shebang of intellimouse-ctl, I arrived at /usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/bin/python3.9. I tried to give that "Accessibility" and "Input Monitoring" permissions, but the UI had greyed out those files preventing me from doing so. I tried to install intellimouse-ctl again using the system pip3 at /usr/bin/pip3 but that was broken for other reasons -- possibly because I'm using python from Homebrew, as mentioned earlier.
I have a Debian box next to me. I think I'll just use that to set it up. I assume the settings are saved to the mouse and will travel between machines.
Thanks again for your help.
Ah, I got it to work with the one combination I didn't try: sudo with all the accessibility permissions. Thanks. 👍
I've tried intellimouse-ctl on both MacOS and Linux, installed using pip. Setting the permissions and using sudo worked on MacOS, but I'm getting the exact same error on Pop!_OS Linux. I don't think this is the same as the Mac issue, but it's still not able to get the device settings
File "hid.pyx", line 142, in hid.device.open_path
OSError: open failed
» intellimouse-ctl list                                                                                                                                               130 ↵
0. ProIntelliMouse @ "3-3.4.1:1.1"
@nathansgithub
I've tried intellimouse-ctl on both MacOS and Linux, installed using pip. Setting the permissions and using sudo worked on MacOS, but I'm getting the exact same error on Pop!_OS Linux. I don't think this is the same as the Mac issue, but it's still not able to get the device settings
File "hid.pyx", line 142, in hid.device.open_path OSError: open failed» intellimouse-ctl list 130 ↵ 0. ProIntelliMouse @ "3-3.4.1:1.1"
Thanks for your bug report!
Could you please try one of the following commands:
# classic intellimouse
sudo sh -c 'echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"045e\", ATTR{idProduct}==\"0823\", MODE=\"0666\"" >> /etc/udev/rules.d/z21_persistent-local.rules'
or
# pro intellimouse
sudo sh -c 'echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"045e\", ATTR{idProduct}==\"082a\", MODE=\"0666\"" >> /etc/udev/rules.d/z21_persistent-local.rules'
then
sudo udevadm control --reload-rules && reboot
then once you're rebooted something like:
intellimouse-ctl get --dpi 0
Let me know if that worked for you! ;)
Thanks @k-visscher! It's working after I added that udev rule.