Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

IndexError when disconnecting Ethernet #156

Open
JaegerStephan opened this issue Apr 14, 2023 · 5 comments
Open

IndexError when disconnecting Ethernet #156

JaegerStephan opened this issue Apr 14, 2023 · 5 comments

Comments

@JaegerStephan
Copy link

JaegerStephan commented Apr 14, 2023

Setup

  • OS: Windows 10
  • Camera: Manta G-507C

Issue

when a vimba instance is running and the ethernet cable is disconnected from PC, an unexpected error raises

Exemplary code

import vimba
import time

with vimba.Vimba.get_instance() as vb:
    print(vb.get_all_interfaces())
    while True:
        time.sleep(5)
        print(vb.get_all_interfaces())

Error

Traceback (most recent call last):
  File "C:\Users\jaegeste\Documents\Coding\insight-vision-capture\venv311\Lib\site-packages\vimba\feature.py", line 310, in __feature_cb_wrapper
    raise e
  File "C:\Users\jaegeste\Documents\Coding\insight-vision-capture\venv311\Lib\site-packages\vimba\feature.py", line 302, in __feature_cb_wrapper
    handler(self)
  File "C:\Users\jaegeste\Documents\Coding\insight-vision-capture\venv311\Lib\site-packages\vimba\vimba.py", line 573, in __inter_cb_wrapper
    inter = [i for i in self.__inters if inter_id == i.get_id()].pop()

Since there is an IndexError mentioned, I tried to catch the exception like

import vimba
import time

try:
    with vimba.Vimba.get_instance() as vb:
        print(vb.get_all_interfaces())
        while True:
            time.sleep(5)
            print(vb.get_all_interfaces())
except IndexError as e:
    print("error")
    print(e)

which unfortunately does not result in any print.

Help

Can you please provide some information what might be the issue or if you consider it as an bug, fix it.

@Teresa-AlliedVision
Copy link

Hi,
I was unable to reproduce the issue with connecting and disconnecting the camera.
Please enable logging, vb.enable_log(LOG_CONFIG_TRACE_FILE_ONLY) should do the trick, but have a look at the manual for more options. Please don't post the trace log as text, but as a file, they can get really long.
Do you have Vimba6 and Vimba Python 1.2.1 ?

@JaegerStephan
Copy link
Author

The error does not raise if I disconnect the plug from the camera but if I disconnect the plug from my notebook.
Is it possible that there are any differences?

I use Vimba6 and VimbaPython 1.2.1.

Please find attached the log file (renamed to trace.txt because I cannot upload a .log file).
trace.txt

@Teresa-AlliedVision
Copy link

Are you using a switch? The same error happened when I disconnected my switch, that had a camera connected.
I'll forward a bug report, but a fix will probably be only in VimbaX.

@JaegerStephan
Copy link
Author

Yes, you are right, I'm using a switch. Sorry, that forgot to mention.
Since you mention VimbaX: is there a general recommendation for using VimbaX.
Few weeks ago I sent a message via your web contact formular in which I asked for which Vimba is best to choose (Vimba or VimbaX). The result of messaging was to keep with Vimba instead of VimbaX (at least for Manta cameras). Would you agree?

@Teresa-AlliedVision
Copy link

If you are using non-Alvium cameras with chunk data and/or events or have a well running system on Vimba already and no time for migration, then we generally don't encourage a change right now. Chunk and Events were non-GenICam compliant in Manta/Mako/Prosilica, so they do not work with VimbaX. Generally the cameras can be run with VimbaX too, of course.
If you need a bug fix, that came in VimbaX, the newer runtime dll for the underlying C-API or start a new development, then switching would be encouraged.
I found the case and agree with my collegue, that if it is possible that you will need any of the proprietary features I mentioned, then staying with Vimba might be better. I think this is a decsion that depends heavily on your application and what future add ons should be planned for.

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

No branches or pull requests

2 participants