How tpii/2026-a4-ban-hombre-caido works
BAN is a wearable fall-monitoring system: sensor measurements are acquired on an ESP32, queued and published over MQTT, then shown in a React dashboard. The repository also includes serial dataset capture and preparation for model/data work. Firmware source excerpts establish task and queue flow; README statements support the documented MQTT and dashboard capabilities. Some training and alert details are represented without asserted internal call paths because their implementation was not excerpted.
Main entry points: App.jsx Patient dashboard · sensores.cpp Sensor acquisition · tareas_mqtt.cpp Telemetry formatting · main.cpp Task startup
Components 15
Wearable firmware
- Sensor acquisition
firmware_esp32/src/sensores.cpp - Measurement records
firmware_esp32/include/mediciones.h - FreeRTOS queues
firmware_esp32/src/colas.cpp - Task startup
firmware_esp32/src/main.cpp - Telemetry formatting
firmware_esp32/src/tareas_mqtt.cpp - Wi-Fi and MQTT
firmware_esp32/src/red_mqtt.cpp - Local alarm
firmware_esp32/src/tarea_buzzer.cpp
MQTT transport
- EMQX broker
Web dashboard
- Patient dashboard
web_app/src/App.jsx - React entry point
web_app/src/main.jsx
Dataset workflow
- Serial capture
entrenamiento/capturar_dataset.py - Recorded trials
entrenamiento/dataset - Dataset preparation
entrenamiento/salida_procesamiento/preparar_dataset.py - Prepared events
entrenamiento/salida_procesamiento
Other components
- Caregiver
Connections 18
- Task startup → Sensor acquisition: starts tasks
firmware_esp32/src/main.cpp - Task startup → Telemetry formatting: starts tasks
firmware_esp32/src/main.cpp - Task startup → Local alarm: starts task
firmware_esp32/src/main.cpp - Sensor acquisition → FreeRTOS queues: enqueues samples
firmware_esp32/src/sensores.cpp - Sensor acquisition → Measurement records: fills records
firmware_esp32/src/sensores.cpp - Telemetry formatting → FreeRTOS queues: reads samples
firmware_esp32/src/tareas_mqtt.cpp - Telemetry formatting → FreeRTOS queues: queues telemetry
firmware_esp32/src/tareas_mqtt.cpp - Telemetry formatting → Wi-Fi and MQTT: uses MQTT client
firmware_esp32/src/tareas_mqtt.cpp - Wi-Fi and MQTT → EMQX broker: publishes telemetry
- Patient dashboard → EMQX broker: subscribes to topic
web_app/src/App.jsx - React entry point → Patient dashboard: renders
web_app/src/main.jsx - EMQX broker → Patient dashboard: delivers messages
web_app/src/App.jsx - Caregiver → Patient dashboard: views and responds
README.md - Patient dashboard → EMQX broker: requests alarm control
README.md - Serial capture → Recorded trials: records trials
- Dataset preparation → Recorded trials: processes trials
- Dataset preparation → Prepared events: writes outputs
- Sensor acquisition → Local alarm: triggers fall alert
README.md