This repository contains the source code and configuration for the Local Knowledge Hub, a Raspberry Pi-based offline server designed to deliver educational content (Wikipedia, Khan Academy) to classrooms without internet access.
It tracks the evolution of the project from a simple static HTML page to a complex, hardware-aware dashboard with real-time telemetry.
versions/: Contains the HTML/CSS/JS for every iteration of the landing page.v0.x: Basic static links.v1.x: Interactive UI with sticky headers and flip cards.v2.x: Live hardware monitoring (CPU, RAM, Solar Power Flow).
services/: Python backend scripts (metrics_server.py,power_server.py) that provide JSON APIs for the dashboard.systemd/: Service files to auto-start the web servers and APIs on boot.
Basic setup of the Hotspot and Kiwix server.
- Download
kiwix-toolsfor ARM64/ARMv7 (depending on your Pi). - Download ZIM files (e.g.,
wikipedia_en_simple.zim).
Copy systemd/kiwix-serve.service to /etc/systemd/system/.
- Note: Edit the
ExecStartline to point to your specific.zimfiles.
Introduces a modern, responsive design using CSS Grid and Flexbox.
- v1.0: Implemented the "Sticky Header" design for better navigation.
- v1.1: Added "Flip Cards" to showcase hardware specs (Pi Zero 2W, 18650 Battery, etc.).
- Credits: Updated project team section to feature lead developer Purujith Kadekar.
This phase introduces real-time monitoring of the Raspberry Pi's health (CPU, RAM, Uptime).
- Copy the metrics server:
mkdir -p /home/pi/landing sudo cp services/metrics_server.py /home/pi/landing/
- Enable the service:
sudo cp systemd/metrics.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable metrics sudo systemctl start metrics - Verify: Open
http://10.42.0.1:9000/metricsin your browser. You should see JSON data.
- Choose v1.2 (Text Metrics) or v1.3 (Visual Gauges) from the
versions/folder. - Copy the contents to
/home/pi/landing/.
This phase transitions the project from a simple dashboard to a hardware-aware monitoring system, visualizing the solar power flow and tracking connected client proximity.
- Copy the additional Python scripts:
sudo cp services/power_server.py /home/pi/landing/ sudo cp services/stats_updater.py /home/pi/landing/
- Enable the services:
sudo cp systemd/power.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable power sudo systemctl start power
- v2.0 (Static Flow): Introduces the SVG diagram showing Solar -> Battery -> Pi flow.
- v2.1 (Animated Flow): Adds staggered animations to the power lines for a "live" current effect.
- v2.2 (Production - Safe): The stable deployment version. Includes full telemetry and flow charts but hides the "Connected Clients" radar to protect user privacy in public demos.
- v2.3 (Production - Full): The internal admin version. Features the "Client Radar" which estimates physical distance of connected devices based on WiFi signal strength (RSSI).
- Repository Name:
pi-knowledge-hub - Commit Name/Summary:
feat: power flow visualization and client radar (v2.0 - v2.3) - Commit Description:
Complete hardware integration and production hardening:
- v2.0: Added
power_server.pyand SVG hardware topology map. - v2.1: Implemented CSS/JS staggered animations for realistic power flow visualization.
- v2.2: Privacy-hardened UI for public exhibition (removed client MAC/IP list).
- v2.3: Added "Client Radar" using Log-Distance Path Loss model to estimate device distance from the Pi Zero 2W.
- v2.0: Added
- Dependencies: Ensure
python3is installed. - Permissions: The
metrics_server.pyrequires access toiwandvcgencmd. Ensure thepiuser is in thevideoandnetdevgroups. - Hardware: The Power Flow (v2.x) assumes a TP4056 + 18650 Battery + Solar Panel setup. Without sensors,
power_server.pyreturns dummy data for demonstration.