AMMB is a flexible and robust software bridge designed by Akita Engineering to facilitate seamless, bidirectional communication between Meshtastic LoRa mesh networks and external systems via Serial or MQTT.
This bridge enables interoperability, allowing messages, sensor data (with appropriate translation), and potentially other information to flow between Meshtastic and devices connected via Serial (like MeshCore) or platforms integrated with MQTT.
config.ini. Includes raw_serial and companion_radio handlers for MeshCore Companion Mode (Binary + framed USB protocol). git clone https://github.com/AkitaEngineering/akita-meshtastic-meshcore-bridge.git
cd akita-meshtastic-meshcore-bridge
python -m venv venv
source venv/bin/activate # or .\venv\Scripts\activate on Windows
pip install -r requirements.txt
Copy examples/config.ini.example to config.ini and edit it.
EXTERNAL_TRANSPORT = serial and SERIAL_PROTOCOL = companion_radio.Optional companion settings in config.ini:
- COMPANION_HANDSHAKE_ENABLED = True (send initial device query/app start)
- COMPANION_CONTACTS_POLL_S = 0 (poll contacts/adverts; 0 disables)
- COMPANION_DEBUG = False (enable raw byte logging)
- SERIAL_AUTO_SWITCH = True (auto-switch between json_newline and raw_serial on repeated decode failures)
- MESHTASTIC_CHANNEL_INDEX = 1 and MESHCORE_CHANNEL_INDEX = 2 e.g. only bridge messages from Meshtastic channel index 1 to/from MeshCore channel index 2
- Companion device info, self info, contact sync, and adverts are decoded into structured events and surfaced in the sync logs and the terminal command center log tail
For MQTT:
Set EXTERNAL_TRANSPORT = mqtt and configure broker details. Optionally enable TLS/SSL for secure connections.
For REST API (Optional):
Set API_ENABLED = True and configure API_HOST and API_PORT to enable the monitoring API.
Preflight check (recommended before field use): python run_bridge_tui.py --check
Show effective config without secrets: python run_bridge_tui.py --print-config
Synchronous (legacy): python run_bridge.py
Full-screen terminal command center: python run_bridge_tui.py
Async (recommended, for meshcore_py and async MQTT): python run_bridge_async.py
The command center uses the same config.ini as the synchronous bridge and adds:
- preflight diagnostics with actionable dependency, config, serial, MQTT, and API warnings
- config selection via --config /path/to/config.ini or the AMMB_CONFIG environment variable
- redacted config inspection with --print-config
- live bridge state, queue depth, and connection visibility
- a full-screen health and metrics dashboard
- recent events and a scrolling log tail
- keyboard shortcuts: S start/stop, R restart, M reset metrics, P pause logs, C clear logs, Q quit
- crash reports written to ammb_tui_crash.log if the dashboard hits an unhandled startup/runtime exception
The async entry point supports:
- Async Meshcore integration (meshcore_py) with CONTACT_MSG_RECV and CHANNEL_MSG_RECV subscriptions
- Async MQTT (asyncio-mqtt)
- Async REST API (FastAPI, if enabled)
If API_ENABLED = True in your config, the async bridge will launch a FastAPI server for health, metrics, and control endpoints (see below).
Endpoints are available on the configured API host/port (default: http://127.0.0.1:8080):
GET /api/health — Health status of all componentsGET /api/metrics — Detailed metrics and statisticsGET /api/status — Combined health and metricsGET /api/info — Bridge informationPOST /api/control — Control actions (e.g., reset metrics)Example: curl http://localhost:8080/api/health curl http://localhost:8080/api/metrics
This project is maintained by Akita Engineering.
This project is licensed under the GNU General Public License v3.0.
(See the LICENSE file for the full license text.)
$ claude mcp add Akita-Meshtastic-Meshcore-Bridge \
-- python -m otcore.mcp_server <graph>