Screens and Touch
Which screens work, the installer’s options, rotation, touch calibration, and the kiosk that shows Layer1 on the screen.
Supported screens
| Screen | Installer option | Notes |
|---|---|---|
| 3.5″ ILI9486 SPI with XPT2046 touch (Waveshare (A), most clones) | piscreen (the default) | Uses the driver built into Raspberry Pi OS. Try this first. |
| The same screen, with Waveshare’s own driver | waveshare35a | If piscreen stays white. Needs Waveshare’s overlay file first, see below. |
| HDMI screens (5″, 7″, any size) | none | No driver needed. Layer1’s layout grows to fill the screen. |
| A screen you already set up (e.g. with LCD-show) | none | Leaves your driver alone and installs only the kiosk. |
At 480×320 you get exactly what the screenshots on this site show. Bigger screens give the extra room to the camera, the layer gauge and the controls.
Installer options
sudo bash "$L1/install.sh" # 3.5" ILI9486 screen, landscape
sudo bash "$L1/install.sh" piscreen 270 # the same, upside down
sudo bash "$L1/install.sh" waveshare35a # Waveshare's own driver
sudo bash "$L1/install.sh" none # HDMI, or a driver you set up yourselfThe second option is the rotation: 90 (landscape, the default) or 270 (landscape, upside down). Layer1 is laid out for landscape. The installer is safe to run again, for example to change the rotation, and it keeps your kiosk settings. Reboot after running it.
Check the screen
After the reboot, this reports what the Pi sees of the screen and its touch controller:
bash "$L1/check-screen.sh"Add test to also fill the small screen with coloured static for two seconds. If you see it, the driver works:
sudo bash "$L1/check-screen.sh" testWaveshare’s driver
If the screen stays white with piscreen, try Waveshare’s own overlay. Download waveshare35a.dtbo from Waveshare’s 3.5inch RPi LCD (A) wiki page, copy it into the boot overlays folder, then run the installer with waveshare35a:
sudo cp waveshare35a.dtbo /boot/firmware/overlays/ # /boot/overlays/ on older systems
sudo bash "$L1/install.sh" waveshare35a
sudo rebootThis driver needs the older framebuffer mode, so the installer also comments out the vc4-kms-v3d line in the boot config. Undoing it puts that line back.
Undo the screen driver
The installer adds its lines to the boot config (config.txt) between two marker comments, and comments out other screen overlays that would conflict with it. It saves a timestamped backup first. To take it all back out:
sudo bash "$L1/setup-screen.sh" remove
sudo rebootTouch calibration
If taps land in the wrong place, run the calibration and tap each crosshair:
sudo layer1-kiosk calibrateWhen it finishes, the screen shows a set-touch command with nine numbers. Run it to save them. If the axes are just swapped or mirrored, one of the quick fixes is faster:
sudo layer1-kiosk rotate-touch 90 # also 0, 180, 270
sudo layer1-kiosk rotate-touch swap # x and y swapped
sudo layer1-kiosk rotate-touch invert-x # or invert-y
sudo layer1-kiosk reset-touch # back to noneYou can also open the calibration from the screen: More → Display.
The kiosk
The kiosk is a system service, layer1-kiosk, that starts X and Chromium full screen at boot. Control it with the layer1-kiosk command:
layer1-kiosk status # is it running?
layer1-kiosk logs # recent log output
sudo layer1-kiosk restart # also start, stop
sudo layer1-kiosk uninstall # remove the kioskKiosk settings
Its settings are in /etc/layer1-kiosk.conf. Edit it with sudo nano /etc/layer1-kiosk.conf, then apply with sudo layer1-kiosk restart.
| Setting | Default | Meaning |
|---|---|---|
URL | http://127.0.0.1/plugin/layer1/static/index.html | The page to show: Layer1, served by the plugin. |
FBDEV | auto | The screen’s framebuffer. auto picks the first one that isn’t HDMI, and falls back to HDMI when there’s none. Set e.g. /dev/fb1 if it picks wrong. |
TOUCH_MATRIX | empty | Nine numbers that map touches to the screen. calibrate and rotate-touch set it for you. |
TOUCH_DEVICE | ADS7846|[Tt]ouch | Which input devices get the touch matrix: a pattern matched against the names xinput list shows. |
API_KEY | empty | An OctoPrint API key. Leave it empty and pair from the screen instead, so the key never sits in this file. |
CHROMIUM_FLAGS | --disable-gpu | Extra Chromium flags. |
SCALE | 1 | Zoom. Raise it if everything looks too small on a large screen. |
Removing it
sudo layer1-kiosk uninstall removes the kiosk service and its files. It keeps /etc/layer1-kiosk.conf, and leaves Xorg and Chromium installed. To remove those too:
sudo apt remove xserver-xorg-core xinit chromium-browser chromium && sudo apt autoremoveTo turn the screen driver off, see Undo the screen driver. Remove the plugin itself in OctoPrint under Settings → Plugin Manager. Do that last, since the commands above come with it. If you removed the plugin first, layer1-kiosk uninstall still works. See also Troubleshooting.