Close

Updated tCam-Mini code - contributed enclosure

A project log for Lepton 3.5 Thermal Imaging Camera

Documenting my experiments with the FLIR Lepton 3.5 thermal imaging camera.

dan-julioDan Julio 02/06/2022 at 21:410 Comments

There are always bugs...

A user set a password on his tCam-Mini and found the unit bricked!  Fortunately he emailed me asking what was going on.  Turns out he had set a password with less than 8 characters but the code configures the wifi stack to use WPA security (which requires >= 8 characters).  The camera had stored the password and then every time it booted and tried to start the wifi stack, the Espressif wifi library threw an error because of the bad password and my startup code froze blinking an error message.  Unfortunately I didn't sample the button when in the boot error condition so the camera was effectively bricked.  Fortunately a reload of the firmware using the Windows utility fixed the user's immediate problem.

Time for code changes.  I fixed this bug in two places.  The camera's firmware which will now ignore wifi updates with an illegal password (or ssid) and also allows a wifi reset even in the boot error condition.  I also modified the desktop application to display a pop-up error message for an illegal password instead of just blindly sending it.

There are some other issues in the Desktop application fixed.  I use a bilinear interpolation algorithm to try to generate a smooth image when it is magnified from the Lepton's native 160x120 pixel resolution to whatever higher resolution the application is showing.  Turns out the code is compute intensive enough that the application's controls could become unresponsive when streaming at the full 8.7 fps to a large window.  I didn't really see this on my OS X machine but a couple of people complained about the application freezing on Windows and Linux machines (probably some difference in the way xojo handles the event loop).  I fixed this problem two ways.  I increased xojo's optimization levels and I added a new preference to disable bilinear interpolation.  There is still some smoothing from the built-in image magnification routines.  Now even on a Raspberry Pi 4 (the slowest computer I test on) you can get full frame rate displays in large windows.

Both the firmware and new app versions are on my website and in the github repository.  If you've already loaded FW version 2.0 on your camera then you can use the desktop application to update the FW to version 2.1 (with just the "tCamMini.bin" file) instead of having to run the Espressif Windows utility.

Contributed Enclosure

I also finally got a new 3D printer (a Prusa i3 MKS+ that I highly recommend) and could print a copy of the enclosure that Zeke Gustafson designed for tCam-Mini.  He sent it to me with permission to share.  This is now in the repository and on my website.  Thank you Zeke!

Discussions