morefigs / pymba

Python wrapper for Allied Vision's Vimba C API
MIT License
105 stars 84 forks source link

Unable to run gige vision mako camera... #77

Closed chandanlal92 closed 5 years ago

chandanlal92 commented 5 years ago

I am getting following error if I run opencv_example.py

camera0 = vimba.getCamera(cameraIds[0]) IndexError: list index out of range

and also test_camera.py

chandanlal92 commented 5 years ago

Please help to configure mako-G 503 Gige Vision Camera using pympa....I am unable to connect the camera

chandanlal92 commented 5 years ago

is there any changes to be done for Gige Vision Camera in the Code

morefigs commented 5 years ago

Are you calling system.runFeatureCommand("GeVDiscoveryAllOnce")?

chandanlal92 commented 5 years ago

Yes I am calling system.runFeatureCommand("GeVDiscoveryAllOnce")

morefigs commented 5 years ago

Please try adding a few second wait (time.sleep(10)) after calling the above command to see if that helps.

morefigs commented 5 years ago

You could try Pymba v0.2, which was just released.

chandanlal92 commented 5 years ago

Tried both the versions with delay still not same error.

chandanlal92 commented 5 years ago

For GigE Camera is there anyother thing that needs to be changed?

morefigs commented 5 years ago

Does the camera work if you open it in Vimba Viewer?

https://github.com/morefigs/pymba/blob/master/examples/camera/list_camera_ids.py works for me with a GigE camera and Pymba v0.2.

Could you also try https://github.com/morefigs/pymba/blob/master/examples/interface/list_interface_ids.py to see if you can see an interface?

Also try running the above examples after opening the camera in Vimba Viewer.

chandanlal92 commented 5 years ago

I am able to work with the camera and in vimba viewer but it is not being listed in the camera list in any of the interfaces like vimbaC,Vimba C++ and Pymba

morefigs commented 5 years ago

According to the Vimba C manual:

GigE cameras: Listing cameras over the network is a two-step process:

  1. To enable camera discovery events, run one of the following commands: • GeVDiscoveryAllOnce discovers all connected cameras once. • GeVDiscoveryAllAuto continually emits discovery packets and thus constantly consumes bandwidth. Use it only if you need to stay aware of changes to your network structure and new cameras. Both commands require a certain amount of time (GeVDiscoveryAllDuration) before returning.
  2. To stop the camera discovery, run command GeVDiscoveryAllOff.

Pymba automatically calls GeVDiscoveryAllOnce for you. But since you're having issues you could try setting the discovery time and calling it again with an extra long discovery time:

from pymba import Vimba
from time import sleep

if __name__ == '__main__':

    with Vimba() as vimba:
        # 5 seconds
        vimba.system().GeVDiscoveryAllDuration = 5000
        vimba.system().run_feature_command('GeVDiscoveryAllOnce')
        sleep(5)
        print(vimba.camera_ids())
morefigs commented 5 years ago

Did that help? Is this still an issue?

chandanlal92 commented 5 years ago

No I still have the issue.It is not solved.

chandanlal92 commented 5 years ago

What IP Config did you use Persistant or LLA?

morefigs commented 5 years ago

I imagine you don't ever want to be using LLA. DHCP is probably preferable for avoiding networking issues unless you're confident in setting a persistent address. I'm using DHCP.

chandanlal92 commented 5 years ago

I am able to stream using pymba now. The problem got resolved once I removed firewall. Thank you for your support will let you if there is any issues in future.