MeshCore companion firmware that also uplinks the packets it hears to MQTT over WiFi.
Observer Companion is a fork of MeshCore that brings the MQTT "observer" uplink — originally built by agessaman for the repeater and room-server roles — onto the companion radio firmware. The result is a single device that behaves as a normal MeshCore companion (pair it with the phone/web app) and publishes every mesh packet it receives to one or more MQTT brokers (LetsMesh, MeshMapper, and the other community map/analyzer services) for monitoring and mapping.
WiFi station mode is already part of MeshCore; this project wires the MQTT bridge into the companion build and lets it own the WiFi connection for the uplink.
This is an early, working MVP focused on one board (Heltec WiFi LoRa 32 V3):
- ✅ New build target
Heltec_v3_companion_radio_observer_mqtt— a USB companion + MQTT uplink. - ✅ Heard packets (
logRx) and self-originated adverts (logTx), plus raw radio data, are fed to the MQTT bridge and published using the same slot/preset system as the repeater observer. - ✅ Config is supplied at build time (WiFi credentials + broker presets via build flags).
- 🚧 Runtime configuration on the companion (via the app, no reflash) is on the roadmap.
- 🚧 More boards, and a BLE-companion variant, are on the roadmap.
The MQTT uplink itself (slots, presets, JWT signing, reconnection, JSON formats) is the mature implementation from agessaman's branch. See MQTT_IMPLEMENTATION.md for the full reference.
You'll need PlatformIO. The build embeds a TLS root-certificate bundle, so the first build downloads it (network required).
-
Set your WiFi and (optionally) brokers. Either uncomment and edit the placeholders in
variants/heltec_v3/platformio.iniunder[env:Heltec_v3_companion_radio_observer_mqtt], or pass them on the command line:pio run -e Heltec_v3_companion_radio_observer_mqtt \ --project-option="build_flags=-D OBSERVER_WIFI_SSID='\"my-wifi\"' -D OBSERVER_WIFI_PWD='\"my-pass\"'"Key build flags:
Flag Purpose Default OBSERVER_WIFI_SSIDWiFi SSID for the uplink (unset → uplink disabled) OBSERVER_WIFI_PWDWiFi password (unset) MQTT_DEFAULT_SLOT1_PRESETFirst broker preset analyzer-usMQTT_DEFAULT_SLOT2_PRESETSecond broker preset analyzer-euMQTT_DEFAULT_IATAOptional IATA airport code tag (empty) Broker preset names (e.g.
analyzer-us,meshmapper,meshrank,cascadiamesh, …) are listed in MQTT_IMPLEMENTATION.md. IfOBSERVER_WIFI_SSIDis left unset, the firmware builds and runs as a plain companion with the uplink disabled. -
Build and flash:
pio run -e Heltec_v3_companion_radio_observer_mqtt -t upload
-
Connect the MeshCore app to the device over USB as usual. On the serial console you can watch the device boot; once WiFi associates, it begins publishing heard packets to your configured brokers.
Why USB? This MVP keeps the app on the USB serial link and lets the MQTT bridge own the WiFi radio for the uplink. (MQTT debug logging is intentionally disabled in this target so it can't corrupt the app's binary serial frames.)
The MQTT bridge is self-contained (src/helpers/bridges/MQTTBridge.*, MQTTMessageBuilder,
JWTHelper, MQTTPresets) and reads its configuration from a NodePrefs struct. The companion
firmware has its own NodePrefs, so the integration is kept in a thin glue module:
examples/companion_radio/MqttObserver.{h,cpp}— owns the bridge and a CommonCLI-styleNodePrefs. Only the.cppincludesCommonCLI.h, so the twoNodePrefsdefinitions never collide. The header exposes a tiny API (begin / loop / onRx / onRxRaw / onTx).examples/companion_radio/MyMesh.cpp— overrideslogRx/logRxRaw/logTx(the same hooks the repeater observer uses) and forwards packets to the glue. All of this is guarded by#ifdef WITH_MQTT_BRIDGE, so the stock companion builds are unaffected.
This repo is a fork of meshcore-dev/MeshCore, with the MQTT work tracked from
agessaman/MeshCore. Typical remotes:
git remote add upstream https://github.com/meshcore-dev/MeshCore.git # core updates
git remote add agessaman https://github.com/agessaman/MeshCore.git # MQTT observer updates
git fetch upstream && git merge upstream/dev # pull core changesSee ROADMAP.md.
- MeshCore by Scott Powell (ripplebiz) and contributors — the underlying mesh firmware. Released under the MIT License.
- agessaman/MeshCore (
mqtt-bridge-implementation-flex) — the MQTT observer/bridge implementation that this project builds on.
Observer Companion only adds the companion-role integration, build target, and packaging on top of their work. Please support the upstream projects and the broader MeshCore community.
MIT — see license.txt. Same license as upstream MeshCore.