Skip to main content

mtjk

mtjk is a separately published distribution of the Meshtastic Python library, maintained while changes are validated and selectively upstreamed.

Work began in September 2025 to stabilize connection interfaces and message delivery for mmrelay. The modernization work keeps existing Meshtastic Python usage compatible:

  • package import namespace remains meshtastic
  • CLI command remains meshtastic
  • existing API compatibility is intentionally preserved

It is intended to be a drop-in, backward-compatible replacement for upstream.

Project Status

This is a temporary fork of meshtastic/python. It exists to ship fixes and improvements while they are validated and upstreamed selectively.

This repository does not accept pull requests. Community development efforts should be directed to the upstream project. If you find a fix or improvement here that you would like to carry upstream, please do so.

Notable Changes

  • major BLE and interface internals were refactored for maintainability while keeping compatibility shims in place
  • concurrency and lifecycle paths were tightened to reduce race-condition and shutdown edge cases
  • CI and release workflows were modernized, including Trusted Publisher-based PyPI release flow

For technical details, see:

  • REFACTOR_PROGRAM.md: rationale and early change log for the major refactor work maintained here.
  • COMPATIBILITY.md: canonical inventory of compatibility shims, deprecations, and migration mapping.
  • CONTRIBUTING.md: local setup, CI-equivalent checks, and contributor workflow conventions.

Install the CLI (recommended: pipx)

pipx is recommended for CLI tools so each app gets an isolated environment.

1) Remove prior installs first (recommended)

If you previously installed upstream meshtastic, remove it before installing mtjk.

# If installed with pipx:
pipx uninstall meshtastic || true

# If installed with pip in a Python environment:
python3 -m pip uninstall -y meshtastic

2) Install mtjk

pipx install mtjk

3) Verify

meshtastic --version

Install latest from Git (develop)

To install the latest unreleased version from this repository (clean install):

# If you previously installed upstream via pipx, remove it first:
pipx uninstall meshtastic || true

pipx uninstall mtjk || true
pipx install "git+https://github.com/jeremiah-k/mtjk.git@develop"

Upgrade / Uninstall

pipx upgrade mtjk
pipx uninstall mtjk

Developer Usage (existing Meshtastic API)

Dependency name is mtjk, but import namespace remains meshtastic.

Important:

  • If your dependency spec says meshtastic, you will install upstream.
  • Use mtjk in dependency specs for this package.
  • The package does not provide import mtjk.

requirements.txt

mtjk

Unreleased from Git:

mtjk @ git+https://github.com/jeremiah-k/mtjk.git@develop

If you need optional CLI extras in a dependency spec:

mtjk[cli]
mtjk[cli] @ git+https://github.com/jeremiah-k/mtjk.git@develop

pyproject.toml (PEP 621)

[project]
dependencies = [
  "mtjk",
]

Unreleased from Git:

[project]
dependencies = [
  "mtjk @ git+https://github.com/jeremiah-k/mtjk.git@develop",
]

setup.cfg

[options]
install_requires =
    mtjk

Unreleased from Git:

[options]
install_requires =
    mtjk @ git+https://github.com/jeremiah-k/mtjk.git@develop

Python import (unchanged)

import meshtastic
import meshtastic.serial_interface

interface = meshtastic.serial_interface.SerialInterface()
interface.sendText("hello mesh")
interface.close()

Structured traceroute results

Library callers can request a traceroute without parsing CLI-oriented log output:

from meshtastic.serial_interface import SerialInterface

with SerialInterface() as interface:
    result = interface.requestTraceRoute("!ba4bf9d0", hopLimit=5)

for hop in result.route_towards:
    print(hop.node_id, hop.snr_db)

Each route contains the source and destination plus any intermediate hops. snr_db describes the link into a hop and is None when firmware omits a complete SNR sequence. route_back is None unless firmware reports a reverse route; incomplete reverse SNR data preserves the route with unknown link values. The historical sendTraceRoute() API and its logging behavior remain unchanged.

Support

Report mtjk-specific issues here:

Please do not file mtjk-specific issues with upstream maintainers.

Release Notes (Maintainers)

  • Versions match upstream releases with a .postN suffix (e.g., 2.7.8.post1 is the first mtjk release based on upstream 2.7.8).
  • Create a GitHub release with tag vX.Y.Z[.postN] (or push the tag manually). This triggers the PyPI publish workflow via Trusted Publisher.
  • Trusted Publisher workflow expects the git tag version to match pyproject.toml exactly.
  • Supported tag formats are vX.Y.Z... or X.Y.Z... (both map to the same package version check).
  • PyPI Trusted Publisher must match this repo/workflow/environment tuple: jeremiah-k/mtjk + .github/workflows/pypi-publish.yml + pypi-release.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mtjk-2.7.11.post3.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mtjk-2.7.11.post3-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file mtjk-2.7.11.post3.tar.gz.

File metadata

  • Download URL: mtjk-2.7.11.post3.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mtjk-2.7.11.post3.tar.gz
Algorithm Hash digest
SHA256 fc2b080a3b1c62104d16400f3594de98fd0a2afe58771aad11914c7ea7a52f39
MD5 4edcf1f310aafb092e8af3b083187446
BLAKE2b-256 f30fa9e435377cd3ab13be3b415e5be658494b367f4d1e0890a1b007f25a833c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtjk-2.7.11.post3.tar.gz:

Publisher: pypi-publish.yml on jeremiah-k/mtjk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtjk-2.7.11.post3-py3-none-any.whl.

File metadata

  • Download URL: mtjk-2.7.11.post3-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mtjk-2.7.11.post3-py3-none-any.whl
Algorithm Hash digest
SHA256 0140891dc5e71efc152b0a1668e63ba16ab1e63f2415e2b155830641451d53bd
MD5 3d5b91ebc89fa8e37aecc53e3588f762
BLAKE2b-256 a950af2d297b525eb49982755b280f79b1749745f4228b52869f9e77168ff40d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtjk-2.7.11.post3-py3-none-any.whl:

Publisher: pypi-publish.yml on jeremiah-k/mtjk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.7.11.post6

2 files

2.7.11.post5

2 files

2.7.11.post4

2 files

This release

2.7.11.post3 This release

2 files

2.7.11.post2

2 files

2.7.11.post1

2 files

2.7.10.post1

2 files

2.7.9.post2

2 files

2.7.9.post1

2 files

2.7.8.post3

2 files

2.7.8.post2

2 files

2.7.8.post1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page