alliedvision / VimbaPython

Old Allied Vision Vimba Python API. The successor to this API is VmbPy
BSD 2-Clause "Simplified" License
93 stars 40 forks source link

Discover cameras that have a wrong IP address #52

Open alexandruradovici opened 3 years ago

alexandruradovici commented 3 years ago

I was wondering if there is any way to discover GigE cameras that have a wrong IP? By wrong IP I mean:

  1. the camera was connected to another system and has an IP/mask combination for the new system
  2. the camera lost its IP settings and has reset to the defaults

I would like to be able to detect the camera and set a correct IP.

alexandruradovici commented 3 years ago

I am sorry for coming back so fast, but this is kind of a showstopper for us. We would really appreciate any feedback here.

arunprakash-avt commented 3 years ago

This could be done using ForceIP. To force the Ip of the camera use the following steps

  1. Open the cmd prompt.
  2. Navigate to the path of the Vimba Example binaries For example: cd "C:\Users\Public\Documents\Allied Vision\Vimba_4.2\VimbaC_Examples\Bin\Win64"
  3. Use ForceIP to set the new IP to the camera. The following command is

ForceIP.exe Camera MAC Address NewIP NewSubnetMask For example: ForceIP.exe 0x0F3101D540 169.254.1.1 255.255.0.0

alexandruradovici commented 3 years ago

This could be done using ForceIP. To force the Ip of the camera use the following steps

1. Open the cmd prompt.

2. Navigate to the path of the Vimba Example binaries
   For example:
   cd "C:\Users\Public\Documents\Allied Vision\Vimba_4.2\VimbaC_Examples\Bin\Win64"

3. Use ForceIP to set the new IP to the camera. The following command is

ForceIP.exe Camera MAC Address NewIP NewSubnetMask For example: ForceIP.exe 0x0F3101D540 169.254.1.1 255.255.0.0

Is this possible from the Vimba Python API? Or is there any way to get the source code of ForceIP.exe?

My questions if I can get the MAC addresses of the cameras that have a wrong IP through the Vimba Python API?

NiklasKroeger-AlliedVision commented 3 years ago

Is this possible from the Vimba Python API? Or is there any way to get the source code of ForceIP.exe?

Yes the source code for the ForceIP example can be found in the corresponding Source Directory to the example Arun mentioned above (building on the path above the source would be at C:\Users\Public\Documents\Allied Vision\Vimba_4.2\VimbaC_Examples\ForceIP\Source). This example is coded in C but all the features used should also be available in VimbaPython.

My questions if I can get the MAC addresses of the cameras that have a wrong IP through the Vimba Python API?

This should be possible by using the features also used by the ForceIP executable already mentioned. Looking at the ForceIP.c example (directory path for this file above) we can see that the following features are used with the Vimba System handle:

Access to these features is available via the Vimba System object. For example the following code uses the GeVTLIsPresent feature (which is a Bool feature) to check if the gige transport layer is available:

import vimba

with vimba.Vimba.get_instance() as vmb:
    is_gige_tl_present = vmb.GeVTLIsPresent.get()

With that it should be possible to implement the ForceIP functionality you require.

Additional information on the used Vimba features can be found in the "Vimba Manual.pdf" section 10.3 (included in you Vimba Installation path, e.g. at C:\Program Files\Allied Vision\Vimba_4.2\Documentation\Vimba Manual.pdf)