MeshDash Docs
R2.0
/
Home Getting Started Database Schema

Database Schema

Getting Started database schema sqlite tables packets nodes messages telemetry positions traceroutes neighbors waypoints connection_log users WAL
Every SQLite table, its columns, and what data is stored in meshtastic_data.db and tasks.db.

MeshDash uses two SQLite databases. Both use WAL (Write-Ahead Logging) mode for better concurrency and thread-local connections with a 30-second timeout. Understanding the schema helps you query data directly or write plugins that extend storage.

meshtastic_data.db

The main database containing all mesh network data, users, and monitoring rules. Path set by DB_PATH in config.

packets

Every decoded packet received or sent. The primary packet log.

ColumnTypeDescription
idINTEGER PKAuto-increment row ID
event_idTEXT UNIQUEUnique event ID (pkt_TIMESTAMP_COUNTER for received, tx_TIMESTAMP for sent)
timestampREALUnix timestamp (float) when packet was processed
rx_timeINTEGERRadio's rxTime field (may differ slightly from timestamp)
from_idTEXTSender node ID in !xxxxxxxx hex format
to_idTEXTRecipient: !xxxxxxxx or ^all
channelINTEGERChannel index (0–7)
packet_typeTEXTClassified type: Message, Position, Telemetry, Node Info, Ack, Traceroute, etc.
rx_snrREALSignal-to-noise ratio in dB (null if not physically received)
rx_rssiINTEGERReceived signal strength in dBm
hop_limitINTEGERRemaining hop limit when received
hop_startINTEGEROriginal hop limit set by sender. Hops consumed = hop_start − hop_limit
want_ackBOOLEANWhether the sender requested an ACK
decodedTEXTJSON-encoded decoded payload object
rawTEXTJSON-encoded raw packet object from SDK
sourceTEXTSource detection result: RF, MQTT, UNKNOWN, or LOCAL
source_confidenceREALDetection confidence score 0.0–1.0

nodes

One row per node ever seen. Updated on every packet received from that node and on background sync. The authoritative node database.

ColumnTypeDescription
node_idTEXT PKHex node ID: !aabbccdd
node_numINTEGER UNIQUE32-bit numeric node number
long_nameTEXTNode's configured long name
short_nameTEXTNode's 4-character short name
macaddrTEXTMAC address from user info
hw_modelTEXTHardware model string e.g. TLORA_V2_1_1P6
firmware_versionTEXTFirmware version string
roleTEXTNode role: CLIENT, ROUTER, ROUTER_CLIENT, etc.
is_localBOOLEANTRUE for the local MeshDash radio node
last_heardINTEGERUnix timestamp of most recent packet from this node
battery_levelINTEGERBattery % (0–100)
voltageREALBattery voltage in V
channel_utilizationREALChannel utilisation %
air_util_txREALAir utilisation TX %
snrREALMost recent SNR reading for this node
rssiINTEGERMost recent RSSI reading
latitudeREALMost recent latitude (decimal degrees)
longitudeREALMost recent longitude
altitudeINTEGERAltitude in metres
position_timeINTEGERTimestamp of most recent position update
user_infoTEXTJSON: {"longName":"...", "shortName":"...", "macaddr":"..."}
position_infoTEXTJSON: full position protobuf fields
device_metrics_infoTEXTJSON: full deviceMetrics protobuf
environment_metrics_infoTEXTJSON: environmentMetrics (temp, humidity, pressure)
module_config_infoTEXTJSON: moduleConfig if received
channel_infoTEXTJSON: channel settings if received
updated_atDATETIMESQLite timestamp of last row update

messages

Text messages only — extracted from packets for easy conversation history.

ColumnTypeDescription
idINTEGER PKAuto-increment
packet_event_idTEXT UNIQUELinks back to packets.event_id
mesh_packet_idINTEGERMeshtastic packet ID used for ACK matching
from_idTEXTSender node ID
to_idTEXTRecipient node ID or ^all
channelINTEGERChannel index
textTEXTMessage text content
timestampREALUnix timestamp
rx_snrREALSNR at reception
rx_rssiINTEGERRSSI at reception
statusTEXTSENT, BROADCAST, DELIVERED, or FAILED — updated when ACK/NACK received

positions

Position history — every position update stored separately for track replay.

ColumnTypeDescription
node_idTEXTNode that sent this position
timestampREALUnix timestamp
latitudeREALDecimal degrees
longitudeREALDecimal degrees
altitudeINTEGERMetres
precision_bitsINTEGERPosition precision bits from firmware
ground_speedINTEGERm/s if available
sats_in_viewINTEGERGPS satellite count
pdopREALPosition dilution of precision

telemetry

Telemetry history — every telemetry update stored for graphing.

ColumnTypeDescription
node_idTEXTSource node
timestampREALUnix timestamp
battery_levelINTEGER%
voltageREALV
channel_utilizationREAL%
air_util_txREAL%
uptime_secondsINTEGERDevice uptime
temperatureREAL°C (null if no environment sensor)
relative_humidityREAL% RH
barometric_pressureREALhPa
gas_resistanceREALΩ (BME680 only)
iaqREALIndoor air quality index (BME680 only)

neighbors

Neighbor table from NEIGHBOR_INFO_APP packets — the RF topology map.

ColumnTypeDescription
node_idTEXTReporting node
neighbor_idTEXTNeighbour node ID
snrREALSNR between this pair as reported by the node
last_seenDATETIMEWhen this neighbour was last reported

traceroutes

ColumnTypeDescription
from_idTEXTOriginating node
to_idTEXTTarget node
route_pathTEXTJSON: {"route_to":[...], "route_back":[...], "snr_towards":[...], "snr_back":[...], "rssi":N, "snr":N, "hops_used":N}
timestampREALUnix timestamp

waypoints

ColumnTypeDescription
from_idTEXTNode that sent the waypoint
waypoint_idINTEGERFirmware-assigned waypoint ID
nameTEXTWaypoint name
latitudeREALDecimal degrees
longitudeREALDecimal degrees
descriptionTEXTOptional description
timestampREALUnix timestamp

hardware_logs

Logs of Admin-type packets and hardware events (GPIO events, admin commands received).

ColumnTypeDescription
node_idTEXTSource node
event_typeTEXTType: Admin, GPIO, etc.
detailsTEXTJSON payload or plain string description
timestampREALUnix timestamp

average_metrics_history

Network-wide average SNR and RSSI computed every 5 minutes across all non-local nodes. Used for the overview metrics chart.

ColumnTypeDescription
timestampREAL UNIQUEUnix timestamp of this snapshot
average_snrREALMean SNR across non-local nodes with valid readings
average_rssiREALMean RSSI
node_countINTEGERNumber of nodes included in the average

connection_log

Timestamped connection status events used for the uptime graph in the topbar and diagnostics.

ColumnTypeDescription
timestampREALUnix timestamp
statusTEXTStatus string e.g. Connected, Reconnecting, Disconnected
valueREALNumeric health value: 0.9 = connected, 0.5 = transitioning, 0.1 = disconnected

users

ColumnTypeDescription
idINTEGER PKAuto-increment
usernameTEXT UNIQUELogin email / username
hashed_passwordTEXTbcrypt hash — never stored in plain text
disabledBOOLEANAccount disabled flag

auto_reply_rules

See Auto-Reply API for full field descriptions.

monitor_rules

See Telemetry Monitor API for full field descriptions.

tasks.db

A separate database for scheduled tasks. Path set by TASK_DB_PATH in config. See Tasks API for the full schema.

Database Maintenance

MeshDash automatically prunes old data hourly. Records older than HISTORY_DAYS are deleted from: packets, messages, telemetry, positions, average_metrics_history, and connection_log. Deletion happens in batches of 5,000 rows to avoid holding long locks.

Every 24 hours, PRAGMA optimize is run to update query planner statistics. After pruning, PRAGMA wal_checkpoint(TRUNCATE) keeps the WAL file from growing unboundedly.

Direct queries via sqlite3 meshtastic_data.db are safe while the service is running — WAL mode allows concurrent readers. Always use read-only mode (sqlite3 -readonly) or stop the service before any writes to avoid conflicts.