Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

72.7. python3-meshtastic-2.7.11

Meshtastic LoRa mesh client — text and position messages

Version 2.7.11, release 2
Shelf python-net — python3-* HTTP, web-framework, TLS-trust and network-stack modules
Phase 40_lang (Languages), 142 of 186 in build order
Licence GPL-3.0-only AND BSD-2-Clause AND MIT
Homepage https://meshtastic.org/
Build time 0.2 SBU
Installed size 5.5 MiB in 438 files
Recipe ports/core/python-net/python3-meshtastic/kpkgbuild

About

The Python client for Meshtastic, the LoRa mesh network: the meshtastic command and library, which talk to a Meshtastic radio over USB serial, TCP or Bluetooth LE to send and receive text and position messages and to configure the node. A LoRa mesh needs no licence and no infrastructure. The radio’s serial adapter is reached through the dialout group; see The device groups and the udev rules. contact depends on it.

Why it is in KDOS

The comment above it in script/phases/40_lang/packages.d/python-net.txt:

LoRa mesh text and position: no licence, no infrastructure, no subscription.

Sources

Dependencies

Depends on: python3, python3-setuptools, python3-pip, python3-pyserial, python3-packaging, python3-certifi, python3-yaml, python3-requests, python3-charset-normalizer, python3-idna, python3-urllib3, python3-poetry-core, python3-setuptools-scm, python3-protobuf.

Required by (1): contact.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/40_lang/phase.env && kpkg install python3-meshtastic'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/python-net/python3-meshtastic.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/python-net/python3-meshtastic
echo '41a8c84b577daff173d36db9fdbc8bf2c7228b58e580474e9f53802ed8ea7d4a  python3-meshtastic-2.7.11.tar.gz' | sha256sum -c -
echo '64a866407ffad113876c638c176d3af6f3f35a6fe826f1ad360fdbd9858369bf  python3-meshtastic-vendor-2.7.11.tar.xz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/python3-meshtastic
SRC=$SRC_ROOT/python3-meshtastic-2.7.11
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf python3-meshtastic-2.7.11.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers pyrequirements, pyruntime and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

mkdir -p vendor
tar -xf $PORT_SRC/$name-vendor-$version.tar.xz --strip-components=1 -C vendor

SKIP_CYTHON=1 pip3 install --ignore-installed --no-deps --no-index --find-links=vendor --no-build-isolation \
	--root=$PKG --prefix=/usr \
	pypubsub bleak dbus-fast tabulate .
rm -rf "$PKG"/usr/lib/python3.*/site-packages/contrib
rm -f "$PKG/usr/bin/mesh-analysis"

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/python3-meshtastic, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf python3-meshtastic-2.7.11-2.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/python3-meshtastic, and runs the triggers its paths call for.

Contents

Installed programs: mesh-tunnel, meshtastic, tabulate.

Installed directories: /usr/lib/python3.14/site-packages/bleak, /usr/lib/python3.14/site-packages/bleak-3.0.1.dist-info, /usr/lib/python3.14/site-packages/dbus_fast, /usr/lib/python3.14/site-packages/dbus_fast-5.0.22.dist-info, /usr/lib/python3.14/site-packages/meshtastic, /usr/lib/python3.14/site-packages/meshtastic-2.7.11.dist-info, /usr/lib/python3.14/site-packages/pubsub, /usr/lib/python3.14/site-packages/pypubsub-4.0.7.dist-info, /usr/lib/python3.14/site-packages/tabulate, /usr/lib/python3.14/site-packages/tabulate-0.10.0.dist-info, /usr/share/licenses/python3-meshtastic.

Notes

The bundle’s pypackages are the runtime dependencies that are not ports: pypubsub, bleak, dbus-fast and tabulate, installed by name with --no-deps, and protobuf, which is named in pypackages but installed from the python3-protobuf port; requests, urllib3, idna, charset-normalizer, certifi, PyYAML, pyserial and packaging are ports in depends as well. A second copy of a module that a port also installs would be a path two packages own; see The three Python keys.

bleak, the Bluetooth LE library, is installed even for a radio on a serial port, because meshtastic/__main__.py imports BLEInterface at the top, and without bleak the command fails on that import before it reads its arguments. pypackages pins bleak to a release whose sdist builds with poetry-core, a port. bleak’s Linux backend is dbus-fast.

Build isolation is off and every backend is a port (setuptools, setuptools-scm, poetry-core). pypubsub declares setuptools>=68,<77, which the setuptools port does not satisfy; without isolation pip does not check the declaration.

After the install, build.sh removes two things. site-packages/contrib is a top-level package of pypubsub’s, its examples netpubsub.py and wx_monitor.py, under a generic name. /usr/bin/mesh-analysis is the entry point of meshtastic’s analysis extra, three of whose four dependencies (dash, dash-bootstrap-components, pandas-stubs) have no port; the fourth is pandas.