Radiometric Lepton example code on Pi Zero?

463 views
Skip to first unread message

Peter Jansen

unread,
Mar 5, 2017, 2:20:19 AM3/5/17
to Flir Lepton
Hi there,

I have a couple quick questions, if someone much more familiar with the inner workings of the PureThermal 1 board has a moment (I am only just beginning with it): 

1) Radiometric data on the Pi: Would there happen to be any example code that will easily compile/run on the Pi Zero for observing/exporting temperature values per pixel from the radiometric Lepton?  I recently tried getting the QT example to work, and after a few hours that ultimately lead to trying to compile QT for the Pi I gave up.  The uvc-radiometry.py example looks promising (and much simpler), but I thought I'd see how much of an issue this is on the Pi (I see a modified version of libuvc has to be downloaded and compiled) before beginning. Is there an example that just dumps the temperature data per pixel to a file, say in CSV format?

2) Power consumption:  Would there happen to be specifications for how much current the PureThermal 1 draws when idle?  In my application it will likely be idle 90% of the time, and (my application being battery powered, but powering the PureThermal 1 from USB) I was wondering if it has a high power draw, and if there's a way to place it into a low power mode when data isn't actively being requested, or if this happens automatically?

3) Mounting: Is there a recommended way of mounting the PureThermal 1? Are the large 5V/GND terminals intended to double as mount terminals for small screws, or does the user have to make a clamshell-style holder for the current revision of the board?

thanks,
Peter



Kurt Kiefer

unread,
Mar 6, 2017, 12:15:13 AM3/6/17
to Flir Lepton
(1) none of the code in groupgets/LeptonModule supports the PT1 board, it is all for the SPI breakout. All the examples for PT1 are in https://github.com/groupgets/purethermal1-uvc-capture

uvc-radiometry.py is the most complete out of the box you can find as far as imaging with Y16. The libuvc build is really not hard, just follow the instructions. You might also have a look at v4l2/grab in there as well. This will have to be modified to download a different format for radiometric data (V4L2_PIX_FMT_Y16) but then it should do just about what you want -- it writes images to files on disk as PPM (a text-based image format).

(2) there is no attempt made to conserve power with the board. It constantly reads data from the Lepton. It could be added by any motivated person to the open source firmware, for example, when a UVC stream is not enabled. Which sounds about like what would make sense for you.

(3) yes, that is their primary purpose, just insulate as required

Peter Jansen

unread,
Mar 10, 2017, 3:06:59 AM3/10/17
to Flir Lepton
Thanks for your note.  I've worked through installing the PureThermal1 examples on the Pi, and have the opencv-capture.py working, but the two UVC examples ( uvc-deviceinfo.py and uvc-radiometry.py ) give the error "uvc_open error" when running.  This is after compiling/installing the special libuvc on the purethermal github repository, and also making a copy of libuvc.so to purethermal1-uvc-capture/python just incase it was a path error.

The Pi is connected to a hub (zero4u) with the PureThermal 1 and two other usb devices -- a wifi adapter and a wireless keyboard/mouse adapter.

I've tried looking through the uvc-radiometry.py example, but I'm afraid I'm not very familiar with libuvc.  It looks like it's using Line 199 to find the camera:

res = libuvc.uvc_find_device(ctx, byref(dev), 0, 0, 0)

but not passing in any vendor/device ID (the 0's), so just looking for any device in general (I think that's what's defined by the context ctx).

There is a Raspberry Pi camera board attached -- is it possible that it's locking onto this? I've tried pouring through the PureThermal 1 lepton firmware for a vendor/device ID to plug these in, but it's a lot of code, and I'm not terribly familiar with USB video protocols?

thanks,
Peter
Reply all
Reply to author
Forward
0 new messages