pupil-labs / pyuvc

python binding to libuvc
Other
119 stars 51 forks source link

cap.available_modes empty #85

Open enlightment84 opened 3 years ago

enlightment84 commented 3 years ago

I had successfully connected to the cam, but the available_mode is empty. I slightly modified the example.py.

from future import print_function import uvc import logging

logging.basicConfig(level=logging.INFO)

dev_list = uvc.device_list()

for index, cam in enumerate(dev_list) : print("[" + str(index) + "]" + str(cam));

cap = uvc.Capture(dev_list[0]["uid"]);

print(cap) print(cap.avaible_modes) print(cap.frame_mode) cap.get_frame_robust()


RESULT :

[0]{'name': 'Dino-Lite Premier', 'manufacturer': 'AnMo Electronics Corporation', 'serialNumber': 'unknown', 'idProduct': 2112, 'idVendor': 41320, 'device_address': 3, 'bus_number': 2, 'uid': '2:3'} [1]{'name': 'unknown', 'manufacturer': 'unknown', 'serialNumber': 'unknown', 'idProduct': 898, 'idVendor': 1480, 'device_address': 5, 'bus_number': 2, 'uid': '2:5'} [2]{'name': 'unknown', 'manufacturer': 'unknown', 'serialNumber': 'unknown', 'idProduct': 898, 'idVendor': 1480, 'device_address': 5, 'bus_number': 2, 'uid': '2:5'} Capture device name: Dino-Lite Premier manufacturer: AnMo Electronics Corporation serialNumber: unknown idProduct: 2112 idVendor: 41320 device_address: 3 bus_number: 2 uid: 2:3 [] (None, None, None) Traceback (most recent call last): File "example.py", line 23, in cap.get_frame_robust() File "uvc.pyx", line 572, in uvc.Capture.get_frame_robust frame = self.get_frame() File "uvc.pyx", line 588, in uvc.Capture.get_frame self._start() File "uvc.pyx", line 541, in uvc.Capture._start self._configure_stream() File "uvc.pyx", line 533, in uvc.Capture._configure_stream raise InitError("Can't get stream control: Error:'%s'."%uvc_error_codes[status]) uvc.InitError

papr commented 3 years ago

'name': 'unknown'

This indicates that either the drivers are not installed correctly (on Windows) or the user is not part of the plugdev group (on Ubuntu).

enlightment84 commented 3 years ago

'name': 'unknown'

This indicates that either the drivers are not installed correctly (on Windows) or the user is not part of the plugdev group (on Ubuntu).

Thanks for your fast response @papr. I have actually double checked the installation of the camera driver. I am pretty sure that I follow correctly the guidance in https://github.com/papr/pyuvc/blob/master/WINDOWS_USER.md. I have checked also the installed driver in the device manager. Below picture shows my confirmation on the status of the installed driver and the steps. Hope you can help. Thx.

DriverInstallation