Files
dreader-application/install_hardware_drivers.sh
T
dtourolleandClaude Opus 5 f7d59d025f chore: tidy repository layout and consolidate hardware docs
Root had grown to 30 entries, most of it generated output and one-off
scripts. It now holds 12.

Docs:
- Merge HARDWARE_SETUP, HARDWARE_PINOUT, GPIO_BUTTONS and
  ACCELEROMETER_PAGE_FLIP into a single docs/HARDWARE.md
- Move ARCHITECTURE, REQUIREMENTS and HAL_IMPLEMENTATION_SPEC to docs/,
  leaving only README.md in the root
- Update cross-references in README, setup_rpi.py and
  install_hardware_drivers.sh, and re-base ARCHITECTURE's source links

Merging surfaced three errors, reconciled against hardware_config.json:
- The power button was documented as GPIO 21 to GND with a pull-up. It is
  active high (pull_up: false); wiring it as documented reads as
  permanently pressed.
- GPIO_BUTTONS used GPIO 23 for next-page; it is GPIO 27.
- The FT5316 INT pin was routed to GPIO 27, which collides with the
  next-page button. Now documented as a conflict.

Scripts:
- Move debug_overlay_links.py and debug_previous_page.py to scripts/debug/
- Rename test_pagination_visual.py to scripts/debug/visualize_pagination.py;
  it renders output and asserts nothing, so the test_ prefix was misleading
- Fix the __file__-relative paths these three relied on
- Track update_pyweblayout.sh under scripts/

Tests:
- Reword the backward-navigation tests, which described a pyWebLayout bug
  that is now fixed, as regression tests

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-08 22:27:53 +02:00

81 lines
2.3 KiB
Bash
Executable File

#!/bin/bash
# Installation script for dreader-hal hardware drivers
#
# This script installs all the external driver dependencies needed
# for running DReader on e-ink hardware.
set -e # Exit on error
echo "================================"
echo "DReader Hardware Driver Installer"
echo "================================"
echo ""
# Check if we're in a virtual environment
if [ -z "$VIRTUAL_ENV" ]; then
echo "⚠️ Warning: No virtual environment detected!"
echo "It's recommended to activate your virtual environment first:"
echo " source venv/bin/activate"
echo ""
read -p "Continue anyway? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
# Initialize submodules if not already done
echo "Step 1: Initializing git submodules..."
git submodule update --init --recursive
echo "✓ Submodules initialized"
echo ""
# Install dreader-hal main package
echo "Step 2: Installing dreader-hal..."
pip install -e external/dreader-hal
echo "✓ dreader-hal installed"
echo ""
# Install external drivers
echo "Step 3: Installing external driver libraries..."
echo " - Installing IT8951 (E-ink display driver)..."
pip install -e external/dreader-hal/external/IT8951
echo " - Installing PyBMA400 (Accelerometer)..."
pip install -e external/dreader-hal/external/PyBMA400
echo " - Installing PyFTtxx6 (Touch panel)..."
pip install -e external/dreader-hal/external/PyFTtxx6/pyft5xx6
echo " - Installing PyPCF8523 (RTC)..."
pip install -e external/dreader-hal/external/PyPCF8523
echo " - Installing pi_ina219 (Power monitor)..."
pip install -e external/dreader-hal/external/pi_ina219
echo "✓ All drivers installed"
echo ""
# Summary
echo "================================"
echo "Installation Complete!"
echo "================================"
echo ""
echo "Installed packages:"
echo " ✓ dreader-hal (main HAL library)"
echo " ✓ IT8951 (e-ink display)"
echo " ✓ PyBMA400 (accelerometer)"
echo " ✓ PyFTtxx6 (touch panel)"
echo " ✓ PyPCF8523 (RTC)"
echo " ✓ pi_ina219 (power monitor)"
echo ""
echo "Next steps:"
echo " 1. Wire up your hardware according to docs/HARDWARE.md"
echo " 2. Check your display's VCOM voltage (on label)"
echo " 3. Run: python examples/run_on_hardware.py /path/to/books --vcom YOUR_VCOM"
echo ""
echo "Example:"
echo " python examples/run_on_hardware.py ~/Books --vcom -2.06"
echo ""