A python package for managing a Meshtastic node database.
Project description
meshdb
A lightweight Python library for storing Meshtastic node, telemetry, and message data in per-node SQLite databases.
Installation
You can install meshdb directly from PyPI using pip:
pip install meshdb
Or install from source within a virtual environment:
git clone https://github.com/pdxlocations/meshdb.git
cd meshdb
pip install -e .
Or install via Poetry:
poetry install
Quick Usage Example
Set a default database path and handle incoming packets:
from meshdb import handle_packet, set_default_db_path
set_default_db_path("./data")
packet = {
"from": 12345678,
"rxTime": 1700000000,
"decoded": {
"portnum": "NODEINFO_APP",
"user": {"longName": "TestNode"}
}
}
handle_packet(packet, node_database_number=12345678)
Network Connection Options (Serial/TCP/Virtual Node)
meshdb now includes a connection helper that supports:
serial(default)tcpudpvirtual-node mode
import meshdb
conn = meshdb.connect(
transport="udp",
virtual_node=meshdb.VirtualNodeConfig(
node_id="!89abcdef",
long_name="MeshDB Virtual Node",
short_name="MDB",
channel="LongFast",
key="AQ==",
mcast_group="224.0.0.69",
mcast_port=4403,
),
)
print(conn.transport, conn.owner_node_num)
When receiving packets from udp, use meshdb.normalize_packet(packet, "udp")
before passing to meshdb.handle_packet(...).
CLI Listener
You can run:
meshdb
meshdb --db ./data --transport tcp --tcp-host 127.0.0.1:4403
meshdb --transport udp --node-id !89abcdef --channel LongFast
This connects to the mesh, listens for new packets, and persists them into the owner database until you stop it with Ctrl+C.
The CLI is configured with explicit arguments rather than environment variables. For udp transport, you can also pass:
--long-name--short-name--hw-model--key--mcast-group--mcast-port
Lookups in Code
import meshdb
meshdb.set_default_db_path("./data")
node = meshdb.get_node(12345678, owner_node_num=12345678)
battery = meshdb.get_node_metric("TestNode", "battery_level", owner_node_num=12345678)
Project Status
Early development. Schema and API changes may occur.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file meshdb-0.1.8.tar.gz.
File metadata
- Download URL: meshdb-0.1.8.tar.gz
- Upload date:
- Size: 32.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ae0034984939c087738324730f5b63de32684aa4484a9d886c5eb802aad15a8
|
|
| MD5 |
eaf86be20b7ee5f1cc89a97dd42192a4
|
|
| BLAKE2b-256 |
3e960290a48755443eb393fd5db828b67495525363ce8c292da67c86d886568b
|
Provenance
The following attestation bundles were made for meshdb-0.1.8.tar.gz:
Publisher:
release.yaml on pdxlocations/meshdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meshdb-0.1.8.tar.gz -
Subject digest:
3ae0034984939c087738324730f5b63de32684aa4484a9d886c5eb802aad15a8 - Sigstore transparency entry: 1059383683
- Sigstore integration time:
-
Permalink:
pdxlocations/meshdb@46cbf3829a9ce911d235532199a6cae81f4d5e9a -
Branch / Tag:
refs/tags/0.1.8 - Owner: https://github.com/pdxlocations
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@46cbf3829a9ce911d235532199a6cae81f4d5e9a -
Trigger Event:
push
-
Statement type:
File details
Details for the file meshdb-0.1.8-py3-none-any.whl.
File metadata
- Download URL: meshdb-0.1.8-py3-none-any.whl
- Upload date:
- Size: 33.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea14caa4a5feae714ed6401028d166e33e0642969edc24544efe986897f7ff2e
|
|
| MD5 |
967b61aa015af5ced4a3f398179103e4
|
|
| BLAKE2b-256 |
55613d6cd4d828e1295d61c83662d4dd88aa7337877396adf0b1330e1183e04f
|
Provenance
The following attestation bundles were made for meshdb-0.1.8-py3-none-any.whl:
Publisher:
release.yaml on pdxlocations/meshdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meshdb-0.1.8-py3-none-any.whl -
Subject digest:
ea14caa4a5feae714ed6401028d166e33e0642969edc24544efe986897f7ff2e - Sigstore transparency entry: 1059383706
- Sigstore integration time:
-
Permalink:
pdxlocations/meshdb@46cbf3829a9ce911d235532199a6cae81f4d5e9a -
Branch / Tag:
refs/tags/0.1.8 - Owner: https://github.com/pdxlocations
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@46cbf3829a9ce911d235532199a6cae81f4d5e9a -
Trigger Event:
push
-
Statement type: