Help for beginner on the code/software for the PT2 and Radiometric lepton 3.5 - Pure thermal, UVC, libusb and libuvc errors.

1,679 views
Skip to first unread message

Joshua Ingham

unread,
Jun 14, 2018, 7:23:22 AM6/14/18
to Flir Lepton

Hi,

I am a beginner to device prototyping and software development so please bare with me.
I have bought and am trying to use a PT2 and 3.5 radiometric lepton to thermally image an electronic heating element circuit, the temperature range of the image is 200-80 degrees. 

Once the thermal image is taken I want to be able to determine the temperature of each pixel (or temperatures within the area) (which as discussed in the forum seems a hard thing to do). 

In addition I do want the ability to see the settings of the camera and adjust them (as people have done with the auto gain feature and radiometric modes/ compensation). 

Finally the lepton is stated to have two gain modes, in high a range up to about 100 degrees, and in low gain a range upto about 300 degrees, how would I go about switching from low and high gain modes.

So far I am able to get a good stream of video through the PT2 UVC to VLC or to the PureThermalDemo software (although its features do not work).

 Problem being to take capture through both of these software gives an output not in Y16 or in JPG/bitmap to then be analysed. 

What I have also tried is:

GetThermal-0.1.2 - Tried to use with Qt but I am getting a  Unsupported Windows toolchain, only Visual Studio 2010, 2012, and 2013 are supported error- I have visual studio 2013 installed ( Do I have to reinstall the compiler). 

purethermal1-firmware-1.0.0-pt2 - Cant seem to get working. 

purethermal1-uvc-capture-master - have been able to get the operncv-capture python script to work but the other python scripts output ( error: libusb not installed) although I have done everything I can to install it and verify it.

pylepton- I get:

When running Lepton.py.
 
Traceback (most recent call last):
  File "C:\Users\inghamj3\Desktop\Thermal camera downloads\pylepton-master\pylepton\Lepton.py", line 9, in <module>
    from .ioctl_numbers import _IOR, _IOW
ValueError: Attempted relative import in non-package

When running setup.py  

Traceback (most recent call last):
  File "C:\Users\Desktop\Thermal camera downloads\pylepton-master\setup.py", line 6, in <module>
    import pylepton
  File "C:\Users\Desktop\Thermal camera downloads\pylepton-master\pylepton\__init__.py", line 4, in <module>
    from .Lepton import Lepton
  File "C:\Users\Desktop\Thermal camera downloads\pylepton-master\pylepton\Lepton.py", line 10, in <module>
    from fcntl import ioctl
ImportError: No module named fcntl

I have also tried Max's DIY thermocam software, specifically the thermal analysis software, it works in a way but I cant take the y16 jpg to then analyse and it throws up my antivirus for some reason. 

Being new to Python, MatLab and application programming like this seems to make this quite hard and due to the complexity of the different modules you have to download and try to get working I am really struggling, if anyone can help with this then That would be much appreciated, If I finally get to the end of this I may write a begginers guide to getting set up as their seems to be a lack of foolproof documentation on this. 

If anyone if very experienced in this and knows exactly how I can get up and running I would be very keen to talk to you and need some tutoring through Skype if anyone is keen enough to help. 

If there are any materials or documents that you would recommend me to read to learn more of how to do this please link it. 

Thank you. 



Andrew V. Jones

unread,
Jun 14, 2018, 7:48:37 AM6/14/18
to Joshua Ingham, Flir Lepton
Hi Josh,

> purethermal1-uvc-capture-master - have been able to get the
> operncv-capture
> python script to work but the other python scripts output ( error:
> libusb
> not installed) although I have done everything I can to install it and
> verify it.
>

Are you doing this on Linux (your backtraces look like you’re on
Windows)?

I have no idea if the UVC stuff works on Windows, but potentially not
(or, potentially “hard”):

https://github.com/ktossell/libuvc/issues/12

I have achieved something “very similar” (modulo an “unhappy
Lepton”) using a Raspberry Pi. If you are interested in doing stuff
with Linux, I can attempt to help.

Cheers,

Andrew
> --
> You received this message because you are subscribed to the Google
> Groups "Flir Lepton" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to flir-lepton...@googlegroups.com.
> Visit this group at https://groups.google.com/group/flir-lepton.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/flir-lepton/4d30cf8f-a8b0-46f2-bab9-810b7e15b90e%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Andrew V. Jones

unread,
Jun 14, 2018, 8:09:12 AM6/14/18
to Joshua Ingham, flir-...@googlegroups.com
Hi Josh,

I fortunate enough to be able to say that, if it isn’t on Linux, I
really don’t know! Maybe someone else on the list knows about the
Windows-based support for the UVC capture stuff.

Also, I’ve never touched Matlab for this kind of stuff, so I can’t
help there either.

Cheers,

Andrew


On 14 Jun 2018, at 12:55, Joshua Ingham wrote:

> Currently on Windows yes, looking at the documentation
> on purethermal1-uvc-capture github it does state that it works in
> windows
> which is odd.
>
> If It is going to be very easy to do on Linux I would be prepared to
> set it
> up but I only have a little bit of experience in linux and would need
> to
> install it on my machine.
>
> I currently dont hhave access to a Pi I was hoping that using the PT2
> would
> allow me to do it straight from the computer.
>
> I have also heard that through the uvc capture on Matlab that I can do
> it
> that way, again no experience in matlab so would learn from the ground
> up
> but if possible would happily learn it.
>
> On Thu, Jun 14, 2018 at 12:48 PM, Andrew V. Jones
> <andrewv...@gmail.com>

Kurt Kiefer

unread,
Jun 14, 2018, 12:45:16 PM6/14/18
to Flir Lepton
Likewise. I'm not a Windows developer so none of the code examples I was able to put together are set up for it.

I have heard reports of success with Matlab, not sure the platform, but I would hope that would be the same everywhere. This seems like a good place to start if you have access to the software. It has a capture 

In the firmware for the device itself, if you're looking to upgrade this, note that the development branch has recently merged in a few pull requests since the last release which are related to compatibility with Windows for the control interface, so it's getting used, but I haven't seen a windows application using this with my own eyes yet. We'll be stamping a new binary release with these changes very soon, so be on the lookout for that.

As far as the gain modes, these can be switched through the control interface, but you'd first need a working application to do this. GetThermal is currently the only solution I know of right now, but like you've found that's just for Mac and Linux.

Kurt

Kurt Kiefer

unread,
Jun 14, 2018, 12:48:25 PM6/14/18
to Flir Lepton
Sorry, to complete a half thought:

I have heard reports of success with Matlab, not sure the platform, but I would hope that would be the same everywhere. This seems like a good place to start if you have access to the software. It has a capture 

It has a capture interface built in that sound work without external dependencies: https://www.mathworks.com/hardware-support/matlab-webcam.html

I'm not sure if it can send arbitrary UVC extension unit commands to do things like change the gain mode, it would be good to know about this one way or the other if someone has experience with it.

Kurt

David nunya

unread,
Jun 20, 2018, 7:57:47 PM6/20/18
to Flir Lepton
Linux has a matlab clone called Octave.  It, too, is free.  Just now starting to learn it so don't know how well it handles peripherals yet.

And to the OP, sounds like your Qt environment is not set up yet for your system.  Look through your kits and see what is complaining.

Also, OP, I think you will be MUCH happier working this tool in Linux.
 
Just ordered a Lepton 3.5 and similar hardware to yours so am keenly interested in getting this joker working, too.

Skypuppy


Joshua Ingham

unread,
Jun 27, 2018, 12:14:15 PM6/27/18
to Flir Lepton
Finally got set up a laptop with linux and have everything working alright, trying to implement getTHermal I am getting:


Starting /home/packard/build-GetThermal-Desktop_Qt_5_7_0_GCC_64bit-Debug/debug/GetThermal...

QML debugging is enabled. Only use this in a safe environment.

uvc_open: Access denied (-3)

UVC initialized

Device found

Surface set. Supported formats: 18 19 22 23 3 1 10 8 5

qrc:/controls/CameraControls.qml:56: TypeError: Cannot read property 'objectName' of null

Surface supports format 0 width -1 height -1qrc:/controls/VideoRoi.qml:18: TypeError: Cannot read property 'height' of undefined

qrc:/controls/VideoRoi.qml:17: TypeError: Cannot read property 'width' of undefined

qrc:/controls/VideoRoi.qml:16: TypeError: Cannot read property 'y' of undefined

qrc:/controls/VideoRoi.qml:15: TypeError: Cannot read property 'x' of undefined

qrc:/ViewerForm.ui.qml:57: TypeError: Cannot read property 'radSpotmeterRoi' of null

qrc:/ViewerForm.ui.qml:53: TypeError: Cannot read property 'supportsRadiometry' of null

qrc:/ViewerForm.ui.qml:69: TypeError: Cannot read property 'supportsRadiometry' of null

qrc:/controls/SpotInfo.qml:11: TypeError: Cannot read property 'radTLinearResolution' of null

qrc:/controls/SpotInfo.qml:46: TypeError: Cannot read property 'radSpotmeterInKelvinX100' of null

qrc:/controls/RangeDisplay.qml:11: TypeError: Cannot read property 'radTLinearResolution' of null

UVC exited


And GetThermal opens and I get



Any advice on how to rectify?
Auto Generated Inline Image 1

Andrew V. Jones

unread,
Jun 27, 2018, 12:23:01 PM6/27/18
to Joshua Ingham, Flir Lepton
Try running GetThermal as root (use `sudo`).

You probably need the udev rules listed here:

https://github.com/groupgets/GetThermal/wiki/Building-for-Raspberry-Pi

Cheers,

Andrew
> Any advice on how to rectify?
>
> On Thursday, 21 June 2018 00:57:47 UTC+1, David nunya wrote:
>>
>> Linux has a matlab clone called Octave. It, too, is free. Just now
>> starting to learn it so don't know how well it handles peripherals
>> yet.
>>
>> And to the OP, sounds like your Qt environment is not set up yet for
>> your
>> system. Look through your kits and see what is complaining.
>>
>> Also, OP, I think you will be MUCH happier working this tool in
>> Linux.
>>
>> Just ordered a Lepton 3.5 and similar hardware to yours so am keenly
>> interested in getting this joker working, too.
>>
>> Skypuppy
>>
>>
>> <<<snip>>>
>> <https://www.mathworks.com/hardware-support/matlab-webcam.html>
>>>
>>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Flir Lepton" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to flir-lepton...@googlegroups.com.
> Visit this group at https://groups.google.com/group/flir-lepton.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/flir-lepton/83ccae44-3eff-4f1d-aece-f98b8947f30b%40googlegroups.com.

Joshua Ingham

unread,
Jun 27, 2018, 12:43:16 PM6/27/18
to Flir Lepton
I have been running the code through qt, how do you use sudo through qt, thought that was just in the terminal.
used
sudo sh -c "echo 'SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"1e4e\", ATTRS{idProduct}==\"0100\", SYMLINK+=\"pt1\", GROUP=\"usb\", MODE=\"666\"' > /etc/udev/rules.d/99-pt1.rules"
 in the terminal.
when runnign the code through qt getting the same errors.
what else could it be?
I am running it through my laptop not a pi btw.

Andrew V. Jones

unread,
Jun 27, 2018, 12:47:11 PM6/27/18
to Joshua Ingham, Flir Lepton
I think you somehow replied to an older email …

Rather than doing `./GetThermal`, do `sudo ./GetThermal`.

Cheers,

Andrew
> --
> You received this message because you are subscribed to the Google
> Groups "Flir Lepton" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to flir-lepton...@googlegroups.com.
> Visit this group at https://groups.google.com/group/flir-lepton.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/flir-lepton/8eb15daf-3d08-4849-bb15-eaa14b51e1d6%40googlegroups.com.

Joshua Ingham

unread,
Jun 27, 2018, 12:53:09 PM6/27/18
to Flir Lepton
Oh Ok I am a bit of the way there:
Auto Generated Inline Image 1

Kurt Kiefer

unread,
Jun 27, 2018, 1:09:05 PM6/27/18
to Flir Lepton
Looks like you're a lot of the way there!

Another thing you can do, is set up a udev rule to give all users access to UVC devices:

sudo sh -c "echo 'SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"1e4e\", ATTRS{idProduct}==\"0100\", SYMLINK+=\"pt1\", GROUP=\"usb\", MODE=\"666\"' > /etc/udev/rules.d/99-pt1.rules"

Sara Stafford

unread,
Jun 27, 2018, 4:55:09 PM6/27/18
to Flir Lepton
I just received the PT2 board today and have been working on setting it up.  I followed all the GroupGets instruction, including setting up udev to give all users access to uvc devices, but have just been getting the blank screen with the temperature bar as shown above when I try to run GetThermal.  Is there anything else I could be missing?  Raspberry Pi 3 B with radiometric Lepton 3.5.

Sara

Kurt Kiefer

unread,
Jun 27, 2018, 4:58:39 PM6/27/18
to Flir Lepton
Could you post the console output that you get when you try to run the program?

Sara Stafford

unread,
Jun 29, 2018, 10:34:03 AM6/29/18
to Flir Lepton
It's working now, for some reason!  Thanks!
Reply all
Reply to author
Forward
0 new messages