Using a Therm-App Camera with a Raspberry Pi-3
This article is courtesy of Giles Read.
This article will explaine how to install the software required to use the Therm-App with the Pi. Once installed, you will be able to display thermal images using a standard video player such as VLC, mplayer, etc.
Start with a fresh download of the latest Raspbian operating system. These instructions are based on the build dated 17/1/2017.
NB: some of these steps will take quite a while to complete, so please be patient.
Open a Terminal Session and start by updating and upgrading the image as follows:
sudo apt-get update && apt-get upgrade
When finished, reboot the Pi by typing: reboot
Install a couple of dependencies as follows:
sudo apt-get install -y bc libncurses5-dev libusb-1.0-0-dev
Next you need to find the correct kernel headers for your Pi. To do that, type uname -a
You should see a result that begins similar to:
Linux raspberrypi 4.4.38-v7+
In this case the headers we need are called linux-headers-4.4.38-v7+ and you should open a browser and visit the site below to locate and download them:
When the download completes, change to the Downloads directory by typing:
Now you can install the headers by typing:
sudo dpkg -i linux-headers-4.4.38-v7+_4.4.38-v7+-2_armhf.deb
NB: make sure you amend the line above to show the kernel version used on your Pi, as reported by uname earlier.
The next step is to download and install the linux loopback kernel module v4l2loopback. To install this, enter the following commands in a Terminal Session:
When complete, change to the v4l2loopback directory and build the module as follows:
sudo make && make install
The next step is to install Therm-App as follows:
Once this has downloaded, install using the following:
That completes the main installation.
The next step is to install a video player so you can view the camera output on the Pi screen. I suggest you use VLC as it’s free and works well. To install VLC type the following from a Terminal Session:
sudo apt-get install vlc
To make operation a bit simpler I suggest you create a script file to load the loopback module and start the ThermApp. To do that type the following commands:
sudo nano thermal.sh
This will open a text editor where you should enter the following:
sudo modprobe videodev
sudo insmod ./v4l2loopback.ko
Now press Control-X and answer Y to save the new file.
Make the script executable by typing:
sudo chmod +x thermal.sh
Use the Pi file manager to drag a copy of thermal.sh to the desktop. To start the camera, double-click on the desktop link and choose Execute in Terminal to start the camera. Once the calibration is complete, open VLC from the Sound & Video menu. Choose Media – Open Capture Device. Set the Capture mode to Video camera and Video device name to /dev/video0.