CONCEPTS

Architettura di Sistema TALIS

Architettura tecnica completa di TALIS: layer firmware (nRF52840/PlatformIO), comunicazione (BLE/LoRa/Meshtastic), backend (FastAPI+TimescaleDB), app (Flutter) e hub padrone (ESP32-S3).

TALIS è un ecosistema modulare stratificato: il firmware sul collar comunica via BLE con l'app e via LoRa/Meshtastic con l'hub padrone, che fa da bridge verso il backend cloud/self-hosted.

Stack per Layer

Layer 1 — Firmware Collar (nRF52840)

Chip: Seeed XIAO nRF52840 Toolchain: PlatformIO + Arduino framework + NimBLE Migrazione prevista: Zephyr RTOS in v2.0 (PCB custom)

Componenti hardware sul collar:

  • IMU: LSM6DS3 via I2C — step counter (threshold peak detection asse Z), activity state (non necessario se si usa Seeed XIAO nRF52840 Sense Plus, che include IMU integrata)
  • Display: E-Ink 1.54" via SPI — nome pet, step count, battery icon, last sync
  • LED RGB: WS2812B — stati operativi visualizzati a colori
  • Buzzer piezo: SMD 5x5mm, 85dB, 2.7kHz — SOS, low battery, find-my-device, training clicker
  • Torch LED: white, 150mA, 20 lumen, auto-off 60s
  • GPS (v1.1+): u-blox NEO-M8N o MAX-M10S via UART, NMEA 0183 parser, MOSFET power gating
  • LoRa (v1.2+): Ebyte E22-900M22S (SX1262), Meshtastic serial API

BLE Services principali:

  • Battery Service (0x180F)
  • Custom Telemetry Service — notify battery/steps/activity ogni 5s
  • GPS Service (v1.1+) — 3 caratteristiche GPS
  • DFU Service (Nordic 0xFE59) — OTA firmware update, ECDSA P-256 signing

Advertising: prefisso OT-{chipID}

Features firmware implementate:

  • Lost mode state machine: SEARCHING → ALERT → FOUND (1-min LED/buzzer duty cycle)
  • Nearby-only RSSI gating: threshold -75 dBm, comandi NEARBY_ON/OFF via BLE
  • LED pattern engine: colore + pattern (steady/pulse/double-blink/chase/wave), 5-60s
  • Training clicker: 2.7kHz, 100-500ms, positive reinforcement

Layer 2 — Comunicazione

CanaleRangeUso
BLE 5.0~100mConnessione app, telemetria real-time, pairing QR
LoRa 868/915 MHzkmMesh off-grid, SOS broadcast, telemetria senza cellulare
GPS NMEAFix outdoor, trail polyline, A-GPS injection

LoRa/Meshtastic: Meshtastic serial module API per mesh routing + crittografia + interoperabilità con nodi esistenti. Fallback a raw SX1262 se protocol break.

Layer 3 — Hub Padrone

Hardware: ESP32-S3 + LLCC68 LoRa module (~€42.32 BOM) Display: Waveshare 200×200 1-bit E-Ink (5000-byte frame buffer, 5 schermate: Home/Nodes/Inbox/Stats/SOS) Funzioni: Gateway mesh, bridge MQTT, SOS handler, messaggistica testuale

Firmware hub:

  • WiFi + LoRa LLCC68 dual-transport
  • MQTT client C++ → publish su 5 topic mesh
  • E-Ink UI: partial refresh per liste, full refresh per cambio schermata, torch auto-off 5 min
  • SOS handler: manual protobuf encoder per MeshPacket+DATA, broadcast 0xFFFFFFFF ogni 30s

Nota: T-Echo non ha WiFi — WiFiClient è stubbato con [HARDWARE_RECONCILE_NEEDED] per co-processor ESP32-S3 o modulo cellulare.

Layer 4 — Backend

Stack: FastAPI (Python) + PostgreSQL 16 + TimescaleDB + Mosquitto MQTT + Redis Deploy: Docker Compose (self-hosted) o SaaS cloud opzionale

API principali:

  • POST /telemetry — ingestion batch (location, IMU, battery, GPS)
  • GET /device/{id}/location — ultimo fix
  • WebSocket /ws/stream/{device_id} — push real-time
  • Lost mode API + WebSocket broadcast
  • Privacy API: audit/retention/deletion endpoints
  • SaaS: multi-tenant, subscription, Stripe webhook

Database:

  • Tabella telemetry come TimescaleDB hypertable
  • 7 colonne GPS nullable aggiunte in Phase 16
  • Alembic per migrazioni

LoraIngestor: wired in FastAPI lifespan, subscrive a 5 topic mesh (nodes/messages/sos/telemetry/cmd), deduplica per composite key, broadcast SOS a WebSocket

Layer 5 — App Mobile (Flutter)

Framework: Flutter (single codebase iOS + Android) Mappa: flutter_map con OSM tiles BLE: NimBLE/flutter_blue stack; Map<String, _BleConnection> per multi-device connection pooling

Schermate principali:

  • Device List — card per tracker, last seen, battery %
  • Map View — marker device, 24h polyline trail
  • Device Detail — battery graph, activity summary, firmware version
  • Pairing Flow — QR scan → BLE connect → register
  • GPS Status Card — FixType enum, constellation chips, signal bars (Phase 17)
  • Nearby-only UI (Phase 12)
  • Privacy Settings (Phase 14)
  • LoRa Mesh screens (Phase 22)
  • SaaS Dashboard — TenantSwitcher, SubscriptionStatus, /billing route

Deferred: Google Find My Device — no open-source workaround; richiede Fast Pair commercial certification

Modularità Hardware

Il principio guida è la modularità fisica:

  • Connettori magnetici pogo-pin per moduli snap-on
  • Batterie swappable: 100-150mAh (city mode) / 800mAh (adventure mode)
  • Moduli espandibili: GPS, LoRa, LTE BYO-SIM, UWB precision finding

Licenze

LayerLicenza
Software (firmware + backend + app)AGPLv3
Hardware design (PCB, case)CERN-OHL-S v2
ContribuzioniDCO (Signed-off-by)

See Also

Sources

  • TALIS — Visione e Decisioni Chiave
  • TALIS — Requisiti v1.0