- Copied config.py with FreeSimpleGUI configuration interface to root folder - Added load_config() function to launch config UI when card 12886709 is inserted - Config UI allows setting hostname and work table (Loc De Munca) - Automatic printer configuration and hostname updates - System reboot after configuration changes - Added config.py to version control
Prezenta Work - Workplace Attendance & Traceability System
Project Structure
📁 Main Application Files
- app.py - Main application orchestrator (v3.0)
- config_settings.py - Centralized configuration (points to 192.168.1.103)
- data/ - Local data storage (logs, device info, RFID tags)
- Files/ - Package repository and dependencies
🔧 Core Modules (Production Ready)
- api_routes_module.py - Flask API endpoints and web interface
- logger_module.py - Local and remote logging system
- device_module.py - Device information management
- system_init_module.py - System initialization and hardware checks
- dependencies_module.py - Package management and verification
- commands_module.py - Secure command execution with allowlist
- autoupdate_module.py - Remote application updates
- connectivity_module.py - Network connectivity monitoring
- rfid_module.py - RFID reader initialization
✨ Enhancement Modules (v3.0)
- logger_batch_module.py - Batch logging with 75% network reduction
- chrome_launcher_module.py - Fullscreen Chrome UI launcher
- wifi_recovery_module.py - Auto WiFi recovery on server disconnect
📚 Documentation & Old Code
See oldcode/ folder for:
- Legacy code and configuration files
- Complete architecture documentation
- Refactoring guides and summaries
- Setup and troubleshooting guides
Quick Start
Run Application
cd /srv/prezenta_work
python3 app.py
Configuration
All settings are centralized in config_settings.py:
- Monitoring Server: 192.168.1.103:80
- Flask Port: 80
- RFID Devices: Auto-detected (/dev/ttyS0, /dev/ttyAMA0, etc.)
Environment Variables
Override default settings:
export MONITORING_SERVER_HOST=192.168.1.100
export FLASK_PORT=8080
python3 app.py
Key Features
🚀 v3.0 Enhancements
-
Batch Logging (75% Network Reduction)
- Queues logs every 5 seconds or at 10 items
- Deduplicates events within 3-second window
- Single HTTP request vs 3-4 per second
-
Chrome Fullscreen UI
- Auto-launches traceability web app
- Fullscreen kiosk mode for workplace display
- Optional auto-startup via systemd
-
WiFi Auto-Recovery
- Monitors server connectivity (60-second ping)
- Disables WiFi for 20 minutes on server loss
- Auto-restarts WiFi and resumes operation
System Requirements
- OS: Raspberry Pi OS / Linux
- Python: 3.7+
- Ports: 80 (Flask web server)
- Hardware: RFID reader, GPIO LEDs, WiFi interface
API Endpoints
All endpoints available at http://192.168.1.103:80
GET /status
Device status, uptime, disk usage, memory
POST /logs
Log submission endpoint (batch supported)
POST /execute_command
Execute pre-approved system commands
POST /auto_update
Check and apply remote updates
Monitoring & Logs
Local Logs
tail -f data/log.txt
Remote Server
curl http://192.168.1.103/status
Git Workflow
Current Status
- Branch: dev (latest v3.0 enhancements)
- Remote: Synced with origin/dev
- Latest Commit: Configuration update (192.168.1.103)
View History
git log --oneline -5
Troubleshooting
RFID Reader Not Detected
- Check
/dev/ttyS0,/dev/ttyAMA0,/dev/ttyUSB0,/dev/ttyACM0 - Verify UART is enabled on Raspberry Pi
- Check GPIO permissions
WiFi Recovery Not Working
- Verify sudo permissions for
ip link setcommands - Check if ping destination is reachable
- Review logs for recovery messages
Batch Logging Issues
- Check network connectivity to 192.168.1.103
- Verify port 80 is open and Flask is running
- Monitor batch queue in logs
Development Notes
Adding New Modules
- Create module in main directory
- Import in app.py
- Initialize in main() function
- Test and commit
Modifying Configuration
- Edit config_settings.py
- Changes take effect on next restart
- Environment variables can override settings
Testing
# Syntax check
python3 -m py_compile *.py
# Import test
python3 -c "import app; print('✓ OK')"
Support
For detailed documentation, see oldcode/ folder:
- MODULAR_ARCHITECTURE.md - Complete technical guide
- QUICKSTART.md - API reference
- DEPLOYMENT_CHECKLIST.md - Testing guide
Version History
- v3.0 - Enhanced with batch logging, Chrome UI, WiFi recovery
- v2.8 - Performance optimization (skip dependency checks)
- v2.7 - Fixed auto-update for case-sensitive systems
- v2.0+ - Modular architecture implementation
Last Updated: December 18, 2025
Status: Production Ready (dev branch)
Monitoring Server: 192.168.1.103:80