This document explains how to launch a NAP application on a Raspberry PI 4B in kiosk mode, without a desktop manager, outputting to a single (X) window using Raspbian Bullseye Lite. The command line is hidden and replaced with a splash image. This guide serves as an example and can be applied to pretty much any type of (graphical) application. Feel free to adjust it where appropiate.
Download and write the Bullseye Lite image to SD card or use the Raspberry Pi Imager to create the image for you.
Insert card in Raspberry Pi and boot.
Use the following command to install the required packages:
This installs the X Window system display server. The server will be started by the xinit
program when you log in. Other required packages include the mesa vulkan driver
to render graphics using NAP and Plymouth
to display the splash screen during boot.
Open boot/config.txt
for writing:
Add the following lines:
Disable the rainbow image, bluetooth overlay and set boot delay time to 0 seconds.
Boost the default CPU & GPU clock speed (if required). I found these settings work well with a passively cooled Raspberry Pi 4 using heat-sinks. Use & tweak at your own risk!
Open boot/cmdline.txt
for writing:
Add the follwing arguments to the existing arguments:
This tells the commandline to:
KERN_WARNING
, which suppresses all but very serious log messages during boot.Make sure to adjust the HDMI settings based on your display requirements.
Disable the bluetooth service by executing the following command:
Enter the following command to change the default theme:
Hides the display of terminal console messages on top of the splash screen. Open the pix.script
file for writing:
And disable the SetUpdateStatusFunction
callback at the end of the file:
Replace the splash.png
image in /usr/share/plymouth/themes/pix
, example:
Open the tty1 autologin.conf
script for for writing:
Replace the line after ExecStart=-
with:
This ensures johndoe
is logged in automatically after system boot. Change johndoe
to your username.
To surpress all login messages, create a .hushlogin
file:
Browse to the directory where you want to install the application, for example:
Download and extract the application:
Do whatever is required to setup your application.
Create a .xinitrc
file in your home directory. This file is executed by xinit
on startup and allows you to run graphical programs that depend on X and set environment variables on X server startup. Create .xinitrc
if it doesn't exist yet:
Open .xinitrc for writing:
Add the following content (example):
This script tells X Window System server which HDMI output to use and the orientation of the display. The various xset
commands disable the blank screen, which occurs after 10/15 minutes if no user input is proved. xset -dpms
disables display power management signaling, xset s off
disables screen saver blanking, xset s noblank
tells the X server to not blank the video device. We then instruct the script to run the app
in myapp
.
These are the settings associated with the Waveshare 7.9" LCD display. Consult the documentation of your display to acquire the right settings, if required.
Add the following lines to /boot/config.txt
Copy 40-libinput.conf
to /etc/X11/xorg.conf.d/
:
Open the file for writing:
Rotate the touch interface by 180 degrees by changing the CalibrationMatrix
option to:
All rotation Matrices:
Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"
Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"
NAP Framework is open source software. Suggestions and contributions are welcome.
Coen Klösters | Technical Director | NAP & NAP Labs