2022-05-23 18:03:18 +02:00
2022-05-23 18:03:18 +02:00
2026-08-21 14:38:52 +02:00
2026-08-21 14:38:52 +02:00

pyLCDInfo

Display current Linux/network info on a 16×2 LCD via I2C.

Features

  • Shows IPv4 and IPv6 for multiple network interfaces
  • Displays <interface> not connected gracefully when an interface is unavailable — no crashes
  • WireGuard VPN state detection with animated waiting screen
  • Startup sequence showing kernel version, OS version, MAC addresses, and WireGuard endpoint
  • Backlight turns off automatically once VPN is connected

Startup screens (2 s each)

Screen Content
Welcome "Offsite Backup" banner
Kernel Running kernel version (uname -r)
OS Pretty name from /etc/os-release
MAC <iface> MAC address per interface (repeated for each)
WG Endpoint Resolved hostname or IP of the WireGuard peer

Install

apt-get install i2c-tools pip python3-dev
pip3 install rpi_lcd netifaces

Search for the I2C LCD controller on bus X (0, 1, 2, 3, …) and note the device address:

i2cdetect -y X

Usage

python3 pyLCDinfo.py <iface1> [iface2 ...] <wireguard_iface> <disk_path>

Arguments (in order):

Position Description
iface1 [iface2 ...] One or more local network interfaces (e.g. eth0 eth1)
wireguard_iface WireGuard interface name (e.g. wg0)
disk_path Path to monitor for free disk space (e.g. /mnt/hdd/backups)

Examples:

# Single interface
python3 pyLCDinfo.py eth0 wg0 /mnt/hdd/backups

# Multiple interfaces
python3 pyLCDinfo.py eth0 eth1 wlan0 wg0 /mnt/hdd/backups

systemd service

nano /lib/systemd/system/LCDinfo.service
[Unit]
Description=LCD info
After=syslog.target
After=network.target

[Service]
Type=simple
User=root
Group=root
Restart=on-failure
RestartSec=5s
ExecStart=sudo /usr/bin/nice -n 19 sudo -u root /usr/bin/python3 /root/pyLCDinfo.py end0 wlx000f007740cd wg0 /mnt/hdd/backups

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable /lib/systemd/system/LCDinfo.service
systemctl start LCDinfo.service
S
Description
display current linux/network info on a 16x2 LCD via I2C
Readme AGPL-3.0
48 KiB
Languages
Python 100%