Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dumps trace w/ mouse plugged in #170

Closed
ggl opened this issue Nov 22, 2021 · 6 comments
Closed

Dumps trace w/ mouse plugged in #170

ggl opened this issue Nov 22, 2021 · 6 comments
Labels

Comments

@ggl
Copy link

ggl commented Nov 22, 2021

Rivalcfg dumps trace with mouse plugged in and udev rules not installed. As a consequence --print-udev, --help and the other help switches cannot be displayed. I installed it into my home directory, so sudo rivalcfg --update-udev does not work since root env doesn't know about the local python lib path.

rivalcfg --help
W: udev rules are not installed. You may not be able to open the device using a regular user.
   Run 'rivalcfg --update-udev' as root to fix.

Traceback (most recent call last):
  File "/home/gelu/.local/bin/rivalcfg", line 8, in <module>
    sys.exit(main())
  File "/home/gelu/.local/lib/python3.6/site-packages/rivalcfg/__main__.py", line 52, in main
    mouse = get_first_mouse()
  File "/home/gelu/.local/lib/python3.6/site-packages/rivalcfg/__init__.py", line 29, in get_first_mouse
    product_id=plugged_devices[0]["product_id"])
  File "/home/gelu/.local/lib/python3.6/site-packages/rivalcfg/mouse.py", line 30, in get_mouse
    hid_device = usbhid.open_device(vendor_id, product_id, profile["endpoint"])
  File "/home/gelu/.local/lib/python3.6/site-packages/rivalcfg/usbhid.py", line 93, in open_device
    device.open_path(path)
  File "hid.pyx", line 125, in hid.device.open_path
@flozz flozz added the bug label Nov 22, 2021
@flozz
Copy link
Owner

flozz commented Nov 22, 2021

That's strange, --print-udev should not even try to open the device :/

Does the following command work?

rivalcfg --print-debug

Can you also try?

RIVALCFG_DRY=1 rivalcfg --help
RIVALCFG_DRY=1 rivalcfg --print-udev

@ggl
Copy link
Author

ggl commented Nov 24, 2021

It only tries to open the device when you have a compatible mouse plugged in and no udev rules installed.

With --print-debug and any other command including --help it still tries to open the device. The trace message is the same every time.

RIVALCFG_DRY=1 rivalcfg --help
RIVALCFG_DRY=1 rivalcfg --print-udev

The above work fine and print everything as intended.

@flozz
Copy link
Owner

flozz commented Nov 24, 2021

Ok, I will look at that...

To solve your issue:

  • Copy the output of the RIVALCFG_DRY=1 rivalcfg --print-udev command to the /etc/udev/rules.d/99-steelseries-rival.rules file
  • Run the sudo udevadm trigger command
  • Then unplug / replug your mouse

:)

@ggl
Copy link
Author

ggl commented Dec 5, 2021

Thank you. I managed to fix it before reporting the bug but it took a while until I found the RIVALCFG_DRY=1 environment variable.

@flozz
Copy link
Owner

flozz commented Dec 6, 2021

Ok, thank you again for your repport.

I will try to fix permission issues when Rivalcfg is used with debug / help / version options :)

@flozz flozz closed this as completed in 91d37d0 Dec 7, 2021
@flozz
Copy link
Owner

flozz commented Dec 7, 2021

I made a fix on master. Now rivalcfg should not try to open devices when not needed, and the error is catched with -h and --help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants