Complete documentation for the Digital Attendance System — from first login to daily reports. Read top-to-bottom for setup, or use the sidebar to jump to any topic.
DAS is a QR-based smart attendance platform. Students carry signed QR cards. Gate Raspberry Pi scanners read cards and send attendance to the central Flask server automatically.
- Admin imports student list via Excel. Each student gets a unique UID.
- QR cards are generated using
qr_generator.pyand printed. - Students scan their QR card at the gate when arriving / leaving.
- Gate Pi reads the scan, validates signature, and sends to server.
- Server marks attendance as Present / Late / Half-Day based on time.
- Teachers & Principal view real-time dashboard and download Excel reports.
| Component | Device | Role |
|---|---|---|
| Server | Raspberry Pi 5 + SSD | Flask app, SQLite DB, dashboard at das.local:5000 |
| Gate 1/2/3 | Raspberry Pi 4 × 3 | QR scan → validate → send to server |
| QR Scanner | USB HID Scanner | Reads student QR card as keyboard input |
| Speaker | 3.5mm / USB | Voice feedback via espeak |
Open your browser and go to http://das.local:5000. Login with your username and password.
| Role | Default Username | Default Password | Change? |
|---|---|---|---|
| 👑 Principal | principal | principal123 | CHANGE ASAP |
| ⚙️ Admin | admin | admin123 | CHANGE ASAP |
| 👩🏫 Teacher | teacher1 | teacher123 | Change recommended |
DAS has 3 roles. Each role sees only what it needs — no more, no less.
- Add / Delete students
- Excel bulk import
- Add / Delete teachers
- View No-Class UIDs
- View system logs
- Clean up old data
- School-wide attendance
- Filter by class/section
- Daily/Weekly/Monthly reports
- Add single student
- View No-Class UIDs
- Cannot: import Excel / manage teachers
- Own class only
- Download class report
- Cannot: see other classes
- Cannot: manage students
Students page will be accessed by admin and Principal with different features.
| Field | Example | Required? |
|---|---|---|
| UID | 22697641900 | Yes |
| Name | RAHUL SHARMA | Yes |
| Class | 5 | Yes |
| Section | A | Optional |
| Roll No | 12 | Optional |
Teachers assign page only visible to admin to add kr delete teacher/class.
| Field | Example | Note |
|---|---|---|
| Name | Priya Sharma | Display name |
| Username | priya_5a | Login ke liye |
| Password | priya@123 | Password can be changed only by admin. |
| Class | 5 | Teacher only can see their own class only |
| Section | A | Optional |
Import all students data by uploading excel file.
| Column | Accepted Names | Required? |
|---|---|---|
| UID / Card ID | uid, id, rfid, card_id, card | Yes |
| Student Name | name, student name, full name | Yes |
| Class | class, grade, std, standard | Yes |
| Section | section, sec, div, division | Optional |
| Roll No | roll, roll_no, rollno, roll no | Optional |
- Admin → Students page
- Import Excel Click button
- More than one .xlsx files support
- Upload — Database updated automatically.
- Result => imported, updated and skipped rows will be shown.
There is no Class column → It's will automatically fetch from Students' database.
UID or Name row → will skip automatically.
Every student will get an unique signed QR code. This will generated from qr_generator.py Run manually and generate.
"********" + UID). Gate sirf valid signature wali QR accept karta hai — tampered cards reject hoti hain.- Server pe
students.xlsxbanao — columns: uid, name, class, section, roll - Server pe run karo:
cd /home/pi/das_server source venv/bin/activate pip install qrcode[pil] pandas pillow python qr_generator.py
- PNG cards
qr_cards/folder mein save hongi - USB se copy karo → printer pe A6/Credit card size pe print karo
- Laminate karke students ko do
Gate pe USB scanner se student QR card scan karo. Baaki sab automatic hai.
| Scan | Time | Action | Voice |
|---|---|---|---|
| 1st Scan | 06:50–07:30 | Present marked | "Hello [Name]" |
| 1st Scan | 07:30–08:00 | Late marked | "Late [Name]" |
| 1st Scan | Other time | For Special Work | "For Special Work [Name]" |
| 2nd Scan | 10:20–12:20 | Half-Day Exit | "Half day [Name]" |
| 2nd Scan | 12:20–17:00 | Normal Exit | "Bye [Name]" |
| Invalid QR | Any | Rejected | "Invalid QR" |
| Duplicate | Any | Blocked | "Already marked [Name]" |
no_class table mein save hoti hai. Admin dashboard pe "No-Class UIDs" section mein dekh sakte hain.Gate automatic time ke hisaab se status decide karta hai. gate.py ke upar yeh times edit kar sakte ho.
# gate.py ke top pe yeh lines edit karo: ENTRY_START = "06:50" # Present window start ENTRY_END = "07:30" # Present window end LATE_END = "08:00" # Late window end HALF_START = "10:20" # Half-day exit start HALF_END = "12:20" # Half-day exit end EXIT_START = "12:20" # Normal exit start EXIT_END = "17:00" # Normal exit end
config.py mein LATE_CUTOFF = "08:30". Dono consistent rakhna.Agar server band ho ya network fail ho, Gate Pi automatically offline queue mein data save karta hai.
- Server unreachable hota hai → Gate detect karta hai
- Scan data
offline_queue_gate1.jsonmein save hota hai - Voice feedback aur local state normally kaam karta rehta hai
- Background mein har 60 second pe server check hota hai
- Server wapas online aata hai → sab queued records automatically sync ho jate hain
Agar koi student gate pe scan nahi kar paya (bhool gaya, sick, trip, etc.) — Admin/Principal manually attendance mark ya change kar sakte hain.
- Dashboard → Attendance Override menu pe jaao
- Date select karo (default: aaj)
- Class/Section filter karo
- Student dhundho → Status change karo (Present / Absent / Late / Half-Day etc.)
- Reason/remark likho (optional)
- Save karo — audit trail mein record ho jayega
Reports page se attendance data Excel mein download karo. Teacher sirf apni class ki report download kar sakti hai.
| Report Type | Filter | Who can download |
|---|---|---|
| Daily Report | Date + Class/Section | Admin, Principal, Teacher (own class) |
| Weekly Report | Week + Class/Section | Admin, Principal, Teacher (own class) |
| Monthly Report | Month + Class/Section | Admin, Principal, Teacher (own class) |
| School-wide | Date range | Principal only |
| Short Code | Meaning | Color |
|---|---|---|
| P | Present | Green |
| L | Late | Yellow |
| A | Absent | Red |
| H | Half-Day | Light Blue |
| SW | Special Work | Purple |
| SX | Special Work Done Exit | Indigo |
| EX | Early Exit | Pink |
Har manual override aur important action audit trail mein permanently log hota hai.
| Field | Example |
|---|---|
| Date & Time | 2026-03-28 09:15:32 |
| Action by | admin |
| Action | OVERRIDE_ATTENDANCE |
| Details | UID:12345 Status: Absent → Present, Reason: Medical |
Admin → Logs page pe system login history aur all actions dekh sakte hain.
| Log Type | Example Entry |
|---|---|
| Login | LOGIN admin — 2026-03-28 08:00:01 |
| Logout | LOGOUT admin |
| Student Add | ADD_STUDENT UID:12345 RAHUL SHARMA |
| Student Delete | DELETE_STUDENT UID:12345 |
| Teacher Add | ADD_TEACHER priya_5a |
| Excel Import | EXCEL_IMPORT 45 records imported |
Yeh sab status values DAS mein use hoti hain — gate pe, dashboard pe, aur Excel reports mein.
| Status | Short | When |
|---|---|---|
| Present | P | On-time entry (06:50–07:30) |
| Late | L | Late entry (07:30–08:00) |
| Absent | A | No scan — cron_absent.py se auto-mark |
| Half-Day | H | Exit scan 10:20–12:20 |
| For Special Work | SW | Entry outside normal window |
| Special Work Done Exit | SX | Exit after Special Work entry |
| Early Exit | EX | Exit before normal exit window |
- Login karo
- Top-right menu → Change Password
- Current password + new password daalo
- Save karo — turant effective ho jata hai
# Server pe terminal mein: cd /home/pi/das_server source venv/bin/activate python3 -c " from database.init_db import get_db from werkzeug.security import generate_password_hash db = get_db() db.execute('UPDATE users SET password_hash=? WHERE username=?', (generate_password_hash('newpassword123'), 'admin')) db.commit(); db.close() print('Done') "
qr_generator.py se. SECRET_KEY server aur gate mein same hona chahiye.- Gate aur Server same WiFi pe hain? Check:
ping das.localGate Pi se - Server service chal rahi hai? Check:
sudo systemctl status das_server - Firewall?
sudo ufw allow 5000Server pe - Offline mode automatically activate ho jayega — data save rahega
espeak "Hello Test" # direct test amixer set Master 90% # volume badhaao sudo raspi-config # Audio → Headphones set karo
crontab -l # current cron jobs dekho # Agar nahi hai, add karo: crontab -e # Add: 59 23 * * * /home/pi/das_server/venv/bin/python /home/pi/das_server/cron_absent.py
- Server RPi5 ka hostname
dashai?hostnamecommand se check karo avahi-daemonchal raha hai?sudo systemctl status avahi-daemon- Temporary fix: IP directly use karo
http://192.168.1.50:5000 - Windows pe mDNS ke liye iTunes ya Bonjour install karo
school.sqlite3 ki copy USB pe rakh lo.