How andrick-dms/dms-automatedidreader works
Project type and purpose
• This is a Windows-based, Python-written, background “tray” service plus an administrative dashboard.
• Purpose: automatically read Costa Rican ID cards (or QR codes), decode personal data, and auto-fill guest forms in the Lenel system. It also includes a licensing mechanism, per-customer installer generation, and runtime configuration management.
File structure (focus on the v3.2 folder)
• dashboard.py – the entry point for the installer-generator dashboard UI.
• requirements.txt – Python dependencies (e.g., pyautogui, serial, XOR library).
• template/
– main.py – logic to generate new configuration templates.
– crear_configuracion.py – routines to build user-customized form-filling rules.
README for clues
• Tray-service that detects COM port, reads QR or physical ID via hardware reader.
• Decodes with XOR algorithm, extracts fields (ID number, name, birthdate, expiration).
• Uses pyautogui to simulate keyboard input into Lenel forms.
• Supports multiple “configs” to define field order/tab counts.
• Licensing: local cache, first-launch prompt, log activation events.
1. Hardware Interface
• ID/QR reader on COM port
• COM-port detection module
2. Decoder Module
• XOR decoder logic
• Data extraction
3. Tray-Service Application
• Configuration manager (loads active config from disk)
• Autocomplete engine (pyautogui scripts)
• License manager (checks/validates license cache)
• Logging subsystem (writes events to local log files)
4. Configuration Template Generator
• Runs from tray UI or standalone script (template/main.py, crear_configuracion.py)
• Writes new config files under configs/
5. Administrative Dashboard (dashboard.py)
• GUI to register customers, generate unique license, bundle installers (ZIP)
6. External Systems
• Lenel target application (receives simulated keystrokes)
• Customer’s file system (configs/, logs/, license cache)
• Hardware Interface → Decoder Module → Tray-Service → Autocomplete Engine → Lenel.
• Tray-Service ← Configuration Manager (config file read)
• Tray-Service ↔ License Manager (on-disk cache read/write)
• Tray-Service → Logging Subsystem
• Dashboard → License Manager (generate new license)
• Dashboard → ZIP-packager → Installer bundle
Architectural patterns & principles
• Monolithic service with modular internal subsystems
• Separation of concerns: decoding, configuration, licensing, UI, automation
• Plugin-style configs to allow field mapping/extensibility
• Single entry points: tray executable vs dashboard script
Technologies & frameworks
• Python 3.x, pyserial (COM port), custom XOR logic, pyautogui, standard logging library
• Batch script (compilar_dashboard.bat) for building dashboard executable
• ZIP utilities for installer generation
Final detail checklist
• Every subprocess: COM detection, XOR decoding, pyautogui automation, config creation, license validation, logging.
• How configs feed the tray service and how the dashboard writes configs and licenses.