basler / pypylon

The official python wrapper for the pylon Camera Software Suite
http://www.baslerweb.com
BSD 3-Clause "New" or "Revised" License
565 stars 207 forks source link

Runtime Exception: Camera device physically removed (in instantcameraimpl.h at line 2079) #672

Open hsutang opened 1 year ago

hsutang commented 1 year ago

I'm encountering a runtime exception when working with the camera. The error message I receive is:

The camera device has been physically removed runtime exception thrown (file ‘instantcameraimpl.h’, line 2079).

I've ensured that the camera is properly connected via USB 3.0 and the necessary drivers are installed. I've also tried [any other troubleshooting steps you've taken, like "restarting the computer", "trying a different cable", etc.].

Has anyone else faced this issue? Any suggestions or workarounds would be greatly appreciated.

Thank you in advance for your assistance!

varshinimuthukumar1 commented 1 year ago

I have the same error. I do perform a DeviceReset() (method available for the camera instance) in case of exception. But this does not help.
The only solution is to disconnect and reconnect the camera physically. Could someone help with some pointers to fix this issue? Or suggest some ideas to do some other kind of reset- so the camera starts getting recognized?

HighImp commented 1 year ago

All commands to the camera do not help, because the exception says that the device is considered disconnected/removed. Is the camera still visible in Pylon Viewer after the error? If so, you should be able to enumerate the camera and create a new instance. Otherwise, as far as I know, there is no other way to create a new connection other than a powercycle. A disconnect shouldn't happen, though. Is there any particular code you can provide to trigger the problem?

matkir commented 11 months ago

I have seen an increase in the number of "Camera device physically removed" messages when going from 2.2.0 to 2.3.0. This is over several thousand commands to the cameras, where the cameras only fail occasionally.

Ive also seen an increase in messages when using an unoptimized config file.