WiFi Attendance Tracker - Employee Management Version
Overview
The WiFi-Based Attendance & Break Tracker is an advanced employee time tracking system that monitors attendance by detecting MAC addresses of devices connected to the local WiFi network. This enhanced version includes comprehensive employee management features, password protection, and a modern web interface.
|#Model Working And Images

Key Features
π Employee Management
- Add New Employees: Password-protected employee addition with admin authentication
- Search Functionality: Search employees by name or MAC address
- Employee Pictures: Support for employee profile pictures
- Password Protection: Secure admin access with customizable passwords (default: 1122)
β° Advanced Time Tracking
- Time-In/Time-Out: Automatic detection of first arrival and final departure
- Break Monitoring: Tracks when employees go on break and return
- 5:00 PM Auto-Timeout: Employees automatically marked as timed out at office closing
- Duration Calculations: Precise tracking of total work time and break time
π Comprehensive Reporting
- Real-time Dashboard: Live employee status updates every 10 seconds
- Daily Attendance Sheets: Detailed CSV reports with formatted durations
- Event History: Complete audit trail of all attendance events
- Summary Statistics: Daily overview with present/absent/break/timeout counts
π Modern Web Interface
- Responsive Design: Works on desktop and mobile devices
- Real-time Updates: Live status changes and notifications
- Interactive Dashboard: Modern UI with statistics cards and employee cards
- Modal Dialogs: Professional forms for employee management
π§ System Features
- Non-Admin Operation: Attempts to run without administrator privileges
- Offline Operation: Works completely without internet connection
- Database Storage: SQLite database for persistent data storage
- JSON Configuration: Separate employee data file for easy management
- Integrated Application: Single entry point for all functionality
System Requirements
- Operating System: Windows 10/11, Linux, or macOS
- Python: 3.7 or higher
- Network: Local WiFi network access
- Permissions: Network scanning capabilities (admin/root recommended but not required)
Installation
Quick Setup (Windows)
Extract the Project
Extract wifi_attendance_tracker_advanced.zip to your desired locationRun Setup Script
Double-click setup.batConfigure Employees
Edit employees.json with your employee dataStart the Application
Double-click run.bat or run: python main.py
Manual Installation
Install Python Dependencies
pip install flask flask-cors bcryptConfigure System
# Edit config.json for system settings # Edit employees.json for employee dataRun Application
python main.py
Configuration
config.json
{
"scan_interval_seconds": 60,
"web_port": 5000,
"office_timeout_hour": 17,
"office_timeout_minute": 0
}
employees.json
[
{
"name": "John Doe",
"mac_address": "aa-bb-cc-dd-ee-ff",
"picture": "static/img/john_doe.jpg"
},
{
"name": "Jane Smith",
"mac_address": "11-22-33-44-55-66",
"picture": "static/img/jane_smith.jpg"
}
]
Usage
Starting the Application
Web Interface Mode (Default)
python main.py
Access the web interface at: http://localhost:5000
Console Mode
python main.py --console
Custom Port
python main.py --port 8080
System Status
python main.py --status
Web Interface Features
Dashboard Overview
- System Status: Current monitoring state and employee count
- Statistics Cards: Real-time counts of present, absent, on break, and timed out employees
- Employee Status: Live employee cards with status badges and time information
- Recent Events: Timeline of latest attendance events
Employee Management
Adding Employees:
- Click "Add Employee" button
- Fill in employee name and MAC address
- Optionally add picture path
- Enter admin password (default: 1122)
- Click "Add Employee"
Searching Employees:
- Use the search box to find employees by name or MAC address
- Results update in real-time
Changing Admin Password:
- Click "Settings" button
- Enter current password and new password
- Click "Change Password"
Monitoring Controls
- Start Monitoring: Begin attendance tracking
- Stop Monitoring: Pause attendance tracking
- Refresh Data: Manually update all data
- Export CSV: Download daily attendance summary
Employee Pictures
To add employee pictures:
Create Image Directory:
Create: static/img/ directoryAdd Picture Files:
Place images in: static/img/employee_name.jpgUpdate Configuration:
{ "name": "John Doe", "mac_address": "aa-bb-cc-dd-ee-ff", "picture": "static/img/john_doe.jpg" }
How It Works
MAC Address Detection
The system uses the arp -a command to scan for devices on the local network. When an employee's device (identified by MAC address) is detected:
- First Detection: Marked as "Time In"
- Continuous Presence: Status remains "Present"
- Temporary Absence: Marked as "On Break" if gone for short period
- Extended Absence: Marked as "Time Out" if gone for extended period
- 5:00 PM Timeout: Automatically marked as "Timed Out" at office closing
Status Logic
- Present: Device currently detected on network
- Absent: Device not detected and no previous activity today
- On Break: Device temporarily not detected but was present earlier
- Timed Out: Device not detected after 5:00 PM or extended absence
Data Storage
- SQLite Database: Stores all attendance events and employee data
- CSV Logs: Daily attendance summaries exported to
logs/directory - JSON Files: Configuration and employee data in human-readable format
Security Features
Password Protection
- Admin Authentication: Required for adding new employees
- Password Hashing: Secure bcrypt hashing for stored passwords
- Default Password: 1122 (changeable through web interface)
- Session Security: No persistent login sessions for security
Data Privacy
- Local Storage: All data stored locally, no cloud transmission
- Offline Operation: No internet connection required
- Encrypted Passwords: Admin passwords securely hashed
- Access Control: Employee management requires authentication
Troubleshooting
Common Issues
"Permission Denied" Errors
- Windows: Run Command Prompt as Administrator
- Linux/macOS: Use
sudo python main.py - Alternative: Use non-admin mode (limited network scanning)
No Employees Detected
- Verify MAC addresses in
employees.json - Check if devices are connected to same network
- Ensure WiFi is enabled on employee devices
- Run
python main.py --statusto check configuration
Web Interface Not Loading
- Check if port 5000 is available
- Try different port:
python main.py --port 8080 - Verify firewall settings
- Check console for error messages
Database Errors
- Delete
attendance.dbto reset database - Restart application to recreate tables
- Check file permissions in project directory
Network Scanning Limitations
Non-Admin Mode
When running without administrator privileges:
- Limited network scanning capabilities
- May not detect all devices
- Reduced accuracy in some network configurations
- Employee management features work normally
Admin Mode (Recommended)
- Full network scanning capabilities
- Accurate device detection
- Complete attendance tracking
- All features fully functional
File Structure
wifi_attendance_tracker/
βββ main.py # Main application entry point
βββ attendance_tracker.py # Core attendance tracking logic
βββ database.py # Database operations
βββ auth.py # Authentication management
βββ web_interface.py # Flask web interface (legacy)
βββ config.json # System configuration
βββ employees.json # Employee data
βββ requirements.txt # Python dependencies
βββ setup.bat # Windows setup script
βββ run.bat # Windows run script
βββ templates/
β βββ index.html # Web interface template
βββ static/
β βββ css/
β β βββ style.css # Web interface styles
β βββ js/
β β βββ script.js # Web interface JavaScript
β βββ img/ # Employee pictures directory
βββ logs/ # CSV export directory
βββ attendance.db # SQLite database
API Endpoints
The web interface provides REST API endpoints:
System Status
GET /api/status- Get system statusPOST /api/start_monitoring- Start monitoringPOST /api/stop_monitoring- Stop monitoring
Employee Management
GET /api/employees- Get all employeesPOST /api/add_employee- Add new employee (requires password)GET /api/search_employees?q=query- Search employees
Attendance Data
GET /api/attendance_events- Get attendance eventsGET /api/daily_summary?date=YYYY-MM-DD- Get daily summaryGET /api/summary_stats?date=YYYY-MM-DD- Get summary statisticsGET /api/export_csv?date=YYYY-MM-DD- Export CSV
Authentication
POST /api/change_password- Change admin password
Advanced Configuration
Custom Office Hours
Edit config.json:
{
"office_timeout_hour": 18,
"office_timeout_minute": 30
}
Scan Interval
Adjust monitoring frequency:
{
"scan_interval_seconds": 30
}
Web Port
Change web interface port:
{
"web_port": 8080
}
Development
Adding New Features
- Backend: Modify
main.pyor create new modules - Frontend: Update
templates/index.htmlandstatic/files - Database: Add new tables/columns in
database.py - API: Add new endpoints in
main.py
Testing
# Test database functionality
python database.py
# Test authentication
python auth.py
# Test attendance tracking
python attendance_tracker.py
# Check system status
python main.py --status
Support
Getting Help
- Check this README for common solutions
- Run
python main.py --statusfor system diagnostics - Check log files in
logs/directory - Verify configuration files are properly formatted
Reporting Issues
When reporting issues, include:
- Operating system and Python version
- Error messages from console
- Configuration files (remove sensitive data)
- Steps to reproduce the issue
License
This project is provided as-is for educational and internal business use. Please ensure compliance with local privacy and employment laws when monitoring employee attendance.
Version History
Version 3.0 (Current)
- Employee management with password protection
- Enhanced web interface with modern design
- Non-admin operation support
- Employee pictures and search functionality
- Integrated single-file application
Version 2.0
- Advanced time tracking with breaks
- 5:00 PM automatic timeout
- Daily attendance summaries
- Web interface with real-time updates
Version 1.0
- Basic MAC address detection
- Simple console interface
- CSV logging
WiFi Attendance Tracker - Employee Management Version
Advanced MAC Detection with Employee Management Features
Version 3.0 - 2025
- Downloads last month
- 3