AH
ahamza360/athan
Prayer time scheduler for Raspberry Pi with web UI.
Athan Pi
Prayer time scheduler for Raspberry Pi that automatically plays the call to prayer (Athan) at correct times with web-based configuration.
Features
- Automatic Scheduling - Fetches prayer times from my-masjid.com API
- Per-Prayer Customization - Individual audio file, volume (0-200%), and speed (0.5x-2.0x) control
- Custom Fajr Time - Override Fajr time with custom HH:MM setting
- Modern Web UI - Responsive interface with light/dark mode
- Audio Processing - Speed adjustments cached, volume applied in real-time
- Reliable Operation - Automatic retry on failure, daily midnight refresh
Quick Start
Development
./run.shAccess UI at http://localhost:8000
Testing
./run_test.sh # Uses FakeSource for rapid testingAudio Files
Place audio files in audio/ directory (mp3):
fajr.mp3,dhuhr.mp3,asr.mp3,maghrib.mp3,isha.mp3- Falls back to
default.mp3if specific file is missing - Speed-adjusted files cached in
audio/.processed/(auto-created)
Configuration
Set in run.sh or as environment variables:
MY_MASJID_GUID- Your masjid ID from my-masjid.comATHAN_TIMEZONE- IANA timezone (default: Europe/Stockholm)ATHAN_DATA_DIR- Data directory (default: /app/data)ATHAN_AUDIO_DIR- Audio directory (default: /app/audio)ATHAN_SOURCE- Timing source: "my_masjid" or "fake" (default: my_masjid)
Raspberry Pi Deployment
- Install audio player:
sudo apt install mpg123 ffmpeg- Deploy files:
./deploy.sh pi@raspberrypi.local- On the Pi, install and start:
cd ~/athan
./ctl.sh install
./ctl.sh startService Control
./ctl.sh start # Start service
./ctl.sh stop # Stop service
./ctl.sh status # Check status
./ctl.sh logs # View logsAPI
GET /- Web UIGET /api/timings- Prayer timesGET /api/settings- Get settingsPOST /api/settings- Update settingsGET /api/audios- List audio filesPOST /api/test-audio- Test playbackPOST /api/silent- Stop audioGET /api/health- Health check
Documentation
- AGENTS.md - Comprehensive guide for AI assistants and developers
- .agents/summary/ - Detailed documentation (architecture, components, workflows, APIs)
Technology Stack
- Backend: Python 3.12, FastAPI, APScheduler
- Frontend: Vanilla JavaScript, Tailwind CSS
- Audio: ffmpeg for speed processing, mpg123 for playback with native volume
- Deployment: systemd service on Raspberry Pi
Development
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run development server
./run.shLicense
Personal project for prayer time automation.
On this page
Languages
Python48.4%HTML23.9%JavaScript22.9%Shell4.8%
Contributors
Created February 7, 2026
Updated February 9, 2026
