48 Commits

Author SHA1 Message Date
Colonel Panic
6c6930b191 datasets: add @NitekryDPaul WiFi OUI research
30 Flock Safety infrastructure OUIs discovered through 2.4 GHz
promiscuous-mode analysis by @NitekryDPaul, including the addr1
receiver-side detection technique that catches Flock STAs during
their burst-sleep duty cycles when addr2-only sniffs miss them.
2026-04-20 07:36:51 -04:00
Colonel Panic
867d193432 Revert "datasets: add @NitekryDPaul WiFi OUI research"
Moving the dataset file to the 'promiscious' branch where it lives
while the promiscuous-mode firmware is still in flight.
2026-04-20 07:34:12 -04:00
Colonel Panic
1b4876208a datasets: add @NitekryDPaul WiFi OUI research
30 Flock Safety infrastructure OUIs identified by @NitekryDPaul via
2.4 GHz promiscuous-mode analysis, including the addr1-receiver
detection technique that catches Flock STAs during burst-sleep
duty cycles. Full credit and methodology in the new file.
2026-04-20 07:31:55 -04:00
Colonel Panic
1d1a598f25 Merge branch 'dev': bulletproof GPS tagging + atomic session persistence 2026-04-17 09:49:40 -04:00
Colonel Panic
3dc74c2b9d flockyou: bulletproof GPS tagging + atomic session persistence
Fix GPS not tagging all detections:
- Add dedicated fyGPSMutex guarding fyGPSLat/Lon/Acc/Valid/LastUpdate
- fyGPSSnapshot() + fyGPSUpdate() replace direct global reads/writes,
  eliminating the race between BLE callback (reader) and /api/gps
  HTTP handler (writer)
- fyBackfillGPS() runs every 2s in loop(), stamping any detection that
  was recorded before the first phone GPS fix became available
- BLE callback JSON emitter now uses snapshot instead of raw globals

Make data saving/transfer bulletproof:
- New envelope format: header line {v,count,bytes,crc32} + payload array
- CRC32 verification catches any truncation or corruption on read
- Atomic write: compute CRC pass 1, write tmp + verify, then rename to
  final (SPIFFS.rename with copy+delete fallback)
- Boot-time recovery: if session.json is missing/corrupt, recover from
  session.tmp; legacy raw-array files still load for back-compat
- Save cadence tightened: within 5s of first detection, after any new
  unique detection (3s throttle), and periodic safety net every 15s
- Export mutex timeouts raised 200->500ms to prevent empty CSV/JSON
  exports under heavy BLE traffic
- /api/history and /api/history/kml strip envelope header before
  returning body so downstream tools keep working unchanged

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 06:46:27 -04:00
Colonel Panic
e307b821e6 Merge pull request #30 from dougborg/ble-gatt-companion
Add BLE GATT server, serial host detection, and companion mode
2026-02-15 15:52:01 -05:00
Colonel Panic
53533a9a09 Merge pull request #29 from dougborg/add-oui-prefixes
Add OUI prefixes for Flock WiFi, Flock Safety direct, and ShotSpotter
2026-02-15 15:50:03 -05:00
Doug Borg
42a7a6f84f Fix heartbeat timer leak for low-confidence detections, bump method buffer
Low-confidence mac_prefix_mfr hits no longer update fyLastDetTime/fyLastHB,
preventing them from keeping the heartbeat alive after a high-confidence
device leaves range. Bump FYDetection::method from 24 to 32 bytes so
"mac_prefix_soundthinking" (23 chars) has headroom.
2026-02-08 14:16:53 -07:00
Colonel Panic
6233d4884e fix session persistence: replace unreliable SPIFFS.rename with copy+delete
- fyPromotePrevSession now reads session.json, writes to prev_session.json,
  then deletes the original — SPIFFS.rename() silently fails on ESP32
- prior session KML export: added style defs, raven metadata, error handling,
  moved file validation before response stream init
- reduced auto-save interval 60s → 15s, added 5s quick-save on first detection
2026-02-08 15:43:14 -05:00
Doug Borg
ddcfa8a171 Split MAC prefixes by vendor/confidence to reduce false positives
Address Copilot review: contract manufacturer OUIs (Liteon/USI) are now
in a separate flock_mfr_mac_prefixes[] array emitting "mac_prefix_mfr"
as the detection method. SoundThinking/ShotSpotter gets its own array
and "mac_prefix_soundthinking" method. Low-confidence detections (mfr
OUIs) suppress buzzer/heartbeat but still emit JSON events so consumers
can apply their own thresholds.
2026-02-07 21:58:54 -07:00
Doug Borg
a6cc6c74ae Always emit is_raven and raven_fw in detection JSON
Collapse the two-branch snprintf into a single call so every
detection message includes is_raven (true/false) and raven_fw,
making the format self-describing regardless of device type.
2026-02-07 21:46:51 -07:00
Doug Borg
47739675c7 Defer companion mode switch from BLE callbacks to loop()
BLE server callbacks run on the NimBLE host task, not the Arduino
loop task. Calling WiFi state changes and delay() from that context
can stall BLE processing or trip watchdogs, and mutating scan
duration creates a cross-task data race.

Fix: callbacks now just set a volatile pending flag. The actual
WiFi/scan changes are applied in loop() where they're safe.
2026-02-07 21:03:19 -07:00
Doug Borg
b16f3a0c97 Add OUI prefixes for Flock WiFi cameras, Flock Safety direct, and ShotSpotter
Expand MAC prefix detection with entries sourced from:

- Flock WiFi (Liteon/USI): f4:6a:dd, f8:a2:d6, e0:0a:f6, 00:f4:8d,
  d0:39:57, e8:d0:fc — contract manufacturer OUIs (Liteon Technology and
  USI/Universal Scientific Industrial) identified via the OUI-SPY firmware
  ecosystem table and cross-referenced against the IEEE OUI registry.
  These manufacturers produce Flock Safety's WiFi-enabled camera hardware.

- Flock Safety direct: b4:1e:52 — registered directly to "Flock Safety"
  in the IEEE OUI database (MA-L assignment). This is their own prefix
  rather than a contract manufacturer's.

- SoundThinking/ShotSpotter: d4:11:d6 — registered to "SoundThinking Inc"
  (formerly ShotSpotter) in the IEEE OUI database. Their acoustic gunshot
  detection sensors use BLE for local diagnostics and provisioning.
2026-02-07 20:38:51 -07:00
Doug Borg
23635be125 Add BLE GATT server, serial host detection, and companion mode
Enable DeFlock mobile app connectivity via BLE GATT notifications,
and desktop host detection via USB serial heartbeat. When a companion
is connected, WiFi AP is disabled to free radio bandwidth and BLE
scan duty cycle is increased for better detection performance.

- BLE GATT server advertising service UUID a1b2c3d4-e5f6-7890-abcd-ef0123456789
  with TX characteristic (NOTIFY) for streaming detection JSON
- Chunked BLE notification sender respecting negotiated MTU
- "event":"detection" field added to JSON output for DeFlock parser
- Serial host detection via heartbeat timeout (5s)
- Companion mode: WiFi AP off + scan duration 2s→3s when connected
- Scan interval/duration converted from #define to mutable variables
2026-02-07 20:38:09 -07:00
Colonel Panic
32d180dc19 add OUI-SPY firmware ecosystem table with Remote-ID-Spoofer 2026-02-07 17:09:40 -05:00
Colonel Panic
3606f1f812 Overhaul firmware: BLE-only detection, web dashboard, GPS wardriving, session persistence
Complete rewrite of standalone Flock-You firmware:
- Remove WiFi promiscuous mode, all detection is now BLE-only
- Add web dashboard served on AP "flockyou" at 192.168.4.1
- GPS wardriving via phone browser Geolocation API
- SPIFFS session persistence with auto-save every 60s
- Prior session tab (PREV) survives reboots
- KML export for Google Earth (current + prior session)
- JSON/CSV export with GPS coordinates
- Serial JSON output for Flask live ingestion
- Crow call boot sounds with detection/heartbeat alerts
- 200 unique device storage with FreeRTOS mutex
- Flask app: add KML import endpoint, GPS data handling
- Update platformio.ini with AsyncWebServer, ArduinoJson 7, SPIFFS partition
- Rewrite README to reflect current functionality
2026-02-07 12:53:58 -05:00
Colonel Panic
be1f3acde2 Update README.md 2025-11-12 21:26:20 -05:00
Colonel Panic
6d25e944e6 Update hardware requirements in README
Removed display specifications for the Oui-Spy Device.
2025-11-12 21:24:19 -05:00
Colonel Panic
f9aff089e6 Add files via upload 2025-11-12 21:14:08 -05:00
Colonel Panic
0ae84fbc85 Merge pull request #5 from lukeswitz/main
Fix the OUI download call
2025-10-02 14:06:55 -04:00
Luke Switzer
5a71668a3f fix the OUI db download
Fix error 418  "I'm a teapot" from rate limiting
2025-10-01 09:34:54 -06:00
Colonel Panic
8e7accab22 Merge pull request #4 from lukeswitz/main
meerge
2025-09-29 17:59:20 -04:00
Luke Switzer
a6bc7b5311 gitignore 2025-09-29 05:35:24 -06:00
Luke Switzer
9bf8d671b4 fix BLE blocking WiFi scan 2025-09-29 05:34:59 -06:00
Luke Switzer
512a363f83 add esp32c3 support to pio build 2025-09-29 05:32:26 -06:00
Luke Switzer
3971c7d45d fix missing thread context 2025-09-29 05:29:56 -06:00
Colonel Panic
661def11eb Add files via upload 2025-08-29 20:37:40 -04:00
Colonel Panic
04d76e1274 Add files via upload 2025-08-29 16:23:04 -04:00
Colonel Panic
8497469d2e Add files via upload 2025-08-28 20:21:54 -04:00
Colonel Panic
4975cf40ca Update main.cpp 2025-08-27 12:06:05 -04:00
Colonel Panic
c919e3be9f Add files via upload 2025-08-26 13:13:13 -04:00
Colonel Panic
811540a913 Add files via upload 2025-08-23 21:31:33 -04:00
Colonel Panic
ce00093f48 Delete templates/index.html 2025-08-23 21:30:42 -04:00
Colonel Panic
1057b4a2ce Delete requirements.txt 2025-08-23 21:30:18 -04:00
Colonel Panic
1345b01ced Delete flockyou.py 2025-08-23 21:29:54 -04:00
Colonel Panic
f90997706e Update flockyou.py 2025-08-23 15:44:24 -04:00
Colonel Panic
0ee2e6c664 Add files via upload 2025-08-23 14:47:43 -04:00
Colonel Panic
d3629c9f6a Add files via upload 2025-08-23 11:07:57 -04:00
Colonel Panic
d8c52f6d58 Update main.cpp 2025-08-22 12:23:25 -04:00
Colonel Panic
16bd5e927f Update main.cpp 2025-08-22 12:22:45 -04:00
Colonel Panic
374fcb643b Update README.md 2025-08-22 09:17:09 -04:00
Colonel Panic
315dd72097 Update README.md 2025-08-22 09:15:18 -04:00
Colonel Panic
28b9420888 Add files via upload 2025-08-22 09:12:45 -04:00
Colonel Panic
28c692e13b Add files via upload 2025-08-22 09:05:07 -04:00
Colonel Panic
56bad2bad3 Add files via upload 2025-08-22 07:25:49 -04:00
Colonel Panic
a81d0cee9a Add files via upload 2025-08-22 07:12:03 -04:00
Colonel Panic
e7e688b9c2 Update README.md 2025-08-20 21:29:09 -04:00
Colonel Panic
3515c5f67e Add files via upload 2025-08-20 21:28:23 -04:00