Doorpanel RaspberryPi Touchscreen Alarm Panels
RaspberryPi Hardware/Software Setup
For my intial test, I'm using a RaspberryPi 3B+ and a cheap Kuman 3.5 inch 320x480 TFT LCD Touchscreen that I got on Amazon, along with a case that fits the screen and Pi.
System/Hardware Setup process
Note: Do not attach the touchscreen until instructed!
I originally tried this using the Raspbian Stretch Lite (no GUI) variant according to this blog post but was unable, over the course of two days, to get it working. I decided that since I'm using a Pi 3B+, I might as well just use the default Raspbian desktop environment and save some trouble.
- Write the Raspberry Pi Foundation's Raspbian Stretch (2018-06-27) image to SD card.
- When finished, mount the two partitions of the card (rootfs and boot) somewhere on your system.
- As root, on the boot partition,
touch sshto enable SSH login.
- Find the UID and GID of the
piuser (usually 1000:1000).
- As root, on the rootfs partition:
install -d -m 0700 -o 1000 -g 1000 home/pi/.ssh
- Find the path to your own authorized_keys file
install -m 0644 -o 1000 -g 1000 $AUTHKEYS_PATH home/pi/.ssh/authorized_keys
- Set a hostname. Using "rpi5" as an example:
echo rpi5 > etc/hostname && sed -i "s/raspberrypi/rpi5/g" etc/hosts
- Umount the partitions and eject the card. Put it in the Pi, connect a HDMI monitor and USB keyboard, and power it up.
- The Pi should boot, resize the filesystem, then reboot and eventually boot to the Raspbian graphical desktop auto-logged-in as the "pi" user.
- Go through the first two screens of the configuration "wizard"; set localization and timezone settings and password.
- Get the MAC address of the network adapter you'll be using. Set up a static lease for it, and add to WiFi ACL (if applicable).
- Configure WiFi and let the installer run updates.
- Finish and reboot.
- SSH to the instance. Assuming this works, you can log out on the console, unplug the keyboard and HDMI, and continue over SSH.
sudo raspi-config- Boot Options -> Wait for Network at Boot.
sudo apt-get install unclutter chromium-browser
nano ~/.config/lxsession/LXDE-pi/autostartand set the contents to:
@sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium-browser Default/Preferences @chromium-browser --noerrdialogs --kiosk http://guarddog:8123/local/doorpanels/index.html --incognito --disable-translate
sudo reboot- if all worked well, when the reboot is complete the system should be showing the doorpanel display full-screen.
- For the touchscreen installation (this code is awful, but it seems safe on a new system):
git clone https://github.com/jantman/LCD-show.git && cd LCD-show- it's probably worth looking at everything this does, since it seems to be pretty poorly written and has lots of open issues. When I did this work, master was at b8c10906a8501b484f98ce410b5dcc8d7aacaa73 and had just been updated four days ago.
cat /boot/cmdline.txtand record the contents, since this isn't backed up. Mine was:
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=509867d5-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
bash -ex LCD35-show
- When prompted, reboot the system. If everything works well, it should eventually boot into Chrome and show the "doorpanel" display fullscreen. If the display appears upside-down:
sudo nano /boot/config.txtand change
sudo nano /etc/X11/xorg.conf.d/99-calibration.confand before the
EndSectionline add lines for
Option "InvertY" "true"and
Option "InvertX" "true"