User Tools

Site Tools


timi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
timi [2026/04/26 10:52] – expanded TIMI page from AGENTS.md and repo timitimi [2026/04/27 15:49] (current) – Update main page: top changelog, v1.5 sidecars, inline gopro timi
Line 3: Line 3:
 //TAMI Inventory Management Interface// //TAMI Inventory Management Interface//
  
-//"timi is always at home."//+//"timi is always at ~/"//
  
 TIMI is the combined weekend-hackathon brainchild of TAMI folks building an **audio-visual inventory dataset** for the space — and eventually a **space-aware inventory tagging, logging and querying system**. It is critical infrastructure. It is also complete and utter bullshit. This is a hackerspace. TIMI is the combined weekend-hackathon brainchild of TAMI folks building an **audio-visual inventory dataset** for the space — and eventually a **space-aware inventory tagging, logging and querying system**. It is critical infrastructure. It is also complete and utter bullshit. This is a hackerspace.
 +
 +===== Recent Changes =====
 +
 +  * **2026-04-27** — Rerun-based **dataset viewer** for browsing local and remote captures; agent tmux workflow for dashboard, viewer, and GoPro services.
 +  * **2026-04-27** — **gopro-scicam merged inline** from submodule to simplify builds and eliminate sync friction.
 +  * **2026-04-26** — **Unified sidecar schema v1.5** across Android and GoPro: ''qr_item_id'', ''capture_id'', ''device_name'', and ''device_id'' now present everywhere.
 +  * **2026-04-26** — **Dashboard enhancements**: gallery and sidecar preview, ''capture_alert'' feedback, beacon-based auto-discovery sync.
 +  * **2026-04-25** — **GoPro station mode**: split-screen live preview + last capture; QR debounce (2× consecutive); real camera settings (ISO, shutter, aperture, AE/AWB) queried for sidecars.
 +
 +Full history: [[timi:changelog|TIMI Changelog]]
  
 ===== What is TIMI? ===== ===== What is TIMI? =====
  
-At its core TIMI is three things:+At its core TIMI is four things:
  
   * **SciCam** — an Android camera app that snaps photos (and videos), writes JSON sidecars with EXIF + metadata, exposes a NanoHTTPD REST API, and auto-captures via QR codes.   * **SciCam** — an Android camera app that snaps photos (and videos), writes JSON sidecars with EXIF + metadata, exposes a NanoHTTPD REST API, and auto-captures via QR codes.
 +  * **GoPro Bridge** — a Flask server that talks to a GoPro over USB WiFi, pulls captures, runs a live preview stream, and does **motion-based auto-capture** with an ROI editor. Writes the same SciCam-compatible sidecars.
   * **Dashboard** — a Rust TUI that discovers devices via UDP multicast, monitors them, and one-way mirrors captures to a local archive.   * **Dashboard** — a Rust TUI that discovers devices via UDP multicast, monitors them, and one-way mirrors captures to a local archive.
   * **Dataset** — a growing folder of ''images'', ''videos'', and ''.json'' sidecars that describe stuff in the space.   * **Dataset** — a growing folder of ''images'', ''videos'', and ''.json'' sidecars that describe stuff in the space.
Line 19: Line 30:
 ===== Architecture ===== ===== Architecture =====
  
-<code> +{{timi:timi-architecture.svg|TIMI Architecture}} 
-+-------------+      UDP multicast      +-----------------+ + 
-|   SciCam    | <-- 239.255.0.1:9876 -->| Rust Dashboard  | +All capture sources broadcast **UDP multicast beacons** every 5 s to **239.255.0.1:9876**. The **Dashboard / Sync Server** (Rust TUI) auto-discovers them, monitors their state over HTTP/SSE, and one-way mirrors captures (JPEG, MP4, JSON sidecars) into ''~/timi/capture''. 
-| (Android)                             (TUI)         | + 
-|  :8080/api  |<------- HTTP/SSE ------> |  ~/timi/capture | +The current focus is **capturing and collecting the dataset**. More processing stages will follow: 
-+-------------+                         +-----------------+ + 
-      | +  * **Segmentation** — isolating objects from backgrounds 
-      v +  * **Labeling** — assigning metadata and categories   
-MediaStore (Pictures/SciCam, Documents/SciCam, Movies/SciCam) +  * **Localization** — determining where an object lives in the space 
-</code>+ 
 +These ML workloads will likely run on the **Fedora workstation** with its **NVIDIA P40 GPU**.
  
 ==== Components ==== ==== Components ====
Line 37: Line 49:
   * **Photo capture** with CameraX, saved to ''Pictures/SciCam/''.   * **Photo capture** with CameraX, saved to ''Pictures/SciCam/''.
   * **Video recording** — toggle with ''POST /record'', saved to ''Movies/SciCam/''.   * **Video recording** — toggle with ''POST /record'', saved to ''Movies/SciCam/''.
-  * **JSON sidecars** — every capture gets a ''.json'' buddy with EXIF, camera settings, item ID, tags, and timestamp. Stored in ''Documents/SciCam/''.+  * **JSON sidecars v1.5** — every capture gets a ''.json'' buddy with EXIF, camera settings, ''qr_item_id'', ''capture_id'', ''device_name'', ''device_id'', tags, and timestamp. Stored in ''Documents/SciCam/''.
   * **QR auto-capture** — point the camera at a QR code, the app snaps automatically. Great for rapid inventory sweeps.   * **QR auto-capture** — point the camera at a QR code, the app snaps automatically. Great for rapid inventory sweeps.
   * **SSE stream** — live events at ''/events'' so the dashboard sees captures in real-time.   * **SSE stream** — live events at ''/events'' so the dashboard sees captures in real-time.
  
-=== Dashboard ===+=== GoPro Bridge (gopro-scicam) === 
 + 
 +  * **Flask server** connecting to GoPro HERO12 (and compatible) via the **Open GoPro USB WiFi API**. 
 +  * **Full web UI** — capture button, live MJPEG preview, gallery, sidecar viewer, and a **table-boundary ROI editor**. 
 +  * **Motion-based auto-capture** — monitors the live preview stream for structural change inside a masked region. Only fires when something actually stays on the table (ignores hands passing through). Adjustable motion and structural thresholds. 
 +  * **Background sync** — on startup, pulls every photo/video from the GoPro SD card that hasn't been downloaded yet. Persists sync history so clearing local files doesn't cause re-downloads. 
 +  * **SciCam-compatible sidecars** — writes the same ''*.json'' format as the Android app (qr_item_id, capture_id, tags, timestamp, camera settings, origin, source="gopro", device_name, device_id). Includes a background QR-retry hunter that tries ZBar, CLAHE, adaptive threshold, and morphological close to read tricky codes. 
 +  * **Live QR detection** — scans preview frames and downloaded images; updates ''item_id'' automatically when a code is found. 
 +  * **Multicast beacons** — broadcasts UDP presence just like SciCam, so the Rust dashboard can discover it. 
 + 
 +=== Dashboard / Sync Server ===
  
   * Rust terminal UI.   * Rust terminal UI.
-  * Auto-discovers devices every 5 s via UDP beacons.+  * **Auto-discovers** devices every 5 s via UDP multicast beacons
 +  * **Syncs** ''*.jpg'', ''*.mp4'', and ''*.json'' from devices to ''~/timi/capture''.
   * Hotkeys: ''r/R'' refresh, ''s/S'' sync, ''w'' watch SSE, ''a'' add, ''d'' delete, ''q'' quit.   * Hotkeys: ''r/R'' refresh, ''s/S'' sync, ''w'' watch SSE, ''a'' add, ''d'' delete, ''q'' quit.
-  * Mirrors ''*.jpg'', ''*.mp4'', and ''*.json'' from devices to ''~/timi/capture''. 
   * Config lives in repo-root ''timi.conf''.   * Config lives in repo-root ''timi.conf''.
  
Line 53: Line 75:
   * **Go CLI** (''clients/go-scicam'') — curl-friendly wrapper.   * **Go CLI** (''clients/go-scicam'') — curl-friendly wrapper.
   * **Web client** (''clients/web-scicam'') — vanilla JS, static HTML.   * **Web client** (''clients/web-scicam'') — vanilla JS, static HTML.
-  * **GoPro bridge** (''clients/gopro-scicam'') — Flask server for GoPro USB WiFi API (WIP). 
  
 ===== Capture Sources ===== ===== Capture Sources =====
Line 61: Line 82:
 ^ Source ^ Status ^ Notes ^ ^ Source ^ Status ^ Notes ^
 | Mobile (SciCam app) | Working | Primary capture device. CameraX + NanoHTTPD. | | Mobile (SciCam app) | Working | Primary capture device. CameraX + NanoHTTPD. |
-| GoPro | TBD | USB WiFi API via ''gopro-scicam'' bridge. |+| GoPro (gopro-scicam) Working Flask bridge over USB WiFi. Preview, auto-capture, ROI mask, background sync, SciCam sidecars. |
 | Canon 70D | In space | Uses [[https://gitlab.com/entangle/entangle|Entangle]] (libgphoto2 frontend). Could script captures to same sidecar format. | | Canon 70D | In space | Uses [[https://gitlab.com/entangle/entangle|Entangle]] (libgphoto2 frontend). Could script captures to same sidecar format. |
 | Lixel 2 Pro | TBD | 3D scanner with cameras. Needs research. | | Lixel 2 Pro | TBD | 3D scanner with cameras. Needs research. |
Line 75: Line 96:
   * Go and web clients consuming the API.   * Go and web clients consuming the API.
   * Full test suite in ''scicam_api_test.sh''.   * Full test suite in ''scicam_api_test.sh''.
 +  * **GoPro bridge** added later — brings a rugged wide-angle camera into the TIMI pipeline with motion auto-capture and the same sidecar format.
  
 ===== API Quick Reference ===== ===== API Quick Reference =====
  
-The API lives at ''http://<device-ip>:8080''. Critical rule: **''POST'' only for state-changing endpoints; ''GET'' returns 404.**+The SciCam API lives at ''http://<device-ip>:8080''. Critical rule: **''POST'' only for state-changing endpoints; ''GET'' returns 404.**
  
 | Method | Endpoint | Purpose | | Method | Endpoint | Purpose |
 | POST | /capture | Trigger photo | | POST | /capture | Trigger photo |
 | POST | /record | Toggle video recording | | POST | /record | Toggle video recording |
-| POST | /settings | Set item_id, tags, lock, debug, capture_alert |+| POST | /settings | Set qr_item_id, tags, lock, debug, capture_alert |
 | POST | /auto-capture | Enable/disable QR auto-capture | | POST | /auto-capture | Enable/disable QR auto-capture |
-| GET | /status | Current state (item_id, tags, locked, last_qr, ...) |+| GET | /status | Current state (qr_item_id, tags, locked, last_qr, ...) |
 | GET | /captures | List all images/videos with sidecar status | | GET | /captures | List all images/videos with sidecar status |
 | GET | /photo/last | Download latest JPEG | | GET | /photo/last | Download latest JPEG |
Line 105: Line 127:
 <code> <code>
 timi/ timi/
-├── scicam/        # Android app (Kotlin + Gradle Groovy DSL) +├── scicam/           # Android app (Kotlin + Gradle Groovy DSL) 
-├── dashboard/     # Rust TUI +├── dashboard/        # Rust TUI 
-├── clients/       # Go CLIweb UI, GoPro bridge (submodules+├── clients/ 
-├── api_spec.yaml  # OpenAPI 3 source of truth +│   ├── go-scicam/    # Go CLI (submodule) 
-├── timi.conf      # Dashboard registry & config +│   ├── web-scicam/   # Vanilla JS static client (submodule) 
-└── capture/       # Default local archive (gitignored)+│   ├── gopro-scicam/ # Flask GoPro bridge (inline, was submodule— KEY PLAYER 
 +├── api_spec.yaml     # OpenAPI 3 source of truth 
 +├── timi.conf         # Dashboard registry & config 
 +└── capture/          # Default local archive (gitignored)
 </code> </code>
  
 ===== Roadmap / Dreams ===== ===== Roadmap / Dreams =====
  
-  * [ ] Prototype ''PreviewView'' overlay for QR region feedback.+  * [ ] Prototype ''PreviewView'' overlay for QR region feedback in SciCam.
   * [ ] Camera calibration data in sidecars (lens distortion via BoofCV).   * [ ] Camera calibration data in sidecars (lens distortion via BoofCV).
   * [ ] Database sync — non-destructive to existing images/sidecars.   * [ ] Database sync — non-destructive to existing images/sidecars.
   * [ ] Canon 70D scripted capture producing TIMI-compatible sidecars.   * [ ] Canon 70D scripted capture producing TIMI-compatible sidecars.
-  * [ ] GoPro integration via ''gopro-scicam''.+  * [ ] Lixel 2 Pro research and integration.
   * [ ] Space-aware querying: "what's in the CNC room?" "how many stepper motors?"   * [ ] Space-aware querying: "what's in the CNC room?" "how many stepper motors?"
  
Line 138: Line 163:
 # Build and install the Android app # Build and install the Android app
 cd scicam && ./gradlew assembleDebug && adb install app/build/outputs/apk/debug/app-debug.apk cd scicam && ./gradlew assembleDebug && adb install app/build/outputs/apk/debug/app-debug.apk
 +
 +# Start the GoPro bridge (needs GoPro in USB Connect mode)
 +cd clients/gopro-scicam && python3 app.py
  
 # Start the dashboard # Start the dashboard
-cd dashboard && cargo build --release && ./target/release/scicam-dashboard+cd ~/timi/dashboard && cargo build --release && ./target/release/scicam-dashboard
  
 # Test against a device on the network # Test against a device on the network
timi.1777200737.txt.gz · Last modified: by timi