The official firmware for Meshtastic, an open-source, off-grid mesh communication system. https://meshtastic.org
  • C++ 73.5%
  • C 21.8%
  • Python 2.6%
  • Shell 1.5%
  • Batchfile 0.2%
  • Other 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Thomas Göttgens 95ff510f47
feat(beacon): per-target and offered frequency slots (#12126)
* feat(beacon): per-target and offered frequency slots

Implements the slot fields from meshtastic/protobufs#1059 on top of the
broadcast_targets scheme from #11646:

- BroadcastTarget.frequency_slot pins a target's slot. Unset derives it the
  way a node on that channel would: the target region's override slot, else
  the hash of the target channel's name on the target preset. A target on
  the home radio keeps the home slot. A pin the target region does not hold
  skips the target. The deprecated ChannelSettings.channel_num is no longer
  read, and the home node's channel_num no longer leaks into other presets.
- broadcast_offer_frequency_slot is advertised as MeshBeacon.offer_frequency_slot
  only when a receiver could not derive it. An offer pinned to a slot its
  region lacks is withheld; the text still goes out.
- The listener keeps a received offer's slot.
- Admin clears slot 0, and a slot past an explicit region and preset.
- userPrefs: USERPREFS_MESH_BEACON_OFFER_FREQUENCY_SLOT and
  USERPREFS_MESH_BEACON_TARGET_<N>_FREQUENCY_SLOT.

Also from #11662:

- A beacon is addressed at its target's channel index, so perhapsEncode()
  keys it like any other packet; the primary channel is never overwritten.
  The TX hook writes the target preset's channel hash for a blank-named
  channel on another preset.
- A beacon whose send() did not queue releases its target entry on every
  failure, not only ERRNO_SHOULD_RELEASE.
- A beacon still queued a broadcast interval after it was armed, or whose
  entry was evicted from a full table, is dropped at TX instead of going
  out on the home radio.

Supersedes #11662.

Co-authored-by: Tom <116762865+NomDeTom@users.noreply.github.com>

* fix(beacon): address review of frequency slots

- TX gate checks the target preset against its region or EU sibling, not the home slot
- Targets and offers run an EU sibling's preset in that sibling, as the switch does
- Switch clears override_frequency and restores tx_power; restore keeps fields edited mid-switch
- An unusable channel_index skips the target instead of falling back to the primary
- Beacon config validation moved to MeshBeaconModule::sanitizeConfig(), also run on load;
  message cap no longer ends mid-character
- Evicted-id ring sized to the TX queue

* fix(radio): frequencySlotCount() reports no slots for UNSET

UNSET's table span is a placeholder; an unknown region code resolves to it too.

* fix(beacon): slot count and restore for custom bandwidth

- frequencySlotCount() counts a custom bandwidth wider than the region at the region default, as the clamp runs it
- resolveFrequencySlot() falls back to the hash when the region override slot exceeds the count
- The beacon switch restores a custom bandwidth applyModemConfig() clamped for the target region

* fix(beacon): run a target's named preset on a node with custom modem params

The switch sets use_preset for a target that names a preset and restores it after TX. A target naming no preset keeps the custom params.

* fix(beacon): keep an out-of-range target channel_index

sanitizeConfig() cleared has_channel_index for an index past the channel
table. That turns the entry into an unset-index target, and sendBeacon()
sends those on the primary channel - under a name and key the operator
never named. sanitizeConfig() now also runs from loadFromDisk(), so a
stored or userPrefs index did that at every boot, not only on the write
that set it.

Keep the index and only warn. sendBeacon() already bounds-checks it
against channels.getNumChannels(), which is tighter than
MAX_NUM_CHANNELS, before getByIndex(), and skips the target - so nothing
can index out of bounds, which is what the clear was there for.

test_adminValidation_targetChannelIndexOutOfRange_isCleared becomes
_isKeptAndSkipped: the index survives the write, and the stored config
emits no beacon rather than one on the primary.

Reported by NomDeTom on #12126.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SwNPp17REf1c9je42aWyJa

---------

Co-authored-by: Tom <116762865+NomDeTom@users.noreply.github.com>
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-10-24 18:41:20 +00:00
.claude Extract mcp-server to its own repo (meshtastic/meshtastic-mcp) (#10861) 2026-07-02 14:33:04 -05:00
.clusterfuzzlite lint: fix stale trivy rule codes in clusterfuzzlite Dockerfile (#11165) 2026-07-24 07:45:06 +00:00
.devcontainer Add native Portduino mDNS discovery with Avahi and Bonjour (#12032) 2026-10-12 18:56:28 +00:00
.github Actions: pin python to 3.14 where platformio is used (#12210) 2026-10-20 18:46:24 +00:00
.trunk Upgrade trunk (#12080) 2026-10-22 11:17:05 +00:00
.vscode VSCode: Prepare for pioarduino transition (#10471) 2026-05-13 09:25:11 -05:00
bin Fail the native simulator job on a sanitizer fault, and fix the one it found (#12205) 2026-10-20 14:07:34 +00:00
boards Add the Nodara nRF52840 board (#12211) 2026-10-21 16:10:13 +00:00
branding spelling fixes in .md files (#9810) 2026-03-05 08:54:57 +11:00
data/static Bundle WebUI (#878) 2021-10-09 17:15:12 +11:00
debian Add native Portduino mDNS discovery with Avahi and Bonjour (#12032) 2026-10-12 18:56:28 +00:00
extra_scripts fix drop_stale_sdkconfig_defaults() (#11861) 2026-09-16 16:15:22 +00:00
images No idea why trunk wants to disturb these PNGs but... 2024-10-08 05:34:41 -05:00
meshtestic@dcac7e5673 python3 ref 2024-09-24 15:24:08 -05:00
monitor lint: drop redundant bandit ignores in c3 exception decoder (#11173) 2026-07-26 05:32:05 +00:00
packaging/windows Package meshtasticd for Windows as an MSI (#11289) 2026-07-31 04:53:52 +00:00
protobufs@8d0ed0c135 Update protobufs (#12214) 2026-10-21 04:57:09 +00:00
release Cleans up visibility in GPS.h (#5426) 2024-11-23 06:10:09 -06:00
scripts lint: hoist stdlib imports above Import(env) in add_mbedtls_sources (#11172) 2026-07-26 05:32:54 +00:00
src feat(beacon): per-target and offered frequency slots (#12126) 2026-10-24 18:41:20 +00:00
test feat(beacon): per-target and offered frequency slots (#12126) 2026-10-24 18:41:20 +00:00
tools emdashes begone (#10847) 2026-07-01 19:01:27 -05:00
variants Add the Nodara nRF52840 board (#12211) 2026-10-21 16:10:13 +00:00
.coderabbit.yaml docs(agents): exempt test headers from the two-line comment limit (#11742) 2026-09-09 01:56:22 +00:00
.dockerignore Initial commit of a fuzzer for Meshtastic (#5790) 2025-01-16 18:42:21 -06:00
.env.example meshtasticd-docker: simplify, add USB compose (#5662) 2024-12-26 12:59:26 -06:00
.envrc Add initial Nix shell (#8530) 2026-01-29 10:06:58 -06:00
.gitattributes update gitattributes for windows (#6289) 2025-03-11 13:05:51 -05:00
.gitignore Add MEDIUM_TURBO modem preset (#10988) 2026-07-11 08:24:35 -05:00
.gitmodules Consume device-ui as a pio library (#6193) 2025-03-05 16:19:59 -06:00
.mcp.json Extract mcp-server to its own repo (meshtastic/meshtastic-mcp) (#10861) 2026-07-02 14:33:04 -05:00
.semgrepignore Actions: exclude mutable action tag rule from Semgrep scans (#11944) 2026-09-21 19:09:28 +00:00
AGENTS.md feat(portduino): admin keys in config.yaml, beyond the protobuf's three (#12056) 2026-10-03 03:19:01 +00:00
alpine.Dockerfile Add native Portduino mDNS discovery with Avahi and Bonjour (#12032) 2026-10-12 18:56:28 +00:00
CLAUDE.md test(harness): make run-tests.sh drivable by a caller that cannot see the terminal (#11862) 2026-09-22 11:10:53 +00:00
CODE_OF_CONDUCT.md Trunk 2024-11-28 06:26:51 -06:00
CONTRIBUTING.md lol of course trunk fmt 2024-09-04 15:33:28 -07:00
default_8MB.csv ESP32: Migrate to Arduino 3.x (pioarduino) (#9122) 2026-05-17 18:53:32 -05:00
default_16MB.csv ESP32: Migrate to Arduino 3.x (pioarduino) (#9122) 2026-05-17 18:53:32 -05:00
docker-compose.yml Add native Portduino mDNS discovery with Avahi and Bonjour (#12032) 2026-10-12 18:56:28 +00:00
Dockerfile Add native Portduino mDNS discovery with Avahi and Bonjour (#12032) 2026-10-12 18:56:28 +00:00
Dockerfile.test Add native Portduino mDNS discovery with Avahi and Bonjour (#12032) 2026-10-12 18:56:28 +00:00
flake.lock Add initial Nix shell (#8530) 2026-01-29 10:06:58 -06:00
flake.nix Add initial Nix shell (#8530) 2026-01-29 10:06:58 -06:00
LICENSE move my bt experiment into its own repo (about to remove ttn) 2020-02-01 08:30:53 -08:00
meshtasticd.spec.rpkg Add native Portduino mDNS discovery with Avahi and Bonjour (#12032) 2026-10-12 18:56:28 +00:00
partition-table-8MB.csv reorganize 8MB partition for MUI devices (#7860) 2025-09-08 05:56:47 -05:00
partition-table-t3s3.csv Give the 4MB T3-S3 boards an app partition that fits (#10978) 2026-07-10 10:18:09 -05:00
partition-table.csv - new Bootloader for ESP-IDF 4.2 2022-09-26 22:42:58 +02:00
platformio.ini Update meshtastic/device-ui digest to 57c7bc6 (#11982) 2026-10-02 10:45:16 +00:00
pyocd.yaml Add semihosting support for nrf52 devices (#4137) 2024-06-24 10:27:37 -05:00
README.md README: Add Membrowse badge (#12057) 2026-10-03 22:43:30 +00:00
renovate.json Renovate: Change base branch from 'master' to 'develop' (#10821) 2026-06-30 10:19:27 -05:00
rpkg.conf rpkg Fedora packaging (#5735) 2025-01-13 12:24:05 +08:00
SECURITY.md Update supported versions in SECURITY.md 2026-09-02 09:02:30 +02:00
shell.nix Add initial Nix shell (#8530) 2026-01-29 10:06:58 -06:00
suppressions.txt fix(ci): unbreak the ESP32 static analysis gate after the cppcheck 2.20 jump (#11777) 2026-09-08 23:52:54 +00:00
userPrefs.jsonc feat(beacon): per-target and offered frequency slots (#12126) 2026-10-24 18:41:20 +00:00
version.properties Automated version bumps (#12033) 2026-10-01 23:43:14 +00:00

Meshtastic Logo

Meshtastic Firmware

GitHub release downloads CI CLA assistant Fiscal Contributors Vercel MemBrowse

meshtastic%2Ffirmware | Trendshift

Overview

This repository contains the official device firmware for Meshtastic, an open-source LoRa mesh networking project designed for long-range, low-power communication without relying on internet or cellular infrastructure. The firmware supports various hardware platforms, including ESP32, nRF52, RP2040/RP2350, and Linux-based devices.

Meshtastic enables text messaging, location sharing, and telemetry over a decentralized mesh network, making it ideal for outdoor adventures, emergency preparedness, and remote operations.

Get Started

Join our community and help improve Meshtastic! 🚀

Stats

Alt