Pure Thermal 1 Development Board

2,978 views
Skip to first unread message

sa...@pureengineering.com

unread,
Dec 14, 2015, 2:45:56 AM12/14/15
to flir-...@googlegroups.com
Everyone, I wanted to announce the availability of the latest development board for the Flir Lepton, The Pure Thermal 1. 
From a lot of input of the ideas generated by the community here, We have the next development board. This board combines the STM32 micro-controller and the Flir Lepton to make a easy to program flexible, low cost solution to enable the next generation of Embedded Thermal Applications. The STM32 has just enough horsepower to do some basic signal processing and do something useful with it without taking a lot of power or space. 
Also out of the box it can do color, 9 Hz video over usb using the USB UVC class, so it can be quite useful for non developers as well to do evaluation and testing of the capabilities of the Flir Lepton. 
  
The PCB keeps the same 1"x1" size as the breakout board, but adds a ton of functionality. 
Check out the GroupGets product page
Source Code: Github  

Also for anyone interested there is a group buy for it, as well as limited stock at the GroupGets Store

I'll try to answer any questions about it on this post. I hope everyone enjoys using it as much as I do. 
PureThermal1.jpg

Steve Gulick

unread,
Dec 15, 2015, 11:22:20 AM12/15/15
to Flir Lepton
Hi

On the GroupGets page, there is a picture of the back of the Pure Thermal 1 which shows a u.fl connector marked video. Is that for PAL/NTSC? Is that implemented now?
What is the latency from power up to when good frames are available (either over USB or video)?

Thanks

sa...@pureengineering.com

unread,
Dec 15, 2015, 12:33:32 PM12/15/15
to Flir Lepton
Glad you asked. The analog output is considered an experimental feature at this point in time, and there is no firmware implemented at this time. There are plans in the future to test this out and publish code if it works. Anyone else (wink) is welcome to play with as well.      

The Clock for the micro controller is 14.31818 Mhz so it is tuned for NTSC output. perhaps at a future date, an PAL version of the board can be made once the NTSC output is working. 

In terms of latency from power up to good frames, you are basically limited by the lepton, as the micro has almost no boot time, I would say 1 second for the lepton to ready to be safe, but I'm sure can be optimized to be shorter. 
For USB latency, basically by the time the USB enumerates the video is ready to go. 

The hardware implementation is simply a summing of four timer outputs to a u.FL connector. 


Steve Gulick

unread,
Dec 16, 2015, 11:46:10 AM12/16/15
to Flir Lepton
Great!, Good to know!  I've now ordered a couple of the dev kits. Very interested in the NTSC output 

Marty Falatic

unread,
Dec 16, 2015, 1:41:29 PM12/16/15
to Flir Lepton
I'm looking forward to trying this out! Considering the Android video on your PureThermal1 page, what app are you using to bring the video in via USB, and what USB OTG adaptor are you using? (I ask the latter because a reliable OTG adapter can be hard to find.)

sa...@pureengineering.com

unread,
Dec 16, 2015, 10:20:08 PM12/16/15
to Flir Lepton
The Cables I used are http://www.amazon.com/gp/product/B00HVT2006, although I used others as well, and most worked fine. The device was a Nexus 5. 

For the app I used this one: https://play.google.com/store/apps/details?id=com.serenegiant.usbwebcamera  But to get it to work, I had to go into settings->expert and enable compatibility mode. I tired like all the free usb camera apps on the play store, this was the only one I could get working.  My guess is none of them supported a video of 60x80.  Making a custom app with 60x80 support would most likely be the best option. 

Andr Sam

unread,
Dec 20, 2015, 9:44:02 AM12/20/15
to Flir Lepton
My guess is none of them supported a video of 60x80.  Making a custom app with 60x80 support would most likely be the best option.

What if to change resolution for example to 640*480 by bilinear or bicubic interpolation? I mean to change the code of PureThermal1's firmware.

sa...@pureengineering.com

unread,
Dec 22, 2015, 2:12:06 AM12/22/15
to Flir Lepton
I think 640x480 is too much bandwidth for the stm32, but perhaps 160x120 would be better supported. 

Peter Gear

unread,
Jan 5, 2016, 11:24:12 PM1/5/16
to Flir Lepton
Hi!

Received PureThermal1 kit & 50deg shuttered Lepton just today and all worked OK on PC, tested on two different linux systems using guvcview software.
Your good guide helped alot: https://github.com/groupgets/purethermal1-uvc-capture

Problem is I did not get it to work with Android phone, Samsung S3 4.4.4, kernel 3.0.31 (3447006)
I also tried pretty much all free "usb cam uvc" programs from the google play store but none gave an image, allthough most seemed to find the device ok.

The "compatibility" mode wals also allready enabled on the "UsbWebCamera" https://play.google.com/store/apps/details?id=com.serenegiant.usbwebcamera software, but fiddling with all settings did not help.

Cam Free-USB Web Camera https://play.google.com/store/apps/details?id=com.econsystems.webeecamtrial Found the device and even gives the 80x60 resolution selectable on both, image & video modes, but no image can still be seen.

"Mobile Scope" https://play.google.com/store/apps/details?id=infinitegra.bigc.usbcamera program even gives options for uncompressed and YUV420P etc for recording(storage?) but still did not get it to work and could really be ment to work with certain usb microscopes only.

I wonder what might be the biggest issue here. Image format? Do these android software expect MJPEG?

I was using a "cheap" USB OTG cable, but it does work ok with micro-SD's etc, but that might be one issue though.

Also when the Dev board is connected to a USB, before it is powered on from the tiny switch, the "Li-Ion" white led flickers faintly like crazy, then after power-up, it goes solid and the "power-led" insteads keeps flickering, all this while the unit is operational, working good, connected to a PC. this might be normal but just giving some info.

Well, enough questions and rants, hope we can find some answers to get this working!

Thanks!

-PG



Marty Falatic

unread,
Jan 6, 2016, 3:16:18 PM1/6/16
to Flir Lepton
I got mine the other day and it all works great with Serenegiant's UsbWebCamera (both the Free and Pro versions). I'm curious why yours already had compatibility mode on though? Try uninstalling UsbWebCamera completely and then reinstalling it... either it's something Samsung specific that somehow auto-enables compatibility mode, or you've got other old settings that ended up breaking functionality (I had to specifically switch that mode ON when I first installed it on my Nexus6).

Other webcams don't work - I suspect they just won't upscale enough or the framerate is not to their liking. Personally I'd rather see an app that overlays the camera and the IR feeds if anyone ever creates one that specifically works with the Lepton.

sa...@pureengineering.com

unread,
Jan 6, 2016, 3:19:29 PM1/6/16
to Flir Lepton
For the app I used this one: UsbWebCamera  https://play.google.com/store/apps/details?id=com.serenegiant.usbwebcamera  But to get it to work, I had to go into expert settings->compatibility feature set to ON. I tired like ALL the free usb camera apps on the play store, this was the only one I could get working.  

Perhaps try a regular usb webcam and see if that works, if you can't get that working, my guess is your phone either doesn't support UVC or external usb devices powered it that way. 
I think the biggest issue with the android apps are the resolution or the colormap or color format not being supported. 


The led near the li-ion text normally does quick short blinks, if there is no Li-ion battery attached. this is normal. 
Also when turning on the device, the led near the ON/OFF starts a slower longer blinking, again this is normal. 


Peter Gear

unread,
Jan 13, 2016, 2:15:40 PM1/13/16
to Flir Lepton
Ok, thanks for the replies!
I will test the re-installing, good catch Marty.
My bet is also on the color format area, as I understand Lepton dev board wont push out MJPEG (as regular webcams do)?
Other webcams have worked ok on the phone earlier, so that should be covered.

Lepton app would be great, yes!
- Android / IOS versions
- Phones own camera image with Lepton thermal image overlayed on top (even with opacity adjustment.. ala "MSX"!)
- Recording of the resulting composite video (maybe through screen captures/buffer if no direct way?)
- Radiomterics..manual gain..so on..so on.. I guess its not possible to control the STM32 chip through usb though.

Well, Ill report back !

Peter Gear

unread,
Jan 13, 2016, 3:03:35 PM1/13/16
to Flir Lepton
No luck.
Did a reinstall & reboot, compatibility was still default on.
Tried to toggle all settings & expert settings on/off one at a time and with different max framerates, but nothing.

Powering the Lepton on/off while connected, does change the message in the software correctly, from
"No USB Web camera found. Please confirm connections to USB Web camera"
to
"Could not show preview, out of range. Please confirm camera parameters"

MJPEG/UYV mode did not make any difference.
Also tried with another, shorted usb cable.

In MJPEG mode, pressing the small ON/OFF button in preview screen(to try to reset/connect to the cam with new settings), the text stays in ON-mode for about a half a second in
MJPEG mode, but even shorter when in YUV.

So I guess, at least with this software and 4.4.4 Samsung S3..this is broken.

Let me know if you find another program, or get it to work..would be great.
Getting tired running around in the dark with by laptop..heh.

Marty Falatic

unread,
Jan 13, 2016, 7:49:53 PM1/13/16
to Flir Lepton
Long story short, I'm looking into this, but it may be that Android < 5.0 is not going to be as easy to make work.

Marty Falatic

unread,
Jan 14, 2016, 6:03:53 AM1/14/16
to Flir Lepton
Long story long...

While pondering this today, I found https://github.com/saki4510t/UVCCamera (and immediately forked at https://github.com/MartyMacGyver/UVCCamera).

As I looked at the code I noticed how it was hard-wired for MJPEG and UYV.

Then I read your note here again and took a closer look at the existing app and realized that they were probably related.

And then I noticed a familiar name in one of the paths in the repo:

Turns out this is the same person that wrote the only app that works for us, and the code is open-source. Since this appears to be the basis for what they use in the app, odds are that this UVCCamera library can be made to work for the Lepton as well (the app is nice but very generalized - imagine doing camera overlays or other Lepton-specific processing?)

Technically this library should be able to handle more formats, such as BGR24 (which seems to correspond to UVC_FRAME_FORMAT_BGR in the code) which would be more appropriate to the Lepton from what I've read. Whether this will work any better in pre-Lollipop (5.0) Android than the app itself is uncertain, but this could be a great foundation for an open-source Android app for the Lepton.

I'll dabble with this as time permits... I think I know what needs to be changed in the code to at least attempt to make BGR24 or GREY8 work. Meanwhile, I've submitted a lengthy cleanup pull request that cleans up the Readme and makes this project (much) easier to build in Android Studio:


Kurt Kiefer

unread,
Jan 21, 2016, 3:40:57 PM1/21/16
to Flir Lepton
This is really cool.

One small note to be aware of regarding UVC_GUID_FORMAT_BGR3. On pure Linux kernels < 4.0 (where today's android versions were forked mid 3.x) the UVC driver does not convert this format to the v4l2 format V4L2_PIX_FMT_BGR24. See:

BRG24 would be ideal, yes. But if the kernel does not support it, applications that leverage libv4l2 will emulate this format and generate it from RGBP, so at some loss to color resolution (which admittedly is rather hard to observe). Now, I'm not 100% sure if Android kernels have patched this code, so just take this at face value.

Note though that this is the reason that the PT1 does RGBP (RGB565) and UYVY formats. Also, UYVY and YUY2 are about the most common format out there for webcams, and most every webcam program on the planet supports this format.

Now, I think where we run into the most problems with compatibility is from the tiny 80x60 frame size. Most programs expect at least 160x120 or 320x240 out of USB webcams.

HTH

Marty Falatic

unread,
Jan 21, 2016, 4:29:54 PM1/21/16
to Flir Lepton
I mentioned BGR because just because that seems to be what the software is detecting as the native format from the camera (even if it's not actually decoding it). I haven't delved into how to tell the camera to output in other formats besides what it seems to be serving after powering up.

As for the Kernel subtleties, I suspect that self-reported format is why "compatibility mode" exists in the Play Store software this is based on (this mode appears to be turned on automagically on older devices, as noted earlier in this thread). I'm doubtful that the frame size is a problem at all here - the format the camera self-reports as using may just not be one most software bothers to handle.


Marty Falatic

unread,
Jan 23, 2016, 2:06:38 PM1/23/16
to Flir Lepton
I've been busy, but with a few changes to the original code (less than I expected) I've got a somewhat unstable first release of the forked USB camera code that will work with this device:

Release (code and debug APK):
https://github.com/MartyMacGyver/UVCCamera/releases

Code:
https://github.com/MartyMacGyver/UVCCamera/tree/lepton-work-mff1

Give it a try - it should work on any Android >= 4.3 but it could be that 5.x has some benefits I'm not aware of. Let me know how it goes...

sa...@pureengineering.com

unread,
Jan 23, 2016, 7:41:00 PM1/23/16
to Flir Lepton
Just tried your release apk app on my nexus 6p, and it worked great on the first try.  Although it crashes now (perhaps a reboot would fix it). Anyhow this looks to be a good path forward for future efforts with lepton on android!. Nice Work!

Marty Falatic

unread,
Jan 23, 2016, 8:53:56 PM1/23/16
to Flir Lepton
It's relatively stable on mine (crashes on connect sometimes but I've yet to reboot despite numerous crashes). Which Android are you running on that? 6.0 or 5.1?

The code itself is quite complex - my next goal is to upgrade some of the included libraries on the main branch and fold that into mine, though I'm not sure that will have any positive effect on stability. For all that, it's a start - would be interesting to overlay the main camera onto this somehow.

Kelvin Ruiz

unread,
Feb 29, 2016, 11:48:56 AM2/29/16
to Flir Lepton
I recently purchased a couple PureThermal1's and haven't had any luck getting your app to work. However, standard WebCams work with the UVCCamera Github project that your's is based on as well as other USB WebCam apps from the play store.

Any tips? 

I also get the following messages using the UsbWebCamera app:
"Could not show preview, out of range. Please confirm camera parameters" using "compatibility feature". Without it I don't get an error but the screen stays black.

I've tried various phones and development boards with no luck:
Nexus 6 on Android 6
Nexus 5x on Android 6
Galaxy S4 on Android 5
Galaxy S5 on Android 5
LG G3 5.1.1
Moto X on Android 6
Inforce 6540 Dev. board on Android 5
Dragonboard 410c on Android 5.1.1

Marty Falatic

unread,
Mar 1, 2016, 7:10:14 AM3/1/16
to Flir Lepton
So at this point neither board has actually worked?

Some possibilities (note that I'm not associated with the manufacture or design of these boards!):

The Thermal1 board isn't powered on (sometimes mine comes on automatically and sometimes I need to press its power button)
The USB OTG adapter you have isn't working properly (but it's working with other webcams...)
There is something unique about your phone/OS combos
The Lepton modules aren't fully seated in the boards (seems unlikely but worth a look)
The boards are somehow defective (two in a row seems unlikely)

The app people have been using prior to mine certainly ought to work enough to get an image IMHO, so beyond what's above I'm at a loss.

sa...@pureengineering.com

unread,
Mar 1, 2016, 11:21:19 AM3/1/16
to Flir Lepton
Just to add a couple more points. 
Make sure the board works as a webcam on a PC. if on windows I recommend using http://www.yawcam.com/
 The board does have to be turned on, by pressing the on/off button.  if you want it to auto turn on when plugged into USB please read this post. https://groups.google.com/forum/#!topic/flir-lepton/-bjZR-EIXxU

If this works, then the thermal camera should be functioning. 

I have verified on a nexus 6 with android 6, so that phone should work with 'usbwebcamera'. 
when using https://play.google.com/store/apps/details?id=com.serenegiant.usbwebcamera&hl=en, you have to goto expert settings, then turn on compatibility feature. otherwise it won't work. 




Kelvin Ruiz

unread,
Mar 1, 2016, 4:28:51 PM3/1/16
to Flir Lepton

I tested the two boards/cameras on Linux and Mac and I can see the video feed perfectly. However on Android I only get a black screen. When I use the saki4510/UVCCamera project, with Compatibility feature ON the logs says "could not negotiate with camera". With Compatibility turned off I see a "setPreviewSize" error. With your app the only error message I see is "E/ViewRootImpl: sendUserActionEvent() mView == null"


I pasted some of the output below. 


Using saki4510t/UVCCamera:


With Compatibility ON:


03-01 15:20:24.345 8786-9804/? E/UVCPreview: [9804*UVCPreview.cpp:254:setPreviewSize]:could not negotiate with camera:request format=9,size(80,60),fps(1,30),err=-51

03-01 15:20:24.345 8786-9804/? E/UVCPreview: [9804*UVCPreview.cpp:254:setPreviewSize]:could not negotiate with camera:request format=3,size(80,60),fps(1,30),err=-51


With Compatibility Off:

03-01 15:20:41.892 8786-9804/? E/libandrousb: [9804*uvc_client.cpp:198:setPreviewSize]:mPreview->setPreviewSize:err=-12



This is the output I see when using your thermalcamviewer:


03-01 16:17:05.567 22709-22709/com.serenegiant.thermalcamviewer V/USBMonitor: requestPermission:device=UsbDevice[mName=/dev/bus/usb/002/003,mVendorId=7758,mProductId=256,mClass=239,mSubclass=2,mProtocol=1,mManufacturerName=GroupGets,mProductName=PureThermal 1,mSerialNumber=000000000001,mConfigurations=[

                                                                              UsbConfiguration[mId=1,mName=null,mAttributes=128,mMaxPower=50,mInterfaces=[

                                                                              UsbInterface[mId=0,mAlternateSetting=0,mName=null,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[

                                                                              UsbEndpoint[mAddress=130,mAttributes=3,mMaxPacketSize=8,mInterval=32]]

                                                                              UsbInterface[mId=1,mAlternateSetting=0,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[]

                                                                              UsbInterface[mId=1,mAlternateSetting=1,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[

                                                                              UsbEndpoint[mAddress=129,mAttributes=1,mMaxPacketSize=482,mInterval=1]]]]

03-01 16:17:05.577 22709-22709/com.serenegiant.thermalcamviewer V/USBMonitor: processConnect:

03-01 16:17:05.587 22709-22709/com.serenegiant.thermalcamviewer V/MainActivity: onConnect:

03-01 16:17:05.587 22709-22733/com.serenegiant.thermalcamviewer V/CameraThread: handleOpen:

03-01 16:17:05.597 22709-22733/com.serenegiant.thermalcamviewer V/CameraThread: handleClose:

03-01 16:17:05.597 22709-22733/com.serenegiant.thermalcamviewer V/CameraThread: handleStopRecording:mMuxer=null

03-01 16:17:05.617 22709-22709/com.serenegiant.thermalcamviewer V/UVCCameraTextureView: getPreviewTexture:

03-01 16:17:05.617 22709-23009/com.serenegiant.thermalcamviewer I/UVCCameraTextureView: RenderThread#updatePreviewSurface:

03-01 16:17:05.617 22709-23009/com.serenegiant.thermalcamviewer D/UVCCameraTextureView: release mPreviewSurface

03-01 16:17:05.627 22709-23009/com.serenegiant.thermalcamviewer V/GLDrawer2D: deleteTex:

03-01 16:17:05.627 22709-23009/com.serenegiant.thermalcamviewer V/GLDrawer2D: initTex:

03-01 16:17:05.627 22709-23009/com.serenegiant.thermalcamviewer V/UVCCameraTextureView: getPreviewSurface:tex_id=1

03-01 16:17:05.627 22709-22709/com.serenegiant.thermalcamviewer E/ViewRootImpl: sendUserActionEvent() mView == null (THIS IS THE ONLY ERROR I SEE)

03-01 16:17:05.667 22709-22733/com.serenegiant.thermalcamviewer I/MainActivity: supportedSize:{"formats":[{"index":1,"type":4,"default":1,"size":["80x60"]},{"index":2,"type":4,"default":1,"size":["80x60"]},{"index":3,"type":4,"default":1,"size":["80x60"]},{"index":4,"type":4,"default":1,"size":["80x60"]},{"index":5,"type":4,"default":1,"size":["80x60"]},{"index":6,"type":4,"default":1,"size":["80x60"]},{"index":7,"type":4,"default":1,"size":["80x60"]}]}

03-01 16:17:05.667 22709-22733/com.serenegiant.thermalcamviewer V/CameraThread: handleStartPreview:

03-01 16:17:05.667 22709-22733/com.serenegiant.thermalcamviewer V/CameraThread: handleClose:

03-01 16:17:05.667 22709-22733/com.serenegiant.thermalcamviewer V/CameraThread: handleStopRecording:mMuxer=null

Kurt Kiefer

unread,
Mar 1, 2016, 4:42:50 PM3/1/16
to Flir Lepton
I haven't used this program, so I don't know if it's a setting, but the problem I see here is the 30 FPS it's trying to set. The PT1 only has frame descriptors for 9 FPS.

Kelvin Ruiz

unread,
Mar 2, 2016, 4:14:43 PM3/2/16
to Flir Lepton
I still get a black screen when setting the max FPS to 9 on the app as shown below.

03-02 11:23:08.575 17937-17964/? E/UVCPreview: [17964*UVCPreview.cpp:254:setPreviewSize]:could not negotiate with camera:request format=3,size(80,60),fps(1,9),err=-51

Chun-Kai Hwang

unread,
Mar 14, 2016, 9:41:24 PM3/14/16
to Flir Lepton
Hi,

 We get the source code from
 https://github.com/MartyMacGyver/UVCCamera/tree/0.1.1
 We use the apk (thermalcamviewer-debug.apk) from
 https://github.com/MartyMacGyver/UVCCamera/releases/tag/0.1.1
 and find that it only shows black image.

 We add log in https://github.com/MartyMacGyver/UVCCamera/tree/0.1.1
 and find that setPreviewSize failed. (both with FRAME_FORMAT_YUYV and
 FRAME_FORMAT_MJPEG )
 Would you please help to check how to make it to preview successfully
 The following are logs


>> 03-11 07:56:00.331 27520-27547/com.serenegiant.thermalcamviewer
>> D/dalvikvm: Added shared
>> lib /data/app-lib/com.serenegiant.thermalcamviewer-1/libUVCCamera.so
>> 0x41d11d10
>>
>>
>> 03-11 07:56:00.461 27520-27547/com.serenegiant.thermalcamviewer

>> I/MainActivity:
>> supportedSize:{"formats":[{"index":1,"type":4,"default":1,"size":["80x60
>> "]},{"index":2,"type":4,"default":1,"size":["80x60"]},{"index":3,"type"
>> :4,"default":1,"size":["80x60"]},{"index":4,"type":4,"default":1,"size"
>> :["80x60"]},{"index":5,"type":4,"default":1,"size":["80x60"]},{"index":
>> 6,"type":4,"default":1,"size":["80x60"]},{"index":7,"type":4,"default":
>> 1,"size":["80x60"]}]}
>>
>>
>> 03-11 07:56:00.461 27520-27547/com.serenegiant.thermalcamviewer
>> V/CameraThread: handleStartPreview:
>>
>>
>> 03-11 07:56:00.461 27520-27547/com.serenegiant.thermalcamviewer
>> E/libUVCCamera:
>> [27547*stream.c:526:uvc_get_stream_ctrl_format_size_fps]:uvc_get_stream_
>> ctrl_format_size_fps start
>>
>> 03-11 07:56:00.461 27520-27547/com.serenegiant.thermalcamviewer
>> E/libUVCCamera:
>> [27547*stream.c:547:uvc_get_stream_ctrl_format_size_fps]:uvc_get_stream_
>> ctrl_format_size_fps no found -51
>>
>> 03-11 07:56:00.461 27520-27547/com.serenegiant.thermalcamviewer
>> I/MainActivity: setPreviewSize: 80x60 PREVIEW_MODE=1 falied
>> exception=Failed to set preview size
>>
>> 03-11 07:56:00.461 27520-27547/com.serenegiant.thermalcamviewer
>> I/MainActivity: startPreview start
>>
>>
>> 03-11 07:56:00.461 27520-27547/com.serenegiant.thermalcamviewer
>> I/MainActivity: startPreview end
>>
>>
>> 03-11 07:56:00.461 27520-27650/com.serenegiant.thermalcamviewer
>> E/libUVCCamera:
>> [27650*stream.c:526:uvc_get_stream_ctrl_format_size_fps]:uvc_get_stream_
>> ctrl_format_size_fps start

Marty Falatic

unread,
Mar 14, 2016, 9:50:17 PM3/14/16
to Flir Lepton
Chun-Kai,

Thanks for posting your question here!

Does the webcam app in the Play store work any better for you?

https://play.google.com/store/apps/details?id=com.serenegiant.usbwebcamera

(My demo app is derived from the same parent source tree as that one evidently was, but that one is more stable and generalized).

See also previous replies in this thread, including how to test your Thermal1 in Windows.

I'm curious to hear if the known-good methods work any better or at all.

Kelvin Ruiz

unread,
Mar 16, 2016, 10:15:47 AM3/16/16
to Flir Lepton
Is there a way to verify the firmware version installed on the camera? I'm thinking about re-flashing it with the latest firmware. 
Message has been deleted

Chun-Kai Hwang

unread,
Mar 17, 2016, 12:53:41 AM3/17/16
to Flir Lepton
after modify the following codes, thermal cam is workable

From 4286f346741c6b48de1b4ca09e38979ff5ba4bb5 Mon Sep 17 00:00:00 2001
From: erichwang <eric...@chipsip.com>
Date: Thu, 17 Mar 2016 10:58:17 +0800
Subject: [PATCH] fix thermal camrea preview failed setting USE_EOF to 1 Mantis
 ID: 0000623

---
 libuvccamera/src/main/jni/libuvc/src/stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libuvccamera/src/main/jni/libuvc/src/stream.c b/libuvccamera/src/main/jni/libuvc/src/stream.c
index ed17059..dd243e4 100644
--- a/libuvccamera/src/main/jni/libuvc/src/stream.c
+++ b/libuvccamera/src/main/jni/libuvc/src/stream.c
@@ -642,7 +642,7 @@ static void _uvc_delete_transfer(struct libusb_transfer *transfer) {
  EXIT();
 }
 
-#define USE_EOF
+#define USE_EOF 1
 
 /** @internal
  * @brief Process a payload transfer


diff --git a/libuvccamera/src/main/jni/libuvc/src/stream.c b/libuvccamera/src/main/jni/libuvc/src/stream.c
index 33453ff..ed17059 100644
--- a/libuvccamera/src/main/jni/libuvc/src/stream.c
+++ b/libuvccamera/src/main/jni/libuvc/src/stream.c
@@ -528,6 +528,9 @@ uvc_error_t uvc_get_stream_ctrl_format_size_fps(uvc_device_handle_t *devh,
  memset(ctrl, 0, sizeof(*ctrl)); // XXX add
  /* find a matching frame descriptor and interval */
  uvc_format_desc_t *format;
+      //modified by eric 20160317 to avoid setPreviewSize failed
+ LOGE("<<<<<<<<<<<<<<<<<< cf = UVC_FRAME_FORMAT_UYVY");
+ cf = UVC_FRAME_FORMAT_UYVY;
  DL_FOREACH(devh->info->stream_ifs, stream_if)
  {
  DL_FOREACH(stream_if->format_descs, format)
-- 

Subject: [PATCH] fix crash at copySurface Mantis ID: 0000623

---
 libuvccamera/src/main/jni/UVCCamera/UVCPreview.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libuvccamera/src/main/jni/UVCCamera/UVCPreview.cpp b/libuvccamera/src/main/jni/UVCCamera/UVCPreview.cpp
index 1ce3183..1f095ad 100644
--- a/libuvccamera/src/main/jni/UVCCamera/UVCPreview.cpp
+++ b/libuvccamera/src/main/jni/UVCCamera/UVCPreview.cpp
@@ -571,7 +571,9 @@ static void copyFrame(const uint8_t *src, uint8_t *dest, const int width, int he
  memcpy(dest, src, width);
  dest += stride_dest; src += stride_src;
  }
- for (int i = 0; i < height; i += 8) {
+ //modified by eric 2016-03-16 to avoid overflow
+ //for (int i = 0; i < height; i += 8) {
+ for (int i = 0; i < height-h8; i += 8) {
  memcpy(dest, src, width);
  dest += stride_dest; src += stride_src;
  memcpy(dest, src, width);
-- 

Marty Falatic

unread,
Mar 17, 2016, 1:00:48 AM3/17/16
to Flir Lepton
Wow..... is that based on my repo or the original one?

If it's mine, I've enabled the "Issues" link on it and will happily accept this as a pull request (or I can add the patch).

Kelvin Ruiz

unread,
Mar 17, 2016, 1:20:46 PM3/17/16
to Flir Lepton
I made the changes but it was still not working for me. However, I did noticed the following:

I/libUVCCamera: [7252*UVCPreview.cpp:492:prepare_preview]:frameSize=(80,60)@MJPEG

Which can't be right since the camera doesn't support MJPEG. 

In side UVCPreview::prepare_preview 
There are several locations where the variable requestMode is being negated (!) for example:
!requestMode ? UVC_FRAME_FORMAT_YUYV : UVC_FRAME_FORMAT_MJPEG

Wherever I saw that I removed it and in one occasion I added it and it works now.

thermalcamviewer I/libUVCCamera: [7252*UVCPreview.cpp:492:prepare_preview]:frameSize=(80,60)@YUYV
I/libUVCCamera: [7254*UVCPreview.cpp:258:callbackPixelFormatChanged]:PIXEL_FORMAT_RAW:

This is probably just a workaround but for now it is working!

Thanks!

Kurt Kiefer

unread,
Mar 17, 2016, 1:41:15 PM3/17/16
to Flir Lepton
Hey guys, this is awesome!

It took an /extremely/ quick look at the uvccamera source on Marty's git, and it looks like the application uses libusb/libuvc under the hood (through JNI), which means that you're not restricted to android's UVC-V4L2 limitations. Flexibility abounds!

I have two thoughts/observations.

1. There could be something hokey going on under the covers when using the YUVY type. If you can, you should use UVC_FRAME_FORMAT_UYVY -- just to be assured this code doesn't make an additional, intermediate conversion step before inevitably turning into RGB. We unfortunately call the color definition YUYV in the PT1 code, but if you look at the USB descriptors it's actually the UYUV type.

2. On the face of it, you might be able to capture RGB directly with a couple changes. Here is the enumeration of data types that are defined:

enum uvc_frame_format {
UVC_FRAME_FORMAT_UNKNOWN = 0,
/** Any supported format */
UVC_FRAME_FORMAT_ANY = 0,
UVC_FRAME_FORMAT_UNCOMPRESSED,
UVC_FRAME_FORMAT_COMPRESSED,
/** YUYV/YUV2/YUV422: YUV encoding with one luminance value per pixel and
* one UV (chrominance) pair for every two pixels.
*/
UVC_FRAME_FORMAT_YUYV,
UVC_FRAME_FORMAT_UYVY,
/** 16-bits RGB */
UVC_FRAME_FORMAT_RGB565, // RGB565
/** 24-bit RGB */
UVC_FRAME_FORMAT_RGB, // RGB888
UVC_FRAME_FORMAT_BGR, // BGR888
/* 32-bits RGB */
UVC_FRAME_FORMAT_RGBX, // RGBX8888
/** Motion-JPEG (or JPEG) encoded images */
UVC_FRAME_FORMAT_MJPEG,
UVC_FRAME_FORMAT_GRAY8,
UVC_FRAME_FORMAT_BY8,
/** Number of formats understood */
UVC_FRAME_FORMAT_COUNT,
};

Not so fast! Here is where it actually converts into the UVC format GUID: https://github.com/MartyMacGyver/UVCCamera/blob/0.1.1/libuvccamera/src/main/jni/libuvc/src/stream.c#L73

Note that only the formats defined are these:

FMT(UVC_FRAME_FORMAT_YUYV, {'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})
FMT(UVC_FRAME_FORMAT_UYVY, {'U', 'Y', 'V', 'Y', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})
FMT(UVC_FRAME_FORMAT_GRAY8, {'Y', '8', '0', '0', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})
FMT(UVC_FRAME_FORMAT_BY8, {'B', 'Y', '8', ' ', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})

MAYBE it's as simple as adding another for 24-bit RGB (RGB888) (see here for all of the available formats on the PT1: https://github.com/groupgets/purethermal1-firmware/blob/master/Middlewares/ST/STM32_USB_Device_Library/Class/video/Inc/usbd_uvc.h#L90-L112):

FMT(UVC_FRAME_FORMAT_RGB, {0x7d, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70})

Anyhow really good stuff, guys!

Kurt Kiefer

unread,
Mar 17, 2016, 1:44:47 PM3/17/16
to Flir Lepton
Correction:
We unfortunately call the color definition YUYV in the PT1 code, but if you look at the USB descriptors it's actually the UYUV type

I meant to say:
We unfortunately call the color definition YUYV in the PT1 code, but if you look at the USB descriptors it's actually the UYVY type 

Also, I didn't link to the source where the data type enumeration lives, here it is: https://github.com/MartyMacGyver/UVCCamera/blob/0.1.1/libuvccamera/src/main/jni/libuvc/include/libuvc/libuvc.h#L86 
Message has been deleted

Mike M.

unread,
Apr 3, 2016, 5:34:17 PM4/3/16
to Flir Lepton
Hello

Could someone put a link to his working source code or his working apk .
I am getting a black screen although he detects the pt1 camera.
I have tryed all kinds of software but the same result.
Is it an android issue because with windows and linux it's working fine.

Regards,
  Mike M.

Marty Falatic

unread,
Apr 3, 2016, 5:56:44 PM4/3/16
to Flir Lepton
Mike - First of all, is https://play.google.com/store/apps/details?id=com.serenegiant.usbwebcamera working for you?

Second, I have been busy on other projects but I had hoped to get a pull request for the code at https://groups.google.com/d/msg/flir-lepton/xhoyFCFIIQQ/XQifI98BIQAJ. That said, I will now look at integrating it directly, then I can post an updated APK shortly after that if it works.

 - Marty

Marty Falatic

unread,
Apr 3, 2016, 7:02:05 PM4/3/16
to Flir Lepton
Here's what I've learned so far:

The first patch (#define USE_EOF vs #define USE_EOF 1) has no net effect (the value of USE_EOF is never used, only its existence is tested). Skipped.

The second patch (cf = UVC_FRAME_FORMAT_UYVY;) actually breaks the app for me so I've left it out until someone chimes in here.

The third patch dramatically improved stability - where it would crash quite a lot before the app doesn't want to crash at all now! Thank you - I've included this.


Marty Falatic

unread,
Apr 3, 2016, 7:23:52 PM4/3/16
to Flir Lepton
I've released an update to my app that contains part of Chun-Kai's patch that stops the app from crashing all the time.

Important: Uninstall the old version first!

While this works great for me, clearly it may not work for everyone.

I also opened the issue tracker on my fork for issues and discussion on my particular app.
Message has been deleted

Rishi A

unread,
Jul 15, 2016, 10:11:31 AM7/15/16
to Flir Lepton
Hello,

I have had no luck getting the usb web camera app from the play store or the thermal camera viewer posted here to work on my galaxy s7 edge and a galaxy note 10 tablet.  I am having the same problem of getting a black screen although the camera is recognized.  I am wondering if anyone has made any progress recognizing why its not working?  I have tried modifying the application in android studio also but no luck.

Rishi A

unread,
Jul 15, 2016, 10:24:26 AM7/15/16
to Flir Lepton
Forgot to mention it works perfectly on windows

cn...@uncc.edu

unread,
Nov 1, 2016, 12:06:59 PM11/1/16
to Flir Lepton
Does anyone know when another batch of these will be available?

GroupGets

unread,
Nov 1, 2016, 11:24:13 PM11/1/16
to Flir Lepton
A new batch of PureThermal 1's should start assembly later this week and be on our shelves by late next week. We'll post when we have them.

GroupGets

unread,
Nov 19, 2016, 10:51:43 PM11/19/16
to Flir Lepton
FYI PureThermal 1 is back in stock in our store. The hardware is unchanged from the last batch.

Nicolás Menoni

unread,
Jan 10, 2017, 6:32:33 AM1/10/17
to Flir Lepton
Hi! How can I load the PT1 0.99.2 (for Lepton 2.5) firmware without the JTag adapter? (only via USB port)
Thanks.

Nicolás Menoni

unread,
Jan 10, 2017, 7:54:38 AM1/10/17
to Flir Lepton
Ok. I followed the steps from the purethermal1-firmware github but I get the following error, Can someone help me find the cause of the error? Thanks:


MBP-de-Nicolas:pt1-v0.99.2+Y16 nico$ dfu-util -a 0 -d 0483:df11 -D pt1-v0.99.2+Y16.bin -s 0x08000000
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash  "
Downloading to address = 0x08000000, size = 97432
Download [                         ]   0%            0 bytesdfu-util: dfuse_download: libusb_control_transfer returned -1


Thanks.

Kurt Kiefer

unread,
Jan 10, 2017, 3:09:00 PM1/10/17
to Flir Lepton
The github documentation is a little out of date in this regard -- most newer boards won't go into DFU mode. This is why the programming adapter exists.

At some point after the first few batches of PT1, ST started shipping MCUs that would no longer DFU. We sent back 10 samples for failure analysis but came up short, they basically said there's no problem and found no fault. Well sure, except for the fact they won't go into DFU mode!

The good news is with the programming adapter, it's super simple... plug in board, turn it on, then:

st-flash erase
st-flash --reset write /path/to/firmware.bin 0x08000000

Kurt Kiefer

unread,
Jan 10, 2017, 3:22:52 PM1/10/17
to Flir Lepton
I should clarify a couple things, when I say "won't go into DFU", I mean that most boards won't get as far as yours got. Some fail right away during the download (like yours), some manage to make it all the way through by chance. There's a possibility that if you retry a few times, or plug into a hub, or something else, it /might/ work. But the point is, DFU is unreliable and probably won't work.

Also for anyone following along with the programming adapter, the st-flash program is part of texane/stlink (http://github.com/texane/stlink.git). On Mac OS in homebrew this is part of the "stlink" package.

Nicolás Menoni

unread,
Jan 10, 2017, 4:00:19 PM1/10/17
to Kurt Kiefer, Flir Lepton
Kurt, thank you for the answer.
When you say "programming adapter", do you mean to the JTAG adapter (GG-28) only or to the JTAG adapter + ST-Link/v2 Programmer?
In other words, do I really need the ST-Link/v2 or only with the JTAG adaptaer I can load the new firmware? (Note: I know that for the JTAG adapter I need a TTL-to-USB converter too)

Thanks.

2017-01-10 17:22 GMT-03:00 Kurt Kiefer <keki...@gmail.com>:
I should clarify a couple things, when I say "won't go into DFU", I mean that most boards won't get as far as yours got. Some fail right away during the download (like yours), some manage to make it all the way through by chance. There's a possibility that if you retry a few times, or plug into a hub, or something else, it /might/ work. But the point is, DFU is unreliable and probably won't work.

Also for anyone following along with the programming adapter, the st-flash program is part of texane/stlink (http://github.com/texane/stlink.git). On Mac OS in homebrew this is part of the "stlink" package.

--
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+unsubscribe@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/9e798114-cadd-4733-8c74-e36636239b24%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Kurt Kiefer

unread,
Jan 10, 2017, 4:41:36 PM1/10/17
to Flir Lepton, keki...@gmail.com
When I say programming adapter I do indeed mean the ARM MCU JTAG adapter (https://store.groupgets.com/#!/ARM-MCU-JTAG-Adapter-for-PureThermal-1). But this just breaks out connections, so you additionally need a JTAG/SWD device to perform the actual programming. You do not need UART to USB.

An STLink/V2 works great and is pretty cheap, but if you already have a Segger JLink or other JTAG programmer you can use this with OpenOCD.

Ellis Akins

unread,
Feb 25, 2017, 1:38:26 AM2/25/17
to Flir Lepton
Hi Kurt,

I am unable to get this ThermalViewer app to work correctly with the PT1 on android 5.1.1 and 7.0, but the PT1 works great on windows (VLC). The only android app that I can find which works is the UsbWebCamera by serenegiant, but the colors gradient was green and purple, and this is compatibility mode off and MJPEG mode. I tried cloning the UVCCamera projects and building them but get error -51, wrong mode.

I noticed in the GetThermal repo there is a modified version of libuvc, could this be used on the android platform? I was looking at your suggestion above and wondered if this could be used in android with the RAD mode. What is the default frame format the PT1 is set to deliver, and how and when is this changed, the CCI or is it negotiated? I currently have a PT1 w/o Y16 FW.

Also do you know if the UART debug is enabled by default on the PT1? I tried reading the debug UART with a FTDI board to the GND,TX and RX pins at the end, through level translators. I see some data on the scope, but the terminal is all random characters at 115200.

Thanks!

Pure Engineering

unread,
Feb 25, 2017, 2:32:19 PM2/25/17
to Ellis Akins, Flir Lepton
in terms of the uart speeds 
#ifdef USART_DEBUG // this happens by 'make USART_DEBUG=1' or when USART_DEBUG is enabled above
#undef THERMAL_DATA_UART
#define USART_DEBUG_SPEED (115200)
#else
#define USART_DEBUG_SPEED (921600)
#endif

so in dubug mode its 115200, but if its outputting thermal data its 921600 to get the full framerate out. 

--
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+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/flir-lepton.

For more options, visit https://groups.google.com/d/optout.



--
Sashi Ono
Principal Embedded Systems Engineer

Ellis Akins

unread,
Feb 25, 2017, 2:44:10 PM2/25/17
to Flir Lepton, ellis...@gmail.com
Thank you. So by default (purchased from GroupGets) the PT1 outputs thermal data and not the debug?
To unsubscribe from this group and stop receiving emails from it, send an email to flir-lepton...@googlegroups.com.

Ellis Akins

unread,
Feb 26, 2017, 1:21:22 PM2/26/17
to Flir Lepton, ellis...@gmail.com
I was able to get the PT1 working with android with this app with this commit :

https://github.com/ellisakins/UVCCamera/commit/636deeba1fe54a01d83048fc2cc52c3fab06dc36

Not the best permanent solution but it did the job for me. Hope this helps someone!

Marty Falatic

unread,
Feb 26, 2017, 6:48:38 PM2/26/17
to Flir Lepton, ellis...@gmail.com
I commented on your repo - definitely curious to see this in action for myself.

When I forked the repo originally, I did a lot of cleanups that were rejected by serenegiant without explanation. So I'm not sure how much work it'll be to update to their mainline work - assuming they actually fixed the Android 7 problems with their app in that repo. If I can use what they did and it works, great. If not, this will be the direction I go for this.
Message has been deleted

aix

unread,
Mar 1, 2017, 6:02:08 AM3/1/17
to Flir Lepton, ellis...@gmail.com
Hi,
I have an issue that the frame rate on of the Pure Thermal 1 board is unstable and averages around 6,6fps. Tried this on Windows 10 (with DirectShow) and Ubuntu 14.04. I have tried this on several computers, with several modules (v1 and v1.2), and several firmware versions, and always get the same result. Anyone else experienced this issue? What could I be doing wrong?
Regards,
Andrei

Anaqi Pek

unread,
May 24, 2019, 12:10:32 AM5/24/19
to Flir Lepton
Hi I am encountering a problem with the updated app. It detects the pure thermal 1 camera, but does not show any display (black screen). the webcam app on the play store by serenegiant also does not work.
Im using a SABRESD MX6DQ tablet. Any help is appreciated. thank you! 
Reply all
Reply to author
Forward
0 new messages