-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reopen connection after process termination #812
Comments
The PylonGigEConnectionGuard is only used for debugging. Because when you are stopped in a breakpoint, the application can't service the GigEVision Heartbeat anymore, and the camera would break the connection on it's own, because it falsely assumes that the application is crashed What you describe is more complex to solve, because the state of your application in the interaction with the camera has to be recovered. The error you show comes from the fact, that if you kill the application ( without proper shutdown) the camera has still an open connection to an application So you'll get this error when you try to reopen the connection before the heartbeat-timeout has passed. As a recommendation for this scenario: |
The Heartbeat Timeout is set to 3 seconds but the script still cannot re-connect after this time when a "try" cycle is running.
What I cannot get is why re-running these two lines in a "try" cycle (even with a 5-second timeout) does not reset the connection but re-running the script does. Another interesting thing is if the script is killed by a task manager, the connection can be opened right away even though it has not been properly closed. So the problem occurs only when the script crashes. |
It is the inverse that you have to do. If it works with Closing and "killing" your application: then the destructors of the instantcamera are still properly called and the connection is properly closed |
Describe what you want to implement and what the issue & the steps to reproduce it are:
I am looking for a way to reopen connection when the program is closed or crashes without closing the camera session.
The following code establishes the connection every second run if the previous one ended up with an error "The device is controlled by another application. "0xE1018006""
However, I would like to make the program to do a few re-connection attempts like shown below:
But the code above always fails to exception.
There seems to be a solution for C++ called PylonGigEConnectionGuard to resolve this particular issue but I cannot find any alternatives for Python.
Is your camera operational in Basler pylon viewer on your platform
Yes
Hardware setup used
Windows 10 x64
Camera(s) used
BaslerCamera a2A 1920-51gcPRO (40429581)
p=vg4p_imx392c_pro/s=r/v=2.4.2/i=8208.11/h=02e36ab
Runtime information:
The text was updated successfully, but these errors were encountered: