Skip to content

Monitor Overview

The Sensor Net monitor is a desktop application that connects to the receiver node over USB, reads incoming sensor data, and displays a live analytics dashboard. It is the “present” layer of the Information Internetworks data pipeline — turning raw sensor reports into meaningful visualizations.

Full Monitoring Dashboard

The monitor application lives in the sensor-net-monitor repository.

The monitor application performs three functions:

  1. Reads data from the receiver. A Rust backend opens the USB serial port, reads lines from the receiver node, and parses each [REPORT] line into structured data.
  2. Stores data persistently. Parsed reports are inserted into a local SQLite database so historical data is retained across sessions.
  3. Renders a live dashboard. A React/TypeScript frontend polls the database and computes analytics (trends, anomalies, node health), then renders charts, status indicators, and detailed data tables.

The application is built with Tauri, a framework for building desktop applications with a web frontend and a native backend.

LayerTechnologyRole
BackendRust (Tauri)Serial port I/O, SQLite database, command API
FrontendReact + TypeScriptDashboard UI, analytics, data visualization
BundlerViteFast frontend build and hot reload
StylingTailwind CSSUtility-first CSS framework
UI primitivesshadcn/uiPre-built accessible components (buttons, cards, etc.)
Package managerBunManages JavaScript dependencies

The application has a clear separation between the native backend and the web frontend.

All native functionality lives in a single Rust file. It exposes Tauri commands that the frontend can call using invoke(), similar to an HTTP API but over an internal message bridge. The backend handles:

  • Listing available serial ports
  • Opening and closing the serial connection
  • Parsing incoming serial data with a regex
  • Writing parsed reports to SQLite
  • Responding to frontend queries for node summaries, sensor data history, statistics, and recent reports

When a serial connection is opened, the backend spawns a background thread that reads lines from the serial port continuously. Each line is emitted to the frontend as a serial-log event. If a line matches the [REPORT] format, it is also parsed, inserted into the database, and a new-report event is emitted.

The frontend is a standard React application with two custom hooks that manage all state:

  • useSerial — Tracks serial connection state, available ports, and raw log lines. Calls into Rust for port operations and listens for Tauri events.
  • useMonitorData — Fetches database-backed data (node summaries, stats, sensor history, recent reports). Refreshes automatically on new-report events and every 5 seconds as a fallback.

Both hooks are called in App.tsx and their return values flow down to child components as props. There is no global state library.

Between the data hooks and the UI components sits a pure analytics layer. These are plain functions with no side effects and no UI — they take data in and return computed results:

FunctionInputOutput
computeSensorInsightsTemperature and pressure historyTrend direction, rate of change, anomaly flags per sensor
computeNodeHealthNode summariesSignal quality assessment and online/offline status per node
computeSystemStatusInsights + node healthOverall system health level (nominal, warning, critical)
buildPacketInfosRecent reportsFormatted packet display objects for the packet inspector

App.tsx wraps these calls in useMemo so they only re-run when input data changes, not on every render.

The application creates a SQLite database automatically on first launch. All sensor data is stored in a single reports table. The database file persists between sessions, so you can close and reopen the app without losing historical data.

OSDatabase Location
macOS~/Library/Application Support/lora-monitor/data.db
WindowsC:\Users\<You>\AppData\Roaming\lora-monitor\data.db
Linux~/.local/share/lora-monitor/data.db

To start fresh, simply delete the data.db file. It will be recreated on the next launch.

Proceed to Monitor Setup to install the prerequisites and clone the repository.