Commit Graph

18 Commits

Author SHA1 Message Date
User
04bbd0b0af feat: show peer scanners on 3D map
- Added peer scanner markers to MapLibre 3D view
- Peer scanners shown with cyan icon and absolute position
- Styled with distinct color and shadow

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 04:28:08 +01:00
User
8e25bf8871 feat: preserve source scanner for synced devices
When devices are synced from a peer, they now retain their original
source scanner reference. This ensures:

- Device positions are calculated relative to the scanner that
  detected them, not the local scanner
- Moving the local scanner won't affect synced devices' positions
- Popup shows "Source: <scanner_id>" for remotely-synced devices

Database changes:
- Added source_scanner_id, source_scanner_lat, source_scanner_lon
  columns to devices table
- get_devices_since() includes source scanner info in sync data
- bulk_update_devices() accepts and stores source scanner position
- Added get_all_device_sources() method

API changes:
- /api/sync/devices GET includes scanner_lat and scanner_lon
- /api/sync/devices POST accepts source_scanner_lat/lon
- /api/device/floors includes sources dict

Frontend changes:
- loadDevicePositions() loads source scanner info
- getDevicePosition() uses source scanner position for synced devices
- Popup shows source scanner info for remotely-synced devices

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 04:23:42 +01:00
User
2973178cb8 chore: update GPS coordinates
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 04:15:42 +01:00
User
827830b043 fix: create missing devices during peer sync
- bulk_update_devices now creates devices if they don't exist locally
  but have useful metadata (floor, label, or favorite status)
- Sync trigger endpoint now reports both pulled and pushed device counts
- Enables full bidirectional sync of device metadata between peers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 04:15:36 +01:00
User
6a3e3e8448 feat: add distinct scanner markers on map and radar
- Scanner positions shown as magenta stars (this scanner)
- Peer scanners shown as cyan stars
- Clear visual distinction from WiFi (orange circles) and BT (blue circles)
- Radar view also shows scanner as star shape

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 04:06:21 +01:00
User
bd21edb7d7 chore: remove runtime files from repo 2026-02-01 04:04:53 +01:00
User
a1de52fbcd style: use distinct colors for WiFi and Bluetooth devices
WiFi devices now shown in orange (#f59f00), Bluetooth in blue (#4dabf7).
Makes it easier to distinguish device types on map and in device list.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 04:04:39 +01:00
User
46b7b01e98 fix: exclude position offsets from peer sync
Position offsets (custom_lat_offset, custom_lon_offset) are relative
to each scanner's location, so syncing them between scanners would
place devices incorrectly. Only sync: floor, label, favorite, notes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:52:59 +01:00
User
ea0ee0c190 fix: include saved floor assignments in scan API responses
The /api/scan, /api/scans/<filename>, and /api/latest endpoints
now look up saved floor assignments from the database and include
them in responses. Previously only /api/scan/bt did this.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:46:12 +01:00
User
7eb76498b0 fix: don't update updated_at on device observations
The updated_at timestamp should only change when user metadata
changes (floor, label, position, notes), not on every scan
observation. This was breaking peer sync because observation
timestamps were overwriting metadata timestamps.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:43:34 +01:00
User
7cc7c47805 feat: add Home Assistant integration and improve CLI/UI
Home Assistant Integration:
- New homeassistant.py module with webhook support
- Webhooks for scan results, new devices, and device departures
- Absence detection with configurable timeout
- Documentation in docs/HOME_ASSISTANT.md

CLI Improvements:
- Replace 'web' command with start/stop/restart/status
- Background daemon mode with PID file management
- Foreground mode for debugging (--foreground)

Web UI Enhancements:
- Improved device list styling and layout
- Better floor assignment UI
- Enhanced map visualization

Documentation:
- Add CHANGELOG.md
- Add docs/API.md with full endpoint reference
- Add docs/CHEATSHEET.md for quick reference
- Update project documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:31:02 +01:00
User
0ffd220022 fix: use configured wifi_interface for WiFi scanning
The scan_wifi() calls were using the default "wlan0" instead of
the configured interface from config.yaml. This broke WiFi scanning
on systems with non-standard interface names like wlo1.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:29:48 +01:00
User
fa5178a5be feat: add peer sync for multi-scanner deployments
Enable scanner instances to discover each other and synchronize
device metadata (floors, positions, labels, favorites) automatically.

New features:
- Peer registration API with mutual auto-registration
- Background sync thread with configurable interval
- Timestamp-based conflict resolution (newest wins)
- Config options: peers, sync_interval_seconds, accept_registrations

API endpoints:
- GET/POST /api/peers - list peers, register new peer
- DELETE /api/peers/<id> - remove peer
- GET/POST /api/sync/devices - device sync for peers
- POST /api/sync/trigger - manual sync trigger

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:19:04 +01:00
User
bf455f074b Add TODO: manual position override for floor-assigned devices
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:41:10 +01:00
User
5eb5cd2351 Add popup persistence and update project docs
- Popups now stay open during live BT tracking updates
- Track open popup device ID and restore after marker refresh
- Update TASKS.md, TODO.md, PROJECT.md, ROADMAP.md
- Mark position smoothing, floor persistence as complete

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:40:57 +01:00
User
dda8455813 Fix floor persistence and improve movement detection
- Store floor assignments in SQLite database for persistence
- Floor now saves correctly for live-tracked BT devices
- Add statistical movement detection (5-sample average + stddev)
- Require 1.5m + 2σ deviation to mark device as moving
- Reduces false positives from RSSI noise/fluctuations
- Add /api/device/floors endpoint for bulk floor retrieval

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:34:49 +01:00
User
0e99232582 Switch to bleak for reliable BLE scanning with RSSI
- Replace hcitool-based BT scanning with bleak Python library
- Bleak provides reliable RSSI values via D-Bus/BlueZ
- BLE scan now finds devices that hcitool missed
- Update project docs to reflect resolved BT RSSI blocker
- Add bleak>=0.21.0 to dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:17:47 +01:00
User
52df6421be Initial commit: RF Mapper v0.3.0-dev
WiFi & Bluetooth signal mapping tool for Raspberry Pi with:
- WiFi scanning via iw command
- Bluetooth Classic/BLE device discovery
- RSSI-based distance estimation
- OUI manufacturer lookup
- Web dashboard with multiple views:
  - Radar view (polar plot)
  - 2D Map (Leaflet/OpenStreetMap)
  - 3D Map (MapLibre GL JS with building extrusion)
- Floor-based device positioning
- Live BT tracking mode (auto-starts on page load)
- SQLite database for historical device tracking:
  - RSSI time-series history
  - Device statistics (avg/min/max)
  - Movement detection and velocity estimation
  - Activity patterns (hourly/daily)
  - New device alerts
  - Automatic data retention/cleanup
- REST API for all functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:08:21 +01:00