A Python-based application that displays quotes on a 13.3-inch e-paper HAT (B) device connected to a Raspberry Pi Zero 2. The system includes a web interface for configuration and quote management.
I want to give thanks to JohannesNE as I used their quotes csv.
- Displays quotes and time on an e-paper display
- Web-based settings interface
- Configurable update intervals
- CSV to JSON quote conversion
- Automatic startup on boot
- Test mode for development without hardware
- Raspberry Pi Zero 2 (for production)
- 13.3-inch e-paper HAT (B) (for production)
- MicroSD card with Raspberry Pi OS (for production)
- Internet connection
- Python 3.7+
- Required Python packages (see requirements.txt)
-
You may need to create a virutal environment.
-
Clone this repository:
git clone https://github.com/yourusername/quote_clock.git cd quote_clock
-
Install required packages:
pip install -r requirements.txt
When testing locally and not on a raspberry pi install
requirements-dev.txt
-
Create a
quotes.csv
file in thedata
directory with your quotes:HH:MM|H:MM A.M.|Quote|Book|Author|Rating 13:35|1:35 P.M.|Fletcher checked his watch again...|Sons of Fortune|Jeffrey Archer|sfw
-
Enable SPI interface:
sudo raspi-config
Navigate to "Interface Options" > "SPI" > "Yes" to enable SPI.
-
Add your user to the gpio group:
sudo usermod -a -G gpio $USER
Note: You'll need to log out and back in for this to take effect.
-
Connect the e-paper display to your Raspberry Pi:
- RST_PIN (17) -> RST
- DC_PIN (25) -> DC
- CS_PIN (8) -> CS
- BUSY_PIN (24) -> BUSY
- VCC -> 3.3V
- GND -> GND
- CLK -> SCLK
- DIN -> MOSI
-
Run the initial setup:
python setup.py
-
(Optional) Set up automatic startup:
sudo cp quote_clock.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable quote_clock sudo systemctl start quote_clock
-
The application includes a mock mode for testing without hardware:
- Mock GPIO module for testing display functionality
- Mock SPI module for testing communication
- Test suite for validating functionality
-
Run the test suite:
python run_tests.py
-
Test the web interface:
python web_server.py
Access the web interface at
http://localhost:5001
-
Start the web interface:
python web_server.py
-
Access the web interface at
http://<raspberry_pi_ip>:5001
-
Configure your display settings and upload new quotes through the web interface.
-
Run the test suite:
python run_tests.py
-
Test the web interface:
python web_server.py
-
Test display functionality:
python display_manager.py
quote_clock/
├── data/
│ ├── quotes.csv
│ └── quotes.json
├── images/
│ └── generated/
├── static/
│ ├── css/
│ └── js/
├── templates/
├── tests/
│ ├── RPi/
│ │ └── GPIO/
│ │ └── GPIO.py
│ ├── mock_config.py
│ ├── mock_spi.py
│ └── test_*.py
├── requirements.txt
├── README.md
├── setup.py
├── web_server.py
├── quote_generator.py
├── display_manager.py
└── run_tests.py
-
SPI not working:
- Verify SPI is enabled:
ls /dev/spi*
- Check user permissions:
groups $USER
- Verify connections are correct
- Verify SPI is enabled:
-
Display not responding:
- Check power supply (3.3V)
- Verify all connections
- Check GPIO permissions
-
Web interface not accessible:
- Verify the server is running
- Check firewall settings
- Ensure correct IP address
-
Tests failing:
- Check Python version (3.7+ required)
- Verify all dependencies are installed
- Check mock configuration
-
Web interface issues:
- Check port 5001 is available
- Verify all dependencies are installed
- Check browser console for errors
MIT License - see LICENSE file for details