mtjk
mtjk is a maintained fork of the Meshtastic Python library. It keeps the
existing meshtastic Python import namespace while publishing under a separate
package name so the work maintained here can be installed independently.
The fork began as an exploration of BLE connection reliability for MMRelay. What initially looked like a transport-specific problem turned out to touch lifecycle ownership, concurrency, typing, dependency management, testability, and several large implementation boundaries. The work expanded incrementally and was repeatedly cleaned up and tested rather than carried as one very large upstream patch. Over time that working branch became the maintained fork that exists today.
The upstream project remains the primary Meshtastic Python project. The goal of this fork is narrower: maintain the changes developed here, keep them coherent and well-tested, preserve familiar Meshtastic Python usage where practical, and make isolated improvements available for upstreaming when they can be separated cleanly.
Project goals
The main priorities are:
- preserve the established Meshtastic Python API and import namespace where practical;
- improve connection and lifecycle reliability, especially for long-running integrations;
- keep concurrency, resource ownership, and failure handling explicit;
- maintain strong typing, linting, tests, and dependency hygiene;
- track current firmware behavior, including Meshtastic 2.8 protocol and CLI features;
- keep internal architecture maintainable without forcing downstream callers to follow those internal changes.
The repository does not currently accept external pull requests. General Meshtastic
community development should continue to go to
meshtastic/python. Issues that are
specific to mtjk can be reported in this repository.
Compatibility
mtjk is designed to be usable as a replacement dependency for applications
that already use Meshtastic Python, but it does not claim perfect behavioral
identity with every upstream release.
Compatibility that is intentionally maintained includes:
import meshtasticremains the Python package namespace;mtjkis the preferred CLI command, while the historicalmeshtasticcommand remains installed as a silent compatibility entry point;- established
Node,MeshInterface, BLE, utility, and configuration entry points are guarded by API and behavioral compatibility tests; - historical camelCase and documented legacy aliases remain callable where the compatibility policy says they do;
- newer structured BLE exceptions remain catchable as
BLEInterface.BLEError, including the historical.kindclassification contract.
There are also deliberate behavioral differences where retaining the old
behavior would make the library harder or less safe to embed. The most important
example is error handling: library code generally raises exceptions instead of
terminating the host process with sys.exit(). Safer defaults and internal
logging behavior may also differ from older upstream releases.
See COMPATIBILITY.md for the maintained compatibility contract and known behavioral differences.
Notable work maintained here
The exact change set evolves with the upstream project, but the larger areas of work include:
- BLE connection, reconnect, shutdown, ownership, and notification lifecycle hardening;
- request/response correlation and concurrency fixes for long-running clients;
- decomposition of large
MeshInterface,Node, CLI, and BLE implementation paths behind compatibility facades; - stronger typing, linting, static analysis, API baselines, and regression coverage;
- dependency and CI cleanup;
- current firmware protocol support and validation, including Meshtastic 2.8 features;
- simplified Trusted Publisher-based PyPI releases.
For current design details, see ARCHITECTURE.md. BLE-specific implementation and integration notes live in BLE.md.
Installation
CLI installation with pipx
pipx is recommended for command-line use so the package runs in an isolated
environment.
If upstream meshtastic is already installed in that environment, remove it
first. The two distributions intentionally share the meshtastic Python
namespace and historical CLI command, so they are not designed to coexist in one
environment.
pipx uninstall meshtastic || true
pipx install mtjk
Verify the installation:
mtjk --version
The package installs both mtjk and meshtastic console commands. New shell
usage should prefer mtjk; existing automation that invokes meshtastic
continues to use the same implementation.
Install the latest develop
pipx uninstall mtjk || true
pipx install "git+https://github.com/jeremiah-k/mtjk.git@develop"
Upgrade or uninstall
pipx upgrade mtjk
pipx uninstall mtjk
Using mtjk as a Python dependency
The distribution name is mtjk, but the import namespace remains
meshtastic.
Use mtjk in dependency declarations:
mtjk
or, for the unreleased develop branch:
mtjk @ git+https://github.com/jeremiah-k/mtjk.git@develop
The optional CLI extras can be requested in the usual way:
mtjk[cli]
Python code continues to use the familiar imports:
import meshtastic
import meshtastic.serial_interface
with meshtastic.serial_interface.SerialInterface() as interface:
interface.sendText("hello mesh")
There is intentionally no import mtjk package.
Documentation
The maintained project documentation is intentionally small:
- ARCHITECTURE.md — current architecture and design boundaries;
- COMPATIBILITY.md — compatibility policy, aliases, and intentional behavioral differences;
- CONTRIBUTING.md — local maintenance workflow and CI checks;
- BLE.md — detailed BLE architecture and integration guidance;
meshtastic/ADMIN_RESPONSE_CONTRACTS.md— admin request/response invariants;meshtastic/LOCKDOWN.md— lockdown/authentication behavior;meshtastic/REGION_PRESETS.md— region-preset API behavior.
Older refactor plans, dependency campaign notes, and device-specific manual test logs are intentionally not maintained as active documentation; Git history is the source for that development history.
Support
Report mtjk-specific issues here:
Please do not file mtjk-specific issues with upstream maintainers.
Release notes for maintainers
- Versions follow the upstream version with a
.postNsuffix, for example2.7.11.post6. - Publish a GitHub release with tag
vX.Y.Z[.postN](or the same version without the leadingv). - The PyPI workflow verifies that the release tag matches
pyproject.toml, runs the standardpython -m build, and publishes the generated source and wheel distributions with PyPI Trusted Publishing. - The PyPI Trusted Publisher is configured for
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
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 mtjk-2.7.11.post6.tar.gz.
File metadata
- Download URL: mtjk-2.7.11.post6.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f65c34b14100c1472ad67e9a860288079f5babad844ff8789345d923866dd42b
|
|
| MD5 |
6b9201d1ffc6a64a7637d865963743f5
|
|
| BLAKE2b-256 |
3560b32a66504dd5785184f6cfbf3b5357489a52feb1190fc7bfa0df36716144
|
Provenance
The following attestation bundles were made for mtjk-2.7.11.post6.tar.gz:
Publisher:
pypi-publish.yml on jeremiah-k/mtjk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mtjk-2.7.11.post6.tar.gz -
Subject digest:
f65c34b14100c1472ad67e9a860288079f5babad844ff8789345d923866dd42b - Sigstore transparency entry: 2726571096
- Sigstore integration time:
-
Permalink:
jeremiah-k/mtjk@17e3edcc2d2f2fe8f65feec2c378e54fc2437e57 -
Branch / Tag:
refs/tags/2.7.11.post6 - Owner: https://github.com/jeremiah-k
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@17e3edcc2d2f2fe8f65feec2c378e54fc2437e57 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mtjk-2.7.11.post6-py3-none-any.whl.
File metadata
- Download URL: mtjk-2.7.11.post6-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1abda7198594f3d228b4afd18e6a1a392b40c39fb70697cac16b2a7e6ba33dda
|
|
| MD5 |
ca26ca2e2c3abe19553e3f3bc5a8b047
|
|
| BLAKE2b-256 |
cdb8bd253a45fe54496e5a0697ec58245f33b8f8cbbe888dc51edcd1b972c9b3
|
Provenance
The following attestation bundles were made for mtjk-2.7.11.post6-py3-none-any.whl:
Publisher:
pypi-publish.yml on jeremiah-k/mtjk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mtjk-2.7.11.post6-py3-none-any.whl -
Subject digest:
1abda7198594f3d228b4afd18e6a1a392b40c39fb70697cac16b2a7e6ba33dda - Sigstore transparency entry: 2726571138
- Sigstore integration time:
-
Permalink:
jeremiah-k/mtjk@17e3edcc2d2f2fe8f65feec2c378e54fc2437e57 -
Branch / Tag:
refs/tags/2.7.11.post6 - Owner: https://github.com/jeremiah-k
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@17e3edcc2d2f2fe8f65feec2c378e54fc2437e57 -
Trigger Event:
release
-
Statement type: