How bekidiaz96/localizadorservice works
LocalizadorService collects vehicle sensor readings and GPS coordinates on a Raspberry Pi, validates and combines them, and stores each accepted record locally in SQLite. A separate sync loop retrieves unsynchronized records, inserts them into PostgreSQL, and marks successful records as synchronized. The repository also includes synthetic record generation and rotating file logging. The README documents the PostgreSQL sync workflow; relationships below are limited to calls visible in the provided source excerpts and that documentation.
Main entry points: db_handler.py SQLite handler · ard_gps.py Serial collector · sync_service.py Sync worker · generar_datos.py Sample generator
Components 10
Device capture
- Serial collector
ard_gps.py - NMEA parser
ard_gps.py
Local persistence
- Local records
vehiculos.db - SQLite handler
db_handler.py
Remote synchronization
- Sync worker
sync_service.py - Central records
Logging and simulation
- Sample generator
generar_datos.py - Logger setup
logger_setup.py
Other components
- Arduino sensors
- GPS receiver
Connections 10
- Arduino sensors → Serial collector: sends readings
ard_gps.py - GPS receiver → NMEA parser: sends NMEA
ard_gps.py - Serial collector → NMEA parser: reads coordinates
ard_gps.py - Serial collector → SQLite handler: initializes and inserts
ard_gps.py - SQLite handler → Local records: reads and writes
db_handler.py - Sample generator → SQLite handler: initializes and inserts
generar_datos.py - Serial collector → Logger setup: configures logging
ard_gps.py - Sync worker → SQLite handler: fetches pending records
sync_service.py - Sync worker → Central records: connects and inserts
sync_service.py - Sync worker → SQLite handler: marks synchronized
sync_service.py