Commit graph

40 commits

Author SHA1 Message Date
1b3f10b7f5 Public-flip prep: env-driven keystore, README, hardened cleartext, leaner docs
- app/build.gradle.kts: remove hardcoded keystore password (was 'adacam-varroa-2026'
  in 4 spots across a duplicated signingConfigs block). Now reads VARROA_KEYSTORE_PATH
  + VARROA_KEYSTORE_PASSWORD + VARROA_KEY_PASSWORD from env. Password vaulted as
  'Varroa — release keystore'. Drops orphan zxing/camera deps that aren't wired up.
- app/src/main/res/xml/network_security_config.xml: tighten cleartext scope from
  global to just 192.168.0.10 (Bee AP). HTTPS strict for everything else.
- app/src/main/java/.../api/AdaMapsApiClient.kt: drop apiKey.take(8) in log to
  apiKey.length — no need to leak prefix to logcat.
- README.md: add. Public repo without one was a bad first impression.
- docs/BEE-CAMERA.md: rewrite (811→467 lines). Keep all paths, pinouts, bus
  diagrams, depthai/VPU/xlink details, intercept architecture. Strip
  Executive-Summary framing, verdict box, phased roadmap, appendices.
- docs/AIR-QUALITY-INTEGRATION.md: rewrite (712→369 lines). Keep BOM, sensor
  comparisons, wiring, IAQ calc, ingest endpoint shape. Strip feasibility-report
  scaffolding.
- docs/AIR-API-PATCH.py: delete. Was a one-shot apply-and-discard patch script,
  not docs.
2026-05-27 10:30:02 -07:00
7f9bbd3f21 Rotate AdaMaps ingest+read keys (env-required, no inline default)
Previous values (adamaps-ingest-2026, adamaps-read-2026, mapnet-ingest-2026)
were inline defaults across adamaps + adacam-api + varroa. The ingest key
was briefly anon-visible during the 2026-05-27 Forgejo public-flip when
adacam-api + varroa were public for a short window before the leak was
spotted.

New values live in Vaultwarden:
  - AdaMaps — API_KEY (ingest)
  - AdaMaps — READ_KEY

Validators now hard-fail at boot if the env var is missing. Service is
on hold today; when it resumes, both env vars must be set.
2026-05-27 09:17:23 -07:00
55f8d9a2ff varroa: strip Wigle integration (deferred, not in base stack) 2026-03-24 09:38:24 -07:00
7a46d45e79 varroa: strip Wigle integration (deferred, not in base stack) 2026-03-24 09:38:07 -07:00
7ce79a00a8 varroa: strip Wigle integration (deferred, not in base stack) 2026-03-24 09:37:56 -07:00
b17b6c2bbc varroa: strip Wigle integration (deferred, not in base stack) 2026-03-24 09:37:45 -07:00
84f0ab8d39 Update Settings screen hint text to show correct default Bee URL 2026-03-22 00:41:49 -07:00
3b55dbd758 Update BeeApiClient default URL to 192.168.0.10:5000 2026-03-22 00:41:31 -07:00
a20e510f44 Change default Bee URL from 10.77.0.1 to 192.168.0.10 (factory AP IP) 2026-03-22 00:41:13 -07:00
82ae988264 fix: allow cleartext HTTP to all IPs — Bee AP varies by network (10.77.0.x on truck) 2026-03-21 15:21:55 -07:00
3644e6ccb0 feat: v1.8.0 — new app icon (varroa-final.png) + fix GnssStatus model conflict + remove SSH fallback 2026-03-15 09:24:15 -07:00
Kayos
1f12860ba4 v1.8.0: new app icon (varroa-final, green skull on black) 2026-03-15 09:10:15 -07:00
b9e6d6f601 Merge GnssStatus fields from both API versions 2026-03-14 21:10:36 -07:00
b23a5415a3 Fix compilation errors: remove duplicate GnssStatus, add getDeviceIdViaSsh stub, fix nullable Boolean condition 2026-03-14 21:06:44 -07:00
b8c0ef3086 Add release signing config for persistent keystore 2026-03-14 21:01:36 -07:00
33f7beab39 feat: wigle wardriving UI — account linking and stats 2026-03-14 15:49:28 -07:00
d11f6b62d1 feat: adacam migration — update IP, pairing, bearer auth, wifi/ssh config, remove JSch and cmd
- Default API URL: 192.168.0.10 → 10.77.0.1
- BeeApiClient: apiToken field, bearer auth on POST endpoints, pair() method,
  getSshStatus(), setSshEnabled() — JSch/SSH-from-app removed entirely
- Models: PairResponse, SshStatus, WifiStatus data classes
- SettingsDataStore: deviceSerial, apiToken, isPaired persistence + deriveApiToken()
- SettingsViewModel: pairDevice(), connectWifi(), toggleSsh(), refreshSshStatus(),
  refreshWifiStatus(), isPaired/deviceSerial/sshStatus/wifiStatus StateFlows
- SettingsScreen: Pairing section, Home WiFi config section, SSH toggle section
  renamed BEE DEVICE → ADACAM DEVICE, hint URL updated
- build.gradle: removed JSch dependency (no longer SSHing from app)
2026-03-14 11:56:46 -07:00
60d2f693d1 Add BeeSettingsScreen with device info, WiFi, storage, GNSS, upload mode, plugins
- New BeeSettingsScreen.kt: full Bee device settings UI
  - Device Info section (read-only): ID, firmware, serial, uptime, GPS lock
  - WiFi Client section (read/write): status, saved network, scan, configure
  - Storage section: cache status + FrameKM storage with visual bar
  - GPS/GNSS section: fix status, coordinates, satellites, accuracy
  - Upload Mode section: LTE/WIFI/APP toggle buttons
  - Plugin Status section: beekeeper, depth-ai, privacy-zones, map-ai states
  - Loading/error/offline states with retry
- New BeeSettingsViewModel.kt: parallel fetching from all Bee API sections
- Extended BeeApiClient: WiFi settings/status/scan/enable/reset, upload mode,
  config, cache status, FrameKM total, GNSS status, plugin state methods
- Extended Models.kt: WifiClientSettings, WifiStatus, WifiNetwork, CacheStatus,
  BeeConfig, UploadModeResponse, GnssStatus, PluginState, FrameKmTotal
- Navigation.kt: added BEE_SETTINGS route
- DashboardScreen: added Bee Device router icon in top bar, CONFIGURE link
  in Device Status card
2026-03-14 11:52:16 -07:00
Kayos
4cd65cc441 air overlay: hide legend when inactive, fix script tag comment bug 2026-03-13 12:18:43 -07:00
Kayos
33cdc3a50c air quality: API routes + frontend heatmap overlay (pending Cobb approval) 2026-03-13 07:58:16 -07:00
Kayos
28cacd540f blackbox: air quality aggregator (Pi 3B+ → AdaMaps) 2026-03-13 07:37:54 -07:00
6b39f4ea23 Update air quality sensor integration feasibility report 2026-03-13 07:16:15 -07:00
c780aa8f54 Add air quality sensor integration feasibility report 2026-03-13 07:16:02 -07:00
018636ed83 docs: add comprehensive Bee camera system report 2026-03-13 06:48:43 -07:00
d3cf0d5d47 v7.9: fix SettingsDataStore default API key (mapnet -> adamaps) 2026-03-12 16:34:28 -07:00
Kayos
c4328308f3 fix: update API key and auth header to adamaps naming (mapnet -> adamaps) 2026-03-12 14:28:59 -07:00
Kayos
9a9e22d714 v7.7: Device Status screen with WiFi, storage, GPS, plugins
- Add DeviceStatusScreen with full device info display
- Add WiFi client configuration
- Add storage status with usage bar
- Add GPS/GNSS status display
- Add upload mode toggle (auto/wifi/lte/off)
- Add plugin list display
- New API endpoints in BeeApiClient for device settings
- Navigate to Device Status from Settings screen
2026-03-12 09:42:50 -07:00
9383d88f1e v7.6: image capture and upload 2026-03-12 03:40:17 -07:00
c7b496ec2b v7.5: wallet linking for MAP token rewards
- Add walletAddress field to SettingsDataStore
- Settings screen: input field, QR scanner, address validation
- Include wallet_address in detection uploads to API
- Show linked wallet status in main UI (green wallet icon)
- Cardano address validation (addr1/stake1 prefixes)
- Version bumped to 1.7.5 (versionCode 11)
- APK built and signed at /root/.openclaw/workspace/projects/varroa-v7.5.apk
2026-03-11 23:18:03 -07:00
1ae0657bb0 v7.4: fetch all landmarks + cleanup after upload
- Updated version to 1.7.4 (versionCode 10)
- Modified BeeApiClient.getLandmarks() to fetch 50,000 landmarks instead of 200
- Added cleanupLandmarks() method to attempt deletion from Bee device after upload
- Enhanced AdaMapsUploadWorker to call cleanup after successful upload to ADAMaps
- Cleanup tries multiple potential DELETE endpoints and cmd interface
- Documents limitation: Bee API may not support landmark deletion

Note: Cleanup functionality is exploratory - no confirmed DELETE endpoint found in Bee API docs
2026-03-11 14:56:53 -07:00
19ab72d8ea v7.3: reliable device_id with SSH fallback
- Add JSch SSH library dependency
- Persistent device_id cache in DataStore (not just memory)
- Load cached device_id on app start
- Only fetch if missing or 'unknown'
- 30-second timeout for /api/1/info endpoint
- SSH fallback to root@192.168.0.10:22 when API fails
- Retry device_id fetch after successful landmark poll
- Fallback order: DataStore cache → API → SSH
- Build signed APK at /root/.openclaw/workspace/projects/varroa-v7.3.apk
2026-03-11 13:50:15 -07:00
0cc11c5158 v7.2: simplify - single Bee IP, fix device_id 2026-03-11 12:58:28 -07:00
63801d8f12 v7.1: add verbose debug logging 2026-03-11 12:20:04 -07:00
964d175454 v7: store-and-forward architecture
BREAKING: Complete rewrite of data flow to fix network isolation issue.

Problem: When connected to Bee's WiFi AP (192.168.0.10), the phone has
NO internet access. The Bee AP is just a direct connection to the dashcam
with no upstream gateway. The old design tried to simultaneously pull from
Bee and push to ADAMaps, which fundamentally couldn't work.

Solution: Store-and-forward with two independent subsystems:

1. BeeCollectorService - Collection only
   - Binds to unvalidated WiFi (Bee AP)
   - Polls Bee for detections
   - Stores to local Room database
   - Does NOT attempt internet uploads

2. AdaMapsUploadWorker - Upload only
   - WorkManager-based background worker
   - Only runs when device has VALIDATED internet
   - Reads from local DB, batch uploads to ADAMaps
   - Marks as synced, retries with backoff

New components:
- Room database (DetectionEntity, DetectionDao, VarroaDatabase)
- NetworkStateMonitor for tracking validated vs unvalidated networks
- Improved UI with BEE/LOCAL/UPLOAD indicators
- Manual sync trigger when internet + pending data

Version: 1.7.0 (versionCode 7)
2026-03-11 11:11:05 -07:00
2cebb4fb5d v6: retry indefinitely with backoff, never drop detections
- Remove 5-attempt drop limit — retry forever until success
- Exponential backoff for retries: 5s → 10s → 20s → 40s → 60s (capped)
- Only drop detections if queue exceeds 2000 (memory protection)
- Drop oldest first when over limit (FIFO eviction)
- Show retry countdown in error message
- Reset backoff on successful send

Handles intermittent 502s from ADAMaps gracefully by holding queue
until server recovers.
2026-03-11 10:39:28 -07:00
f06ce3f319 v6: fix detection send queue
Root cause: Server expects flat array of detections with device_id on each
item, but client was sending nested {device_id, detections: [...]}.

The /health endpoint worked (ADAMaps showed green) but /api/ingest failed
validation: 'Missing required fields: device_id, lat, lon' on every request.
Items queued indefinitely, sent=0.

Fixed by:
- Adding device_id field to AdaMapsDetection
- Changed AdaMapsIngestRequest to typealias for List<AdaMapsDetection>
- Updated toAdaMapsDetection() to accept deviceId parameter
- Updated ForwardingService to send flat array format
2026-03-11 10:37:56 -07:00
2b8c19eef1 v5: restore WiFi routing fix, fix send queue
FIXES:
- Restored port 5000 (Bee's odc-api runs on 5000, not 5001)
- Restored multi-IP discovery (primary: Bee AP, alt: home WiFi)
- Added custom DNS resolver for ADAMaps (hardcodes 142.44.213.229)
  This fixes the '0 sent' bug - DNS fails on Bee AP (no upstream)
- Restored alt URL field in settings
- Kept exponential backoff and retry queue from v3

The DNS fix is the key: when connected to Bee's AP (192.168.0.10),
Android's DNS resolver can't resolve api.adamaps.org because
the AP has no internet. Custom Dns object bypasses this.
2026-03-11 10:06:55 -07:00
3cac92fbfd v1.3.0: Port 5001 proxy, exponential backoff, retry queue
Root cause: odc-api binds to localhost only, not accessible from AP clients.
Solution: socat/python proxy on Bee forwards 0.0.0.0:5001 → 127.0.0.1:5000

App changes:
- Default URL now http://192.168.0.10:5001 (proxy port)
- Exponential backoff: 5s → 60s max when offline
- Clean 'Bee offline' status instead of red errors
- Retry queue: Failed ADAMaps sends retry up to 5x
- Camera shows 'Bee offline' when disconnected
- Simplified settings (removed dual-IP, single URL)

Requires running bee-proxy-setup.sh on the Bee first.
2026-03-11 09:57:02 -07:00
e28234c7b9 v1.3.0: Multi-IP fallback, exponential backoff, retry queue
Fixes:
- Multi-IP discovery: Try both primary (AP) and alt (home WiFi) IPs in parallel
  with 3-4s timeouts each. First responder wins.
- Exponential backoff: When Bee is offline, retry with increasing delays
  (5s → 60s max) instead of hammering every 10s
- Clean offline state: Show 'Bee offline' status instead of ugly red errors
- Retry queue: Failed ADAMaps sends are queued and retried (up to 5 attempts)
  instead of being silently dropped
- Camera shows 'Bee offline' instead of spinning 'Awaiting frame...'
- Settings: Added 'Bee Alt URL' field for configuring home WiFi IP
- Better connection status display showing which mode is active

Fixes the '206 collected, 0 sent' bug - detections now queue and retry
2026-03-11 09:53:01 -07:00
71bb4e16b9 Initial commit: Varroa ADAMaps Android app
Full rewrite of bee-debug-app as ADAMaps data proxy.
- Detection forwarder to ADAMaps API (polls landmarks/last/200, dedup by id+ts)
- 30s camera snapshot with 4-endpoint auto-detect
- GPS mini-map via osmdroid/OpenStreetMap
- Device status panel (firmware, GPS, AI ready flags)
- Connection status bar + forwarding toggle
- Foreground service with persistent notification
- Dark amber theme, no Google Play Services
- Package: com.adamaps.varroa, minSdk 26
2026-03-10 12:19:48 -07:00