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

"Error connecting FLIR and HikRobot: InvalidParameterException (ID: -1009)" #434

Open
2 tasks
pathu999 opened this issue Oct 9, 2023 · 0 comments
Open
2 tasks

Comments

@pathu999
Copy link

pathu999 commented Oct 9, 2023

Describe the Issue
I am encountering an error when attempting to connect FLIR and HikRobot devices within the Harvester repository.

To Reproduce
Steps to reproduce the behavior:
Initialize the connection to FLIR and HikRobot devices.
Encounter the error: gentl.InvalidParameterException: GenTL exception: Parameter not valid or out of range. (Message from the source: Invalid enum. EVENT_TYPE iEventID = 5 Expected value = 1003.) (ID: -1009)
Sample Code

Sample Code
def _open_gentl_producers(self) -> None:
global _logger

    for file_path in self._cti_files:
        raw_producer = GenTLProducer.create_producer()
        try:
            raw_producer.open(file_path)
        except GenTL_GenericException as e:
            _logger.warning(e, exc_info=True)
        else:
            self._producers.append(Producer(module=raw_producer))
            _logger.debug('initialized file: {0}'.format(raw_producer.path_name))

def _open_systems(self) -> None:
    global _logger

    for producer in self._producers:
        raw_system = producer.create_system()
        try:
            raw_system.open()
        except GenTL_GenericException as e:
            _logger.warning(e, exc_info=True)
        else:
            self._systems.append(System(module=raw_system, parent=producer))
            _logger.debug('opened: {0}'.format(_family_tree(raw_system)))

Proposed Solution:
I have identified a potential solution to the issue. After investigating the problem, it appears that the connection issue might be resolved by ensuring the correct setup of the GenTL Producer object and the GenTL System object. Here is a proposed solution that you can try:

# Specify the path to the CTI file
path_name = os.path.join('MvProducerU3V.cti')

# Create a GenTLProducer object and open the CTI file
producer = GenTLProducer.create_producer()
producer.open(path_name)

# Create a GenTL System object and open it
system = producer.create_system()
system.open()
system.update_interface_info_list(5000)
interface = system.interface_info_list[0].create_interface()
interface.open()
interface.update_device_info_list(5000)
deviceTest = interface.device_info_list[0].create_device()
deviceTest.open(DEVICE_ACCESS_FLAGS_LIST.DEVICE_ACCESS_EXCLUSIVE)

Expected Behavior
I expected the FLIR and HikRobot devices to connect successfully without any errors.

Actual Behavior:
The connection attempt resulted in the specified error message, preventing the devices from connecting.

Configuration

  • OS: [Windows 11]
  • Python: [3.8.1]
  • Harvesters: [ 1.4.2]
  • GenTL Producer: [e.g. Muffle Donut API version 12.1, Itchy Inc.]
  • Camera: [e.g. Gong Hyperspectral, Scratchy AG]

Reproducibility

This phenomenon can be stably reproduced:

  • [✓ ] Yes

  • No.

  • (Please select either yes or no.)

I can reliably reproduce this issue every time I attempt to connect the devices using the provided code snippet.

Additional context
I have double-checked the CTI file path and confirmed that it is correct. I have also ensured that the necessary drivers for both FLIR and HikRobot devices are installed and up to date. Despite these efforts, the issue persists.

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

No branches or pull requests

1 participant