Photometrics / PyVCAM

Python3.X wrapper for Photometrics and QImaging PVCAM based cameras
MIT License
36 stars 17 forks source link

LIBUSB_ERROR_ACCESS when connected via SSH when host is not logged in #31

Closed CKevin9 closed 1 year ago

CKevin9 commented 1 year ago

Hi, I'm unable to access the camera when logged in via ssh when the host computer is not logged in to my account. Connection only works when I'm logged in to my account, not any other users, and stops working when I log out or switch users.

Camera Model: Prime BSI PVCAM SDK Version: 3.9.12.11-1 PyVCAM Version: 2.1.5 Host Server: Ubuntu 22.04.1 LTS

Console command & traceback:

<myusername>@<ourserver>:~/Projects/PyVCAM/tests$ python3 single_image_polling.py 
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/pyvcam-2.1.5-py3.10-linux-x86_64.egg/pyvcam/camera.py", line 157, in open
    self.__handle = pvc.open_camera(self.__name)
RuntimeError: Driver device failed to open (PL_ERR_DDI_DEVICE_OPEN_FAILED). Failed to open camera device 'pvcamUSB_0', Cannot open device, LIBUSB_ERROR_ACCESS

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/<myusername>/Projects/PyVCAM/tests/single_image_polling.py", line 18, in <module>
    main()
  File "/home/<myusername>/Projects/PyVCAM/tests/single_image_polling.py", line 9, in main
    cam.open()
  File "/usr/local/lib/python3.10/dist-packages/pyvcam-2.1.5-py3.10-linux-x86_64.egg/pyvcam/camera.py", line 160, in open
    raise RuntimeError('Failed to open camera.')
RuntimeError: Failed to open camera.
tomhanak commented 1 year ago

For remote access the TAG+="uaccess" in related udev rule is not active. The user must be a member of users group in that case.

Please follow the messages printed by PVCAM installer or take a look at Q/A 8 in pvcam_faq.txt and do not forget to reboot the PC after the change.