Skip to end of metadata
Go to start of metadata


This page will show you step-by-step how to interface a FLIR Lepton module to the BeagleBone Black/Green.

Hardware Requirements


BeagleBone Black at Digi-Key
BeagleBone Green at Digi-Key

LCD4/LCD7 for BeagleBone Black/Green:
LCD4 at Digi-Key
LCD7 at Digi-Key

FLIR Lepton:
Lepton Breakout Board at Digi-Key
FLIR CAMERA IR 80X60 50 DEGREE 9HZ at Digi-Key
FLIR CAMERA IR 80X60 25 DEGREE 9HZ at Digi-Key


Software Requirements

Install latest console image to eMMC

Today the latest version is: 2018-07-02 (these are just monthly snapshots, so always check for the latest)

IOT Image: (BeagleBone Black/Green eMMC)

sha256sum: 7f87fe91476b7dd64dadf7e5b1fa64750e2477259837c9c49c516207d68b19f5

Insert microSD into pc adapter and check device node name (in our case /dev/sdd):

voodoo@hades:~$ lsblk
sde      8:64   1   3.7G  0 disk 
└─sde1   8:65   1   3.3G  0 part 
sda      8:0    0 465.8G  0 disk 
└─sda1   8:1    0 465.8G  0 part /

Download the *.img.xz and write to microSD card via

voodoo@hades:~$ wget
voodoo@hades:~$ sudo /opt/etcher-cli/etcher -d /dev/sde BBB-blank-debian-9.4-iot-armhf-2018-07-02-4gb.img.xz
[sudo] password for voodoo: 
? This will erase the selected drive. Are you sure? Yes
Flashing: 10.85 MB/s [========================] 100% eta 0s  
Validating: 0 B/s [========================] 100% eta 0s      

  - /dev/sde: c647b4d842b4bf077116f160e7e7f650509669d2d184548581c2d68e13e244b915cdc84b58a136cd86e1810caa74f5fb4bc83930f9bfb1375ab201776ac54fed

Insert microSD into BeagleBone Black/Green and wait for flashing procedure to finish. (device should shutdown)

Utilize g_serial on usb mini connector

Since we will be using an LCD, we will be losing access to the J1 serial debug header on the baseboard, you can use the pre-loaded g_serial module via: (note, no boot logs will be shown)

gtkterm -p /dev/ttyACM0 -s 115200 &

Setup basic window manager

For this project we are going to use openbox & slim to provide a very basic desktop environment on the LCD.

sudo apt update ; \
sudo apt upgrade ; \
sudo apt install openbox slim xinit xserver-xorg-video-fbdev x11-xserver-utils git libpam-gnome-keyring feh i2c-tools unclutter

Setup /etc/X11/xorg.conf

Section "Monitor"
        Identifier      "Builtin Default Monitor"
Section "Device"
        Identifier      "Builtin Default fbdev Device 0"
        Driver          "fbdev"
Section "Screen"
        Identifier      "Builtin Default fbdev Screen 0"
        Device          "Builtin Default fbdev Device 0"
        Monitor         "Builtin Default Monitor"
        DefaultDepth    16
Section "ServerLayout"
        Identifier      "Builtin Default Layout"
        Screen          "Builtin Default fbdev Screen 0"

Check bootloader version

debian@beaglebone:~$ sudo /opt/scripts/tools/ | grep bootloader
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]

Update Kernel:

debian@beaglebone:~$ cd /opt/scripts/tools/
debian@beaglebone:/opt/scripts/tools$ sudo ./ --lts-4_14

Install device tree overlays source for LCD4/LCD7

git clone --depth=1
cd ./

Shutdown system via:

sudo systemctl poweroff

Install LCD4/LCD7 and powerup BeagleBone Black/Green

Configure SLIM for autologin

Set Default User:

# default user, leave blank or remove this line
# for avoid pre-loading the username.
#default_user        simone
default_user debian

Enable auto-login

# Automatically login the default user (without entering
# the password. Set to "yes" to enable this feature
#auto_login          no
auto_login yes

Enable openbox:

echo "exec openbox-session" > /home/debian/.xsession

Lepton qt application

Build/Install Lepton application

sudo apt install build-essential qt4-dev-tools
git clone

Apply this patch, to push the application to the upper left:

diff --git a/software/beagleboneblack_video/main.cpp b/software/beagleboneblack_video/main.cpp
index 264b0a2..f31c467 100644
--- a/software/beagleboneblack_video/main.cpp
+++ b/software/beagleboneblack_video/main.cpp
@@ -18,7 +18,7 @@ int main( int argc, char **argv )
 	QApplication a( argc, argv );
 	QWidget *myWidget = new QWidget;
-	myWidget->setGeometry(400, 300, 340, 290);
+	myWidget->setGeometry(20, 20, 340, 290);
 	//create an image placeholder for myLabel
 	//fill the top left corner with red, just bcuz

and finally build the project

cd /home/debian/LeptonModule/software/beagleboneblack_video/leptonSDKEmb32PUB/
cd ..
qmake && make

AutoStart this application on bootup:

mkdir -p /home/debian/.config/openbox/
echo "feh --bg-scale /opt/scripts/images/beaglebg.jpg" > /home/debian/.config/openbox/autostart
echo "/home/debian/LeptonModule/software/beagleboneblack_video/bbb &" >> /home/debian/.config/openbox/autostart

Increase LCD brightness

echo "echo 100 >> /sys/devices/platform/backlight/backlight/backlight/brightness" >> /opt/scripts/boot/

LCD4 Setup

Enable the "BB_SPIDEV0" overlay in /boot/uEnv.txt:


LCD7 Setup

We need P9.30 for SPIDEV1, which is the enter key on the LCD7, so disable P9.30 in BB-BONE-LCD7-01-00A3.dts

diff --git a/src/arm/BB-BONE-LCD7-01-00A3.dts b/src/arm/BB-BONE-LCD7-01-00A3.dts
index a1c7833..4fdfc2d 100644
--- a/src/arm/BB-BONE-LCD7-01-00A3.dts
+++ b/src/arm/BB-BONE-LCD7-01-00A3.dts
@@ -48,7 +48,6 @@
 		"P9.15",	/* keys: gpio1_16 LEFT */
 		"P9.23",	/* keys: gpio1_17 RIGHT */
 		"P9.16",	/* keys: gpio1_19 UP */
-		"P9.30",	/* keys: gpio3_16 DOWN */
 		"P9.21",	/* keys: gpio0_3 ENTER */
@@ -57,7 +56,6 @@
 		"gpio1_16",	/* LEFT */
 		"gpio1_17",	/* RIGHT */
 		"gpio1_19",	/* UP */
-		"gpio3_16",	/* DOWN */
 		"gpio0_3",	/* ENTER */
@@ -111,7 +109,6 @@
 					BONE_P9_15 (PIN_INPUT | MUX_MODE7) /* gpmc_a0.gpio1_16 */
 					BONE_P9_23 (PIN_INPUT | MUX_MODE7) /* gpmc_a1.gpio1_17 */
 					BONE_P9_16 (PIN_INPUT | MUX_MODE7) /* gpmc_a3.gpio1_19 */
-					BONE_P9_30 (PIN_INPUT | MUX_MODE7) /* mcasp0_axr0.gpio3_16 */
 					BONE_P9_21 (PIN_INPUT | MUX_MODE7) /* spi0_d0.gpio0_3 */
@@ -222,14 +219,6 @@
 				button@4 {
 					debounce_interval = <50>;
-					linux,code = <108>;
-					label = "down";
-					gpios = <&gpio3 16 0x1>;
-					gpio-key,wakeup;
-					autorepeat;
-				};
-				button@5 {
-					debounce_interval = <50>;
 					linux,code = <28>;
 					label = "enter";
 					gpios = <&gpio0 3 0x1>;

Then rebuild:

cd ./
make clean

Enable the "BB_SPIDEV1" overlay in /boot/uEnv.txt: