N0ciple / gbopyrator

A command line tool and library for the GB Operator
16 stars 1 forks source link

usb.core.USBError: [Errno 13] Access denied (insufficient permissions) #2

Open hellocatfood opened 3 weeks ago

hellocatfood commented 3 weeks ago

I'm trying to run your script on Ubuntu 24.04 but when I do the script crashes with the following output:

gbopyrator --dump-save out.sav

            __________     ____                         __            
           / ____/ __ )   / __ \____  __  ___________ _/ /_____  _____
          / / __/ __  |  / / / / __ \/ / / / ___/ __ `/ __/ __ \/ ___/
         / /_/ / /_/ /  / /_/ / /_/ / /_/ / /  / /_/ / /_/ /_/ / /    
         \____/_____/   \____/ .___/\__, /_/   \__,_/\__/\____/_/     
                            /_/    /____/                             

Traceback (most recent call last):
  File "/home/hellocatfood/.venv/bin/gbopyrator", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/hellocatfood/.venv/lib/python3.12/site-packages/gbopyrator/gbopyrator.py", line 32, in main
    cr.initialize_reader(blocking=True,timeout=10)
  File "/home/hellocatfood/.venv/lib/python3.12/site-packages/gbopyrator/cartridge_utils.py", line 67, in initialize_reader
    self.gbop_device = cu.init_gb_operator(dev)
                       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hellocatfood/.venv/lib/python3.12/site-packages/gbopyrator/coms_utils.py", line 284, in init_gb_operator
    if gbop_device.is_kernel_driver_active(0):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hellocatfood/.venv/lib/python3.12/site-packages/usb/core.py", line 1107, in is_kernel_driver_active
    self._ctx.managed_open()
  File "/home/hellocatfood/.venv/lib/python3.12/site-packages/usb/core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hellocatfood/.venv/lib/python3.12/site-packages/usb/core.py", line 131, in managed_open
    self.handle = self.backend.open_device(self.dev)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hellocatfood/.venv/lib/python3.12/site-packages/usb/backend/libusb1.py", line 804, in open_device
    return _DeviceHandle(dev)
           ^^^^^^^^^^^^^^^^^^
  File "/home/hellocatfood/.venv/lib/python3.12/site-packages/usb/backend/libusb1.py", line 652, in __init__
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "/home/hellocatfood/.venv/lib/python3.12/site-packages/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)
petrutoader commented 3 weeks ago

Hey! You can try this tutorial, you're having permission issues:

https://support.epilogue.co/hc/en-us/articles/4403827118738-How-can-I-connect-my-Operator-device-on-Linux-under-a-non-root-user

Or you can quickly run chmod 777 the device in the /dev folder, it might be something like ttyS0 or ttyACM0 or some other value. But the safest way is by following the tutorial.