vstadnytskyi / lcp-flir

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Error SpinnakerException: Spinnaker: Camera has been removed from the list and is no longer valid. [-1002] #4

Closed vstadnytskyi-FDA closed 2 years ago

vstadnytskyi-FDA commented 2 years ago

I am getting error

In [3]: config_filename = r"C:\Users\AR-VR lab W1\Documents\Valentyn\custom_python_libraries\instrumentation\flir-camer
   ...: a\config_SN14120164_12bit.conf"
   ...: from lcp_flir.flir_camera_DL import FlirCamera
   ...: from lcp_flir.device_level_server import Server
   ...:
   ...: camera = FlirCamera()
   ...: camera.init(config_filename)
   ...: camera.broadcast_frames = True
   ...:
   ...: raw_image = np.copy(camera.queue.peek_last_N(1)[0])
sn = 14120164
Acquisition Started
Acquisition was already ended
Acquisition was already started
Acquisition was already ended
Acquisition was already started
Acquisition was already ended
ERROR:root:self.cam.BlackLevelSelector.SetValue(0); self.cam.BlackLevel.SetValue(value*100/4095) failed Traceback (most recent call last):
  File "c:\users\ar-vr lab w1\documents\valentyn\custom_python_libraries\lcp-flir\lcp_flir\flir_camera_DL.py", line 719, in set_black_level
    self.cam.BlackLevelSelector.SetValue(0)
  File "c:\users\ar-vr lab w1\appdata\local\programs\python\python38\lib\site-packages\PySpin\PySpin.py", line 20840, in SetValue
    return _PySpin.IEnumerationT_BlackLevelSelectorEnums_SetValue(self, Value, Verify)
_PySpin.SpinnakerException: Spinnaker: GenICam::AccessException= Feature not present (reference not valid) : AccessException thrown (file 'IEnumerationT.h', line 316) [-2006]

AcquisitionFrameRateEnable is not readable
BinningHorizontal is not Writable
IspEnable is not Writable
BinningHorizontal is not Writable
'export' is not recognized as an internal or external command,
operable program or batch file.
'export' is not recognized as an internal or external command,
operable program or batch file.
self.cam.LUTEnable is not writable
GammaEnable is not writable
---------------------------------------------------------------------------
SpinnakerException                        Traceback (most recent call last)
Input In [3], in <module>
      3 from lcp_flir.device_level_server import Server
      5 camera = FlirCamera()
----> 6 camera.init(config_filename)
      7 camera.broadcast_frames = True
      9 raw_image = np.copy(camera.queue.peek_last_N(1)[0])

File c:\users\ar-vr lab w1\documents\valentyn\custom_python_libraries\lcp-flir\lcp_flir\flir_camera_DL.py:222, in FlirCamera.init(self, config_filename)
    219 self.last_frameID = -1
    220 self.num_of_missed_frames = 0
--> 222 self.start_thread()

File c:\users\ar-vr lab w1\documents\valentyn\custom_python_libraries\lcp-flir\lcp_flir\flir_camera_DL.py:639, in FlirCamera.start_thread(self)
    637 from ubcs_auxiliary.multithreading import new_thread
    638 if not self.acquiring:
--> 639     self.start_acquisition()
    640     self.threads['acquisition'] = new_thread(self.run)

File c:\users\ar-vr lab w1\documents\valentyn\custom_python_libraries\lcp-flir\lcp_flir\flir_camera_DL.py:664, in FlirCamera.start_acquisition(self)
    660 """
    661 a wrapper to start acquisition of images.
    662 """
    663 self.acquiring = True
--> 664 self.cam.BeginAcquisition()

File c:\users\ar-vr lab w1\appdata\local\programs\python\python38\lib\site-packages\PySpin\PySpin.py:34184, in _SWIG_CamPtr.BeginAcquisition(self)
  34173 def BeginAcquisition(self):
  34174     r"""
  34175     BeginAcquisition(self)
  34176     void
   (...)
  34182     See:   Init()
  34183     """
> 34184     return _PySpin._SWIG_CamPtr_BeginAcquisition(self)

SpinnakerException: Spinnaker: Camera has been removed from the list and is no longer valid. [-1002]
vstadnytskyi-FDA commented 2 years ago

The solution is to connect camera to a USB 3.0 port which is located on the laptop and not via USB 3.0 hub.