VimbaPython
VimbaPython copied to clipboard
Discover cameras that have a wrong IP address
I was wondering if there is any way to discover GigE cameras that have a wrong IP? By wrong IP I mean:
- the camera was connected to another system and has an IP/mask combination for the new system
- 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.
I am sorry for coming back so fast, but this is kind of a showstopper for us. We would really appreciate any feedback here.
This could be done using ForceIP. To force the Ip of the camera use the following steps
- Open the cmd prompt.
- 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"
- 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
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?
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:
-
GeVTLIsPresent
-
GevDeviceForceMACAddress
-
GevDeviceForceIPAddress
-
GevDeviceForceSubnetMask
-
GevDeviceForceGateway
-
GevDeviceForceIP
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
)