Skip to content

tmacinc/MeshCore

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2,591 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

About MeshCore

MeshCore is a lightweight, portable C++ library that enables multi-hop packet routing for embedded projects using LoRa and other packet radios. It is designed for developers who want to create resilient, decentralized communication networks that work without the internet.

πŸ” What is MeshCore?

MeshCore now supports a range of LoRa devices, allowing for easy flashing without the need to compile firmware manually. Users can flash a pre-built binary using tools like Adafruit ESPTool and interact with the network through a serial console. MeshCore provides the ability to create wireless mesh networks, similar to Meshtastic and Reticulum but with a focus on lightweight multi-hop packet routing for embedded projects. Unlike Meshtastic, which is tailored for casual LoRa communication, or Reticulum, which offers advanced networking, MeshCore balances simplicity with scalability, making it ideal for custom embedded solutions., where devices (nodes) can communicate over long distances by relaying messages through intermediate nodes. This is especially useful in off-grid, emergency, or tactical situations where traditional communication infrastructure is unavailable.

⚑ Key Features

  • Multi-Hop Packet Routing
    • Devices can forward messages across multiple nodes, extending range beyond a single radio's reach.
    • Supports up to a configurable number of hops to balance network efficiency and prevent excessive traffic.
    • Nodes use fixed roles where "Companion" nodes are not repeating messages at all to prevent adverse routing paths from being used.
  • Supports LoRa Radios – Works with Heltec, RAK Wireless, and other LoRa-based hardware.
  • Decentralized & Resilient – No central server or internet required; the network is self-healing.
  • Low Power Consumption – Ideal for battery-powered or solar-powered devices.
  • Simple to Deploy – Pre-built example applications make it easy to get started.

🏷️ Team Edition

This branch (main) is the MeshCore Team Edition β€” a custom firmware build layered on top of stock MeshCore. It adds team-oriented features for GPS tracking, smart forwarding control, and unattended autonomous operation. The firmware version is suffixed with a Team build number (e.g. v1.13.0.1).

✨ Team Edition Features

πŸ“‘ Adaptive Forwarding Control

The companion radio firmware can now have its forwarding behaviour controlled dynamically by the connected app via new serial commands.

Command Code Description
CMD_SET_MAX_HOPS 73 Set the maximum flood hop count (flood_max). 0 disables forwarding.
CMD_SET_FORWARD_LIST 74 Push a whitelist of up to 20 contact public-key prefixes (6 bytes each). Only messages from these contacts are forwarded.

Forwarding policy rules:

  • Public channel messages are always blocked from being forwarded, preventing channel spam.
  • When a whitelist is active, only group messages from contacts in the list are forwarded.
  • The whitelist expires after 10 minutes of no policy update, reverting to flood_max-only behaviour.
  • If no policy update is received for 60 minutes, forwarding is hard-disabled until the app reconnects and refreshes the policy.
  • The flood_max value is persisted to flash, so forwarding behaviour is restored after reboots.

Firmware capability flags are reported in RESP_CODE_SELF_INFO so the app can detect support:

  • CAPABILITY_FORWARDING (0x01) β€” Adaptive forwarding control supported.
  • CAPABILITY_AUTONOMOUS (0x02) β€” Autonomous tracker mode supported.

πŸ›°οΈ Autonomous Tracker Mode

Autonomous mode allows a GPS-equipped companion radio to operate as a standalone GPS beacon without a phone or app connected. When enabled, the device periodically broadcasts #TEL: telemetry messages on a configured channel so other nodes can track it on the map.

Command Code Description
CMD_GET_AUTONOMOUS_SETTINGS 75 Read the currently persisted autonomous tracker settings.
CMD_SET_AUTONOMOUS_SETTINGS 76 Write autonomous tracker settings. Requires a GPS unit to be present.

Settings:

Field Type Description
autonomous_enabled uint8_t 0 = disabled, 1 = enabled.
autonomous_channel_hash uint8_t First byte of the target channel's hash. Telemetry is sent on this channel.
autonomous_interval_sec uint16_t Minimum send interval in seconds (range: 10–3600, default: 30).
autonomous_min_distance_m uint16_t Minimum movement in metres before triggering an early send (0 = interval-only, max: 5000).

Behaviour:

  • The device only sends a telemetry update when a valid GPS fix is available.
  • Updates are triggered by time interval and/or minimum distance moved since the last send (Haversine formula).
  • When autonomous mode is active, incoming chat and channel messages are silently dropped β€” the node acts as a tracker only, not a chat device.
  • The splash screen and home screen both display "Team Edition" and an "AUTONOMOUS" status indicator when the mode is active.
  • Message preview screens are suppressed in autonomous mode.

Telemetry payload (#TEL: format):
An 11-byte binary struct (latitude, longitude, battery voltage, phone battery, forward status) is Base64-encoded and sent as the text of a group message: #TEL:<base64>.


πŸ”’ GPS Fix Validation

A hasValidGpsFix() helper ensures that GPS data is only acted on when a live, valid fix is available. This prevents stale or invalid coordinates from being transmitted.


πŸ”„ Device Name Change Triggers Hard Reset

When the device's advertised name is changed via CMD_SET_ADVERT_NAME, a hardware reset (board.hardReset()) is performed automatically so the new BLE advertising name takes effect immediately.


πŸ’Ύ Backward-Compatible Preferences Storage

New Team Edition preferences (flood_max, autonomous_enabled, autonomous_channel_hash, autonomous_interval_sec, autonomous_min_distance_m) are appended to the existing preferences file using optional reads, maintaining full backward compatibility with devices running older firmware.

🎯 What Can You Use MeshCore For?

  • Off-Grid Communication: Stay connected even in remote areas.
  • Emergency Response & Disaster Recovery: Set up instant networks where infrastructure is down.
  • Outdoor Activities: Hiking, camping, and adventure racing communication.
  • Tactical & Security Applications: Military, law enforcement, and private security use cases.
  • IoT & Sensor Networks: Collect data from remote sensors and relay it back to a central location.

πŸš€ How to Get Started

For developers;

The Simple Secure Chat example can be interacted with through the Serial Monitor in Visual Studio Code, or with a Serial USB Terminal on Android.

⚑️ MeshCore Flasher

We have prebuilt firmware ready to flash on supported devices.

  • Launch https://flasher.meshcore.co.uk
  • Select a supported device
  • Flash one of the firmware types:
    • Companion, Repeater or Room Server
  • Once flashing is complete, you can connect with one of the MeshCore clients below.

πŸ“± MeshCore Clients

Companion Firmware

The companion firmware can be connected to via BLE, USB or WiFi depending on the firmware type you flashed.

Repeater and Room Server Firmware

The repeater and room server firmwares can be setup via USB in the web config tool.

They can also be managed via LoRa in the mobile app by using the Remote Management feature.

πŸ›  Hardware Compatibility

MeshCore is designed for devices listed in the MeshCore Flasher

πŸ“œ License

MeshCore is open-source software released under the MIT License. You are free to use, modify, and distribute it for personal and commercial projects.

Contributing

Please submit PR's using 'dev' as the base branch! For minor changes just submit your PR and we'll try to review it, but for anything more 'impactful' please open an Issue first and start a discussion. Is better to sound out what it is you want to achieve first, and try to come to a consensus on what the best approach is, especially when it impacts the structure or architecture of this codebase.

Here are some general principals you should try to adhere to:

  • Keep it simple. Please, don't think like a high-level lang programmer. Think embedded, and keep code concise, without any unnecessary layers.
  • No dynamic memory allocation, except during setup/begin functions.
  • Use the same brace and indenting style that's in the core source modules. (A .clang-format is prob going to be added soon, but please do NOT retroactively re-format existing code. This just creates unnecessary diffs that make finding problems harder)

Help us prioritize! Please react with thumbs-up to issues/PRs you care about most. We look at reaction counts when planning work.

Road-Map / To-Do

There are a number of fairly major features in the pipeline, with no particular time-frames attached yet. In very rough chronological order:

  • Companion radio: UI redesign
  • Repeater + Room Server: add ACL's (like Sensor Node has)
  • Standardise Bridge mode for repeaters
  • Repeater/Bridge: Standardise the Transport Codes for zoning/filtering
  • Core + Repeater: enhanced zero-hop neighbour discovery
  • Core: round-trip manual path support
  • Companion + Apps: support for multiple sub-meshes (and 'off-grid' client repeat mode)
  • Core + Apps: support for LZW message compression
  • Core: dynamic CR (Coding Rate) for weak vs strong hops
  • Core: new framework for hosting multiple virtual nodes on one physical device
  • V2 protocol spec: discussion and consensus around V2 packet protocol, including path hashes, new encryption specs, etc

πŸ“ž Get Support

  • Report bugs and request features on the GitHub Issues page.
  • Find additional guides and components on my site.
  • Join MeshCore Discord to chat with the developers and get help from the community.

About

A new lightweight, hybrid routing mesh protocol for packet radios

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C 62.9%
  • C++ 35.8%
  • Other 1.3%