Inhaltsverzeichnis
Embedded Display on a Raspberry Pi
Install raspian OS lite with the rpi-installer. Use for the settings
- ssh enabled
- use a unique host name for your device
- use the host name as username
- use a unique password. Store username and password at a safe place
After installation and first boot, log in via ssh
Install missing packs
sudo apt update && sudo apt upgrade sudo apt-get install --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox python3-tk git lightdm
For the display driver, follow the instruction from https://joy-it.net/en/products/RB-TFT3.5, which are
git clone https://github.com/goodtft/LCD-show.git chmod -R 755 LCD-show cd LCD-show/
Depending on the display size, use
sudo ./LCD32-show
or
sudo ./LCD35-show
After reboot and relogin, do
sudo raspi-config
Go into System Options
/ Boot / Auto Login
. Select Desktop Autologin
to start the window manager at boot
Add the following commands to /etc/xdg/openbox/autostart
# Disable any form of screen saver / screen blanking / power management xset s off xset s noblank xset -dpms
# Allow quitting the X server with CTRL-ATL-Backspace setxkbmap -option terminate:ctrl_alt_bksp
Append the following lines to ~/.bashrc
### start the xserver at startup ### [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor
Clone all needed libraries, e.g. pyUMenu
cd git clone https://github.com/stko/pyUMenu.git git clone all_the_others...
Create and activate a python virtual environment in your final application directory, here e.g. pyUMenu
cd pyUMenu python3 -m venv .venv source .venv/bin/activate
Add the cloned libraries to your virtual environment
pip install -e ../my_library pip install -e ../all_the_others...
Add your program to the openbox autostart by nano $HOME/.config/openbox/autostart
like eg.
cd $HOME/pyUMenu .venv/bin/python pyumenu_demo.py
Make the System Read-Only
After finishing and testing, make the system read-only with raspi-config
To be descripted here
Calibrate the Touchscreen
If needed, the touchscreen can be calibrated
sudo apt install xinput-calibrator
run it:
DISPLAY=:0 xinput_calibrator
copy the generated output into
sudo nano /etc/X11/xorg.conf.d/99-calibration.conf