Errors trying to use lepton_target_temp_hotspot example

Hi all,

I am currently trying to adjust my target range on the OpenMV PT with a lepton 3.5. When I was looking at the example given, I got the error: RunTimeError: Sensor Control Failed
Which occurs on line 37: sensor.ioctl(sensor.IOCTL_LEPTON_SET_MEASUREMENT_MODE, True)

There do seem to be previous posts about this topic with no response/solution. I was wondering if anyone found a solution, or the cause for the problem?

Thank you!!!

Hi, sorry for the late response.

That command failing implies you don’t have a FLIR Lepton 3.5 that works and has radiometry support. Normally, this command would never throw an error. Did you buy the correct model of FLIR Lepton?

Hi,

Sorry I didn’t see the response earlier. Yes it is a lepton 3.5 I double checked the receipt, and it successfully works with the fir package. I was away for the past week, but occasionally the fir model has an issue detecting the Lepton and I have to reseat it to be detected, so I will try to see if that may have been the issue and repost here if I am unable to get it working, but have the FIR package running.

Thank you!

Hi,

I’m still getting the the sensor error, and am able to run the sensor utilizing the fir package. I double checked the receipt and it is a lepton 3.5.

Any ideas for steps I can do to try and get more information beyond the runtime error output?

Thank you!

Hi, you have to plug the device into the main camera sensor header via our lepton adapter bird for the snot module to work. FIR only works when it’s an external board.

So having the lepton 3.5 in the FLIR LEPTON spot designated for it on the Pure Thermal doesn’t work and I need an adapter?

Oh,

No, it’s fine then. Didn’t know what board you have. Didn’t look at the first post again.

Yeah, it’s not designed to work with the sensor module. It’s supposed to be through the FIR module.

The sensor module is for the for the OV5640 camera on the board.

I see I’ve been confusing you. Sorry about that. So, the lepton_target_temp_hostspot example is for using the FLIR Lepton when attached via this:

FLIR® Lepton® Adapter Module – OpenMV

For you, you don’t need to run that example. The FIR Module returns an array of temperature values: fir — thermal sensor driver (fir == far infrared) — MicroPython 1.22 documentation (openmv.io)

So, you already have what’s hot in the array. You can use draw_ir: fir — thermal sensor driver (fir == far infrared) — MicroPython 1.22 documentation (openmv.io)

To draw the array on an image. The default example shows that off.

Please ignore the FLIR lepton examples that use it as sensor. Those will not work on the pure thermal as the OV5640 is the main sensor. You just need to use it via the FIR module. The FIR module exposes all the features you need though. The sensor will be in measurement mode by default and provide a valid IR array of temperature readings.