Documentation · Help Center
DAS User Guide

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.

Getting Started
System Overview

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.

🏗️ How It Works — End to End
  1. Admin imports student list via Excel. Each student gets a unique UID.
  2. QR cards are generated using qr_generator.py and printed.
  3. Students scan their QR card at the gate when arriving / leaving.
  4. Gate Pi reads the scan, validates signature, and sends to server.
  5. Server marks attendance as Present / Late / Half-Day based on time.
  6. Teachers & Principal view real-time dashboard and download Excel reports.
ComponentDeviceRole
ServerRaspberry Pi 5 + SSDFlask app, SQLite DB, dashboard at das.local:5000
Gate 1/2/3Raspberry Pi 4 × 3QR scan → validate → send to server
QR ScannerUSB HID ScannerReads student QR card as keyboard input
Speaker3.5mm / USBVoice feedback via espeak
Getting Started
Login

Open your browser and go to http://das.local:5000. Login with your username and password.

RoleDefault UsernameDefault PasswordChange?
👑 Principalprincipalprincipal123CHANGE ASAP
⚙️ Adminadminadmin123CHANGE ASAP
👩‍🏫 Teacherteacher1teacher123Change recommended
⚠️
Default passwords are for first-time setup only. Go to Change Password after first login.
ℹ️
Teachers are added by Admin from the Teachers page. Each teacher gets a custom username and password.
Getting Started
Roles & Access

DAS has 3 roles. Each role sees only what it needs — no more, no less.

⚙️
Admin
  • Add / Delete students
  • Excel bulk import
  • Add / Delete teachers
  • View No-Class UIDs
  • View system logs
  • Clean up old data
👑
Principal
  • School-wide attendance
  • Filter by class/section
  • Daily/Weekly/Monthly reports
  • Add single student
  • View No-Class UIDs
  • Cannot: import Excel / manage teachers
👩‍🏫
Teacher
  • Own class only
  • Download class report
  • Cannot: see other classes
  • Cannot: manage students

Admin Guide
Managing Students

Students page will be accessed by admin and Principal with different features.

➕ Add Single Student (Admin + Principal)
Go To Students page→ Add Student Click → Fill Form :

FieldExampleRequired?
UID22697641900Yes
NameRAHUL SHARMAYes
Class5Yes
SectionAOptional
Roll No12Optional
🗑️ Delete Student (Admin only)
Students marked as Dropbox or TC can be deleted through the multi-select option.
⚠️
Download the all reports before deleting any Students data.
Admin Guide
Managing Teachers

Teachers assign page only visible to admin to add kr delete teacher/class.

➕ Add Teacher
Teachers page → Add Teacher form:

FieldExampleNote
NamePriya SharmaDisplay name
Usernamepriya_5aLogin ke liye
Passwordpriya@123Password can be changed only by admin.
Class5Teacher only can see their own class only
SectionAOptional
Assigned username and password can't be changed by teachers.
Admin Guide
Excel Bulk Import

Import all students data by uploading excel file.

📋 Excel File Format
Format of excel file shown on admin panel:

ColumnAccepted NamesRequired?
UID / Card IDuid, id, rfid, card_id, cardYes
Student Namename, student name, full nameYes
Classclass, grade, std, standardYes
Sectionsection, sec, div, divisionOptional
Roll Noroll, roll_no, rollno, roll noOptional
📤 Import Steps
  1. Admin → Students page
  2. Import Excel Click button
  3. More than one .xlsx files support
  4. Upload — Database updated automatically.
  5. Result => imported, updated and skipped rows will be shown.
ℹ️
If Same UID imported → record will update but it's avoid duplicate.
There is no Class column → It's will automatically fetch from Students' database.
UID or Name row → will skip automatically.
Admin Guide
QR Card Generation

Every student will get an unique signed QR code. This will generated from qr_generator.py Run manually and generate.

PEN:22697641900; RAHUL SHARMA | A3F2B1C4
PEN: — Fixed Prefix 22697641900 — Student UID RAHUL SHARMA — Student Name A3F2B1C4 — Security Signature
ℹ️
Signature = pehle 8 characters of SHA256("********" + UID). Gate sirf valid signature wali QR accept karta hai — tampered cards reject hoti hain.
🖨️ QR Cards Banana — Steps
  1. Server pe students.xlsx banao — columns: uid, name, class, section, roll
  2. Server pe run karo:
bash
cd /home/pi/das_server
source venv/bin/activate
pip install qrcode[pil] pandas pillow
python qr_generator.py
  1. PNG cards qr_cards/ folder mein save hongi
  2. USB se copy karo → printer pe A6/Credit card size pe print karo
  3. Laminate karke students ko do

Attendance
Gate Scanning

Gate pe USB scanner se student QR card scan karo. Baaki sab automatic hai.

🔄 Scan Flow
ScanTimeActionVoice
1st Scan06:50–07:30Present marked"Hello [Name]"
1st Scan07:30–08:00Late marked"Late [Name]"
1st ScanOther timeFor Special Work"For Special Work [Name]"
2nd Scan10:20–12:20Half-Day Exit"Half day [Name]"
2nd Scan12:20–17:00Normal Exit"Bye [Name]"
Invalid QRAnyRejected"Invalid QR"
DuplicateAnyBlocked"Already marked [Name]"
ℹ️
No-Class UID: Agar koi UID database mein nahi hai, woh no_class table mein save hoti hai. Admin dashboard pe "No-Class UIDs" section mein dekh sakte hain.
Attendance
Time Windows

Gate automatic time ke hisaab se status decide karta hai. gate.py ke upar yeh times edit kar sakte ho.

06:50 – 07:30 ✅ Present First scan — on time entry
07:30 – 08:00 ⚠️ Late First scan — late entry
Any other time 🔧 Special Work For Special Work entry
10:20 – 12:20 🌓 Half-Day Exit 2nd scan — early exit
12:20 – 17:00 🚪 Normal Exit 2nd scan — full day exit
gate.py — Time Edit
# 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
ℹ️
Late cutoff server pe bhi set hota hai — config.py mein LATE_CUTOFF = "08:30". Dono consistent rakhna.
Attendance
Offline Mode

Agar server band ho ya network fail ho, Gate Pi automatically offline queue mein data save karta hai.

📡 Offline Flow
  1. Server unreachable hota hai → Gate detect karta hai
  2. Scan data offline_queue_gate1.json mein save hota hai
  3. Voice feedback aur local state normally kaam karta rehta hai
  4. Background mein har 60 second pe server check hota hai
  5. Server wapas online aata hai → sab queued records automatically sync ho jate hain
UPS hone ke baad bhi agar WiFi fail ho — students ka data kho nahi jayega.
Attendance
Manual Attendance Override

Agar koi student gate pe scan nahi kar paya (bhool gaya, sick, trip, etc.) — Admin/Principal manually attendance mark ya change kar sakte hain.

✏️ Override Karna
  1. Dashboard → Attendance Override menu pe jaao
  2. Date select karo (default: aaj)
  3. Class/Section filter karo
  4. Student dhundho → Status change karo (Present / Absent / Late / Half-Day etc.)
  5. Reason/remark likho (optional)
  6. Save karo — audit trail mein record ho jayega
⚠️
Har override audit trail mein permanently save hota hai — kis ne, kab, kyun change kiya.

Reports
Attendance Reports

Reports page se attendance data Excel mein download karo. Teacher sirf apni class ki report download kar sakti hai.

Report TypeFilterWho can download
Daily ReportDate + Class/SectionAdmin, Principal, Teacher (own class)
Weekly ReportWeek + Class/SectionAdmin, Principal, Teacher (own class)
Monthly ReportMonth + Class/SectionAdmin, Principal, Teacher (own class)
School-wideDate rangePrincipal only
📊 Excel Report Mein Kya Hota Hai
Short CodeMeaningColor
PPresentGreen
LLateYellow
AAbsentRed
HHalf-DayLight Blue
SWSpecial WorkPurple
SXSpecial Work Done ExitIndigo
EXEarly ExitPink
Reports
Audit Trail

Har manual override aur important action audit trail mein permanently log hota hai.

🔍 Audit Trail mein kya dikh ta hai
Har entry mein:

FieldExample
Date & Time2026-03-28 09:15:32
Action byadmin
ActionOVERRIDE_ATTENDANCE
DetailsUID:12345 Status: Absent → Present, Reason: Medical
ℹ️
Audit trail sirf Admin aur Principal dekh sakte hain. Delete nahi hota.
Reports
System Logs

Admin → Logs page pe system login history aur all actions dekh sakte hain.

📋 Log Types
Log TypeExample Entry
LoginLOGIN admin — 2026-03-28 08:00:01
LogoutLOGOUT admin
Student AddADD_STUDENT UID:12345 RAHUL SHARMA
Student DeleteDELETE_STUDENT UID:12345
Teacher AddADD_TEACHER priya_5a
Excel ImportEXCEL_IMPORT 45 records imported
Admin logs ko manually clean kar sakta hai (purane logs delete) — Dashboard → Settings.

Reference
Status Codes

Yeh sab status values DAS mein use hoti hain — gate pe, dashboard pe, aur Excel reports mein.

StatusShortWhen
PresentPOn-time entry (06:50–07:30)
LateLLate entry (07:30–08:00)
AbsentANo scan — cron_absent.py se auto-mark
Half-DayHExit scan 10:20–12:20
For Special WorkSWEntry outside normal window
Special Work Done ExitSXExit after Special Work entry
Early ExitEXExit before normal exit window
Reference
Changing Passwords
🔑 Apna Password Kaise Change Karein
  1. Login karo
  2. Top-right menu → Change Password
  3. Current password + new password daalo
  4. Save karo — turant effective ho jata hai
⚠️
Agar password bhool gaye → Admin se contact karo. Admin database se reset kar sakta hai (terminal se).
bash — Emergency Reset
# 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')
"
Reference
Tips & FAQ
❓ Student scan karta hai lekin "Invalid QR" aata hai
QR card ka signature galat hai ya card tampered hai. Naya QR card generate karo qr_generator.py se. SECRET_KEY server aur gate mein same hona chahiye.
❓ Gate server se connect nahi ho raha
  1. Gate aur Server same WiFi pe hain? Check: ping das.local Gate Pi se
  2. Server service chal rahi hai? Check: sudo systemctl status das_server
  3. Firewall? sudo ufw allow 5000 Server pe
  4. Offline mode automatically activate ho jayega — data save rahega
❓ Voice nahi aa rahi speaker se
Gate Pi pe check karo:
bash
espeak "Hello Test"            # direct test
amixer set Master 90%             # volume badhaao
sudo raspi-config                 # Audio → Headphones set karo
❓ Absent automatically mark nahi ho raha
Cron job set hai? Server pe:
bash
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
❓ das.local nahi khul raha browser mein
  1. Server RPi5 ka hostname das hai? hostname command se check karo
  2. avahi-daemon chal raha hai? sudo systemctl status avahi-daemon
  3. Temporary fix: IP directly use karo http://192.168.1.50:5000
  4. Windows pe mDNS ke liye iTunes ya Bonjour install karo
💡
Daily routine: Server aur Gates automatically boot pe start hote hain. Kuch karne ki zaroorat nahi — bas power on karo aur kaam shuru karo. Backup ke liye weekly school.sqlite3 ki copy USB pe rakh lo.
DAS v1.0 · 2026 · MIT License
Built by THEDARKGEEKDC · PM SHRI KV No.2 Kharagpur
About & Credits