Close

Big Software Release

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 08/08/2022 at 21:000 Comments

Hardware designs for gCore and tCam-POE have gone to Group Gets for quoting and buying.  I've noticed Mouser has a lot more parts recently so maybe the great partageddon is finally showing signs of easing.

I also just pushed a bunch of new code up to github and my website.

tCam-Mini Firmware Revision 3.0

Big changes so this code base can also support tCam-POE.  I also added a mDNS (bonjour) responder so that the IP addresses of cameras on a network can be found by the various applications.  Rounding this release out were a few bug fixes plus I changed the internal flash access to use 80 MHz QIO accesses in preparation for some future firmware enhancements.

Sadly the day after I made the release I found another minor bug.   A camera that has had its WiFi reconfigured to use STA mode with a static IP address may not correctly restart the WiFi stack until the next reboot.  Easy fix that will be rolled out in a bit but odd that I didn't see this before.

A very kind soul got the previous firmware to compile on Espressif IDF 4.4.1 (instead of my ancient 4.0.2) and sent a pull request so I'll be trying to integrate his work for the next release too.

Desktop Application 3.0.0

A whole bunch of changes so I'm just copying the release notes here.

  1. New IsoTherm palette
  2. Added ability to change palettes by clicking the top or bottom of the color bar
  3. Added support to identify new Ethernet camera model
  4. Added Camera Info window (opened by new Camera->Camera Info... menu item)
  5. Application no longer displays firmware version of connected camera in main window
  6. Added new Discover function for bonjour discovery of cameras from Preferences Window
  7. Wifi/Network Settings tab understands Ethernet camera model and disables irrelevant controls
  8. Added Help window accessed through Application->Documentation menu
  9. Added ability to check for updated application automatically at startup or from Application Menu
  10. Added ability to check for new tcam/tCamMini firmware versions from Camera Menu based on connected camera type
  11. Enabled close button on About window
  12. Main Window toolbar connect button toggles between "Connect" and "Disconnect" captions
  13. Improved error message when application can't connect to camera
  14. Internal changes with window management in preparation for multi-camera sessions
  15. Signed Mac version with Apple developer ID

Here's a screen shot of the new mDNS camera discovery in operation (accessed from the Preferences Window where  you set the camera address).

Perhaps the neatest feature of the new version is the ability of the application to tell you if there is an updated version of itself or an updated version of the firmware for the attached camera and then download a zip file with the new code.

iOS App

The iOS app got the new IsoTherm palette as well as camera discovery.  The IsoTherm palette is great for quickly finding both the hot and cold spots in an image.

Python Driver

Last, but not least,  my friend bitreaper and I have been working on the Python driver to allow it to support the tCam-Mini Hardware Interface on a Raspberry Pi.  One of the things I've noticed over the years (and saw for myself) is that user space programs on the Pi have a hard time keeping up the the Lepton VoSPI pipeline.  Lots of users complaining in the forums about that. tCam-Mini with the python driver is a great solution to that problem.  In addition to communicating over a network socket the Python driver can now use the Pi's serial and SPI ports to communicate directly with a tCam-Mini.

My very first tCam-Mini PCB got new use with wires soldered directly to the ESP32 module for testing.  Here it is on a Raspberry Pi 4 running the streamtest_hw.py demo and a full speed streaming image.

The driver makes it easy to process data from the camera.  After setup the following two routines handle getting the radiometric data from the stream and converting it to an image to display using Tk.

def convert(img):

    dimg = base64.b64decode(img["radiometric"])

    ra = array('H', dimg)

    imgmin = 65535
    imgmax = 0
    for i in ra:
        if i < imgmin:
            imgmin = i
        if i > imgmax:
            imgmax = i
    delta = imgmax - imgmin
    a = np.zeros((120,160,3), np.uint8)
    for r in range(0, 120):
        for c in range(0, 160):
            val = int((ra[(r * 160) + c] - imgmin) * 255 / delta)
            if val > 255:
                a[r, c] = rainbow_palette[255]
            else:
                a[r, c] = rainbow_palette[val]
    return a

def update():
    if tcam.frameQueue.empty():
        evt.wait(.05)
    else:
        image = convert(tcam.get_frame())
        frame_image = Image.fromarray(image)
        frame_image = ImageTk.PhotoImage(frame_image)
        l1.config(image=frame_image)
        l1.image = frame_image
    l1.after(50, update)

Discussions