Lepton 3.5 Manual FFC

Greetings.
I am trying to add a feature to my app that lets me manually select between different modes of FFC(Manual, Auto, External). I am a beginner and has little understanding of this stuff but somehow managed the basic implementation for it.

I copied the function from this repo: GitHub - Kheirlb/purethermal1-uvc-capture: Raw Thermal Data over UVC from PureThermal 2 - Lepton 3.5 - Python

this is how the function looks like:

def set_extension_unit(devh, unit, control, data, size):
  return libuvc.uvc_set_ctrl(devh, unit, control, data, size, 0x81)

SYS_UNIT_ID = 6
sysShutterManual2 = lep_sys_shutter_mode(0, 0, 0, 0, 1, 0, 1, 0, 48928)

def set_manual_mode(self):
      sizeData = 32
      shutter_mode = c_uint16(0)
      setSDK = 0x3D
      controlID = (setSDK >> 2) + 1
      print('controlID: ' + str(controlID))
      res = set_extension_unit(self.devh, SYS_UNIT_ID, controlID, byref(sysShutterManual2), sizeData)
      if res < 0:
        print("Error: could not set manual FFC")
      else:
        print("Manual FFC set successfully")

Now when i run this function, it prints the success message, however, my camera goes into standby mode and starts blinking slowly. This also stops the video feed. Switching back to auto mode fixes it.

Why does the camera stops giving feed in manual mode and how do i fix it?

Heres the video of camera’s behavior: https://youtu.be/rhQdKLl78UE

Hi, I don’t know what the code you gave me maps to. It seems like you wrote some functions to write to the sensor.ioctl that lets you execute custom lepton commands?

Anyway, as for manual FFC mode. I have no idea. Every time I’ve played with that the system stops working.

You generally have to deal with the FLIR Lepton doing FFC whenever it wants. FLIR kinda designed these sensors for just raw video output use. So, while they can be used for machine vision, they weren’t optimized to give a video feed without pauses.