We have a system using 5 GIGE cameras such as Teledyne DALSA Linea.
We use the class Device of CVB.NET via DeviceFactory.Discover(); to initialize them and subscribe to device.Stream to start the acquisition.
We use the code below to detect disconnection and reconnection
device.Notify[NotifyDictionary.DeviceDisconnected].Event += Disconnected;
device.Notify[NotifyDictionary.DeviceReconnect].Event += Reconnect;
The problem is if we disabled and enable the ethernet adapter to simulate a loss of connection
we cannot restart the grabbing of the stream. Any action such as stopping or Aborting the stream result in a crash. It seems the the device and stream are corrupted.
We are under Windows Server 2016 Standard x64
We use CVB 13.04.005 (64-bit)
Have you a solution to regrab on a device stream after a Network deconnection that works ?
It would be great, if you could test this by unplugging the loaded camera from you machine and then plugging it back in. This at least was tested and should work.
Hi Chris !
I have already tested that and the notification works at the deconnection and reconnection.
The problem is when I have a running Stream.
When i add this line after the construction of the device: device.Stream.Start();
Add I try to disable and enable the Ethernet Adapter the program crash after the reconnection
What I understand it that unplugging and repluging the camera has not the same behavior that disabling/enabling the ethernet adapter
I tested with disabling network interfaces years ago, it worked then.
But essentially disabling the interface might remove resources the driver needs.
Your use-case just includes normal connection loss, right?
And you just want to simulate that?
Instead of disabling the network interface you could simply block ALL(!) UDP packet via the firewall?
Hi @c.hartmann .
Thanks for the advice you are right, disabling the network adapter to simulate a loss of connection is corrupting the camera driver. I will continue my tests with a manual disconnection of the camera ethernet cable or as you said blocking UDP packets. Do you know if it’s possible to only block UDP packets from only one specific camera ?
Best regards
I would not not block a specific camera, simply because GigE Vision uses dynamic ports (which is communicated/negotiated in a “bootstrap” mechanism).
Instead i would block specific applications or network adapter.
i know how to do it with the gui, but sadly i can’t help you with a console command.
But this is standard network stuff. There should be plenty of material about it.
Hi @c.hartmann
Thank for the advice. I found a way. I disable/enable IPv4 in the Network adapter of the camera and that works to simulate a connection loss.
Best regards