genicam / harvesters

Image Acquisition Library for GenICam-based Machine Vision System
Apache License 2.0
500 stars 86 forks source link

Exception occur when create camera. GenTL exception: Requested operation is not allowed. (ID: -1005) #443

Open Yasirsmb opened 4 months ago

Yasirsmb commented 4 months ago

Describe the Issue I have simple program it detect camera but at h.create()/h.create(0) its gives exception

Sample Code I can show a piece of code that demonstrates the reported phenomenon:

Here is the code its just test code so see it if create:

from harvesters.core import Harvester
import numpy as np

if __name__ == "__main__":
    h = Harvester()
    h.reset()
    h.add_file('/opt/ImpactAcquire/lib/x86_64/mvGenTLProducer.cti')
    h.update()
    device_info_list = h.device_info_list
    print(device_info_list)
    ia = h.create()
    print("done")

This is the exception i am getting:

Cannot check if IP address available: 'arping' not found
Cannot check if IP address available: 'arping' not found
[{'access_status': 3, 'display_name': 'MATRIX VISION GmbH mvBlueCOUGAR-X120aC-POE(00:0c:8d:60:1e:b4)', 'id_': 'mvBlueCOUGAR-X120aC-POE(00:0c:8d:60:1e:b4)', 'model': 'mvBlueCOUGAR-X120aC-POE', 'parent': <genicam.gentl.Interface; proxy of <Swig Object of type 'std::shared_ptr< GenTLCpp::TLInterface > *' at 0x7feb9814b570> >, 'serial_number': 'GX007860', 'tl_type': 'GEV', 'user_defined_name': '', 'vendor': 'MATRIX VISION GmbH', 'version': '1.03'}]
Traceback (most recent call last):
  File "/home/yasir/source/cameralib/test2.py", line 11, in <module>
    ia = h.create()
  File "/home/yasir/.local/lib/python3.10/site-packages/harvesters/core.py", line 3082, in create
    return self._create_acquirer(device_proxy=device_proxy, config=config)
  File "/home/yasir/.local/lib/python3.10/site-packages/harvesters/core.py", line 3099, in _create_acquirer
    device_proxy.open(_privilege)
  File "/home/yasir/.local/lib/python3.10/site-packages/harvesters/core.py", line 228, in m
    return getattr(self._source_object, attribute)(*args)
  File "/home/yasir/.local/lib/python3.10/site-packages/genicam/gentl.py", line 3189, in open
    return _gentl.Device_open(self, accessFlags)
_gentl.AccessDeniedException: GenTL exception: Requested operation is not allowed. (Message from the source: ) (ID: -1005)

Expected Behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem; Note that it is not necessary to put everything as a screenshot! If the source is a text just paste the text because that is much helpful for us.

Configuration

Reproducibility

This phenomenon can be stably reproduced:

If applicable, please provide your observation about the reproducibility.

Actions You Have Taken

I have been working in windows with same GenTL and its working fine there a and capturing image. When i came to linux I install same GenTL and try to get initiallize image it always stuck at h.create()

Additional context Add any other context about the problem here.

kmdouglass commented 1 month ago

Hi @Yasirsmb ,

I just ran into the exact same issue. In my case, the GenICam software that came with my frame grabber was still open and connected to the camera, which prevented the Python script from connecting to the camera. Maybe you could verify that no other software is connected to the camera.