This project is a high-precision indoor tracking system designed to monitor the real-time position of multiple tags within a 4x4m environment.
Using a fleet of ESP32-C3 microcontrollers (XIAO and Super Mini) acting as anchors, the system leverages WiFi RSSI (Received Signal Strength Indication) and trilateration math to map coordinates.The system is optimized for stability through Kalman Filtering and Persistent State Tracking, ensuring smooth movement even when individual signals are lost or noisy.

- Anchors: ESP32-C3 (Super Mini) running as passive WiFi scanners.
- Active Tags: ESP32-C3 (XIAO) acting as mobile beacons with integrated OLED status displays and PN532 NFC modules for interaction.
- Passive Tags: ESP32-C3 Super Mini creating alternative beacons for long term storage that can be monitored with minimal battery wastage and a Danger Prevention System with a MPU-6050 Imu
- MQTT (Mosquitto): Lightweight messaging protocol used to relay distance data from anchors to a central Mac server.WiFi: Native ESP32 radio used for both data transmission and signal strength measurements.
- Python 3: The central "Brain" running on macOS.
- Localization: Least Squares Trilateration for coordinate calculation.
- Signal Processing: Kalman Filter implementation via filterpy to predict trajectories and eliminate sensor noise.
- Persistent State Memory: The system maintains a "Memory Table" of the last known distances for every anchor-tag pair, preventing "flickering" if a single packet is dropped.
- Intelligent Fallback: Automatically switches to 2-Point Estimation or Predictive Coasting if a tag moves behind an obstacle and loses line-of-sight with the required 3 anchors.
- Hybrid Interaction: Beyond tracking, tags feature NFC Link Broadcasting (URL redirection to bluespace.fun) and visual status updates via SSD1306 OLED screens.
- Scalability: Designed to handle multiple tags simultaneously by uniquely identifying device MAC addresses and tracking them in isolated Kalman instances.
Scanning: Anchors perform high-speed passive WiFi scans to detect specific TAG_PREFIX SSIDs.
Distance Modeling: RSSI values are converted to meters using the Log-Distance Path Loss Model.Relay: Distance data is published to an MQTT broker hosted on a central node.
Trilateration: The Python engine gathers data from all 4 anchors to calculate the