SPEEDBIRD

HF stations as real Meshtastic nodes (investigation, 2026-11-20)#

Goal: HF stations heard by SPEEDBIRD appear in every Meshtastic app's node list with a long name, short name and position, so mesh users can DM them and reply. Their replies go back out over HF.

Status: feasible on stock firmware (checked against firmware source tag v2.7.26.54e0d8d, the version on the station T-Beam !e0f79aec). Not implemented yet. Today core/hfnodes.py publishes HF stations as waypoints, because its docstring is right that a client cannot set from: MeshService::handleToRadio resets any client-chosen from to 0.

Firmware trusts packets that arrive from MQTT downlink, from included. With mqtt.proxy_to_client_enabled the "broker" is simply the connected client: our meshbridge sends ToRadio.mqttClientProxyMessage{topic, data=ServiceEnvelope}, and the firmware runs it through MQTT::onClientProxyReceive -> onReceiveProto. Nothing leaves the station; no internet or broker is needed.

onReceiveProto (src/mqtt/MQTT.cpp) accepts the envelope when:

check what we send
channel_id == channels.getGlobalId(idx) and that channel has downlink_enabled the primary channel's global id ("LongFast" for an unnamed LONG_FAST primary; otherwise the channel name)
gateway_id != own node id a fixed fake gateway id, e.g. !5b000000
packet.from is not us the HF node's synthetic node number
decoded payload → mqtt.encryption_enabled must be false; ADMIN_APP refused decoded NODEINFO / POSITION / TEXT / ROUTING
hop_limit, hop_start <= 7 hop_start = hop_limit = N (configurable)

The packet is then enqueueReceivedMessage'd with via_mqtt=true: NodeDB, position and text modules handle it as if heard over the air, and it is delivered to the client/phone if broadcast or addressed to us. NextHopRouter::perhapsRebroadcast has no via_mqtt exclusion, so with hop_limit > 0 the gateway re-floods it over LoRa (gateway role CLIENT with rebroadcast ALL qualifies; CLIENT_MUTE would not). Every node in range then gets the HF node into its NodeDB.

Gotchas found in firmware source#

  1. is_licensed must match the receiver. NodeInfoModule::handleReceivedProtobuf drops a NodeInfo whose is_licensed != owner.is_licensed of the receiving node. Ordinary mesh nodes are unlicensed, so HF nodes must be advertised with is_licensed=false (default), even though they are hams. Licensed-mode nodes on the mesh would ignore them. Make it a per-rule option.
  2. No public key. We advertise none, so updateUser accepts the NodeInfo. Senders then fall back to channel-PSK encryption for DMs to these nodes, which the gateway can decode. (If a key were ever advertised we could not decrypt PKI DMs. Never send one.)
  3. Receivers with lora.ignore_mqtt=true drop them: the via_mqtt bit survives the LoRa rebroadcast. Default is false. Apps show these nodes with the "via MQTT" cloud marker.
  4. Proxy queue is single-consumer. MeshService::sendMqttMessageToClientProxy has one queue. If a phone is also connected to the gateway radio over BLE, it competes with the serial bridge for uplinked messages. Recommend that phones use a different mesh node, or accept that replies may be lost.
  5. PhoneAPI ignores proxy messages until the config handshake is complete. Inject only after hello.
  6. Gateway NodeDB size is limited (T-Beam ~100 entries). Refresh NodeInfo at about the node_info_broadcast_secs cadence (3 h) so entries are not evicted.

Replies (mesh → HF)#

Router::handleReceived uplinks every packet it decodes on an uplink_enabled channel, DMs to other node numbers included. Locally originated packets are uplinked from Router::send. So a DM from any mesh user to an HF node number reaches the bridge as a proxy ServiceEnvelope. Two conditions:

On a DM to == hf_node_num, portnum TEXT_MESSAGE_APP: 1. Apply the existing gateway gates (deny list, relay_mode, allowlist, allow_third_party, rate limit). 2. Accepted: SbpService.send(rule.sbp_radio, <call>, text="[MESH <short>/<!id>] ..."), and inject a Routing ACK from=hf_node, to=sender, request_id=pkt.id, ROUTING_APP{error_reason: NONE} so the sender's app shows it delivered and stops retransmitting. The sender also learns next-hop = gateway. An HF ARQ result can follow as a DM from the HF node ("✓ delivered on 20 m" / "✗ HF failed"). 3. Refused: inject a NAK (error_reason e.g. NOT_AUTHORIZED/NO_RESPONSE) so the user sees a failure, not a false tick.

HF → mesh text from a station becomes TEXT_MESSAGE_APP from that station's node (broadcast on the rule's channel, or a DM when addressed to a mesh node), so "Reply" in the app works without the [HF call] prefix.

Node identity#

field value
node num sha1("hf:"+CALL)[:4] as uint32, avoid < 4, 0xFFFFFFFF and collisions with real NodeDB nums; persisted map call↔num
User.id !%08x of num (firmware rewrites it anyway)
long_name (≤39 B) "N0CALL-7 HF 20m", i.e. call + band of last heard; user override per station
short_name (≤4 B) default: call suffix + SSID (N0CALL-7 → CALL7), user override
hw_model / role PRIVATE_HW / CLIENT
is_licensed false by default (gotcha 1)
Position latitude_i/longitude_i from NodeDB lat/lon or Maidenhead centre (hfnodes.position), location_source=LOC_MANUAL, precision_bits 32 for real fixes, ~17 for a 6-char grid, ~12 for 4-char, time = last heard

Radio configuration required (one-time, reboots the radio)#

mqtt.enabled=true  mqtt.proxy_to_client_enabled=true  mqtt.encryption_enabled=false
mqtt.json_enabled=false  mqtt.map_reporting_enabled=false  mqtt.address=127.0.0.1
channel[primary].uplink_enabled=true  channel[primary].downlink_enabled=true

Current station radio: MQTT off, address=mqtt.meshtastic.org, encryption_enabled=true, ch0 up/down off. set_mqtt in meshbridge already handles enabled/proxy/address/uplink/downlink. It still needs encryption_enabled.

Implementation plan#

  1. meshbridge (GPL side): subscribe meshtastic.mqttclientproxymessage, parse ServiceEnvelope, emit {"type":"mqtt_uplink", channel_id, gateway_id, packet:{...decoded like _handle_packet}}. New command inject {from, to, channel_id, hop_limit, want_ack, id?, portnum, nodeinfo|position|text|routing} builds the MeshPacket + ServiceEnvelope and calls iface.sendMqttClientProxyMessage(topic, bytes). Add encryption_enabled to set_mqtt. Report the primary's global channel id in config.
  2. core/meshtastic.py: inject_nodeinfo / inject_position / inject_text / inject_routing wrappers; track proxy_ready (MQTT proxy on and a downlink channel present).
  3. core/hfnodes.py: new hf_to_mesh_as = "mesh_nodes" mode next to the nodes (waypoint) mode. Same candidate/pacing logic. Per station it sends NodeInfo + Position instead of a waypoint, with the persisted call↔num map and name overrides.
  4. core/gateway.py: on_mesh also handles mqtt_uplink DMs whose to is a known HF node → _relay_to_hf(..., hf_peer=<call>) + ACK/NAK. on_sbp posts as the HF node.
  5. UI (mesh page / gateway rule): mode selector, hop limit, "Prepare radio" button (applies the config above via meshconfig plan/apply), per-station long/short name editing.
  6. Tests: envelope encode/decode round trip, gate → ACK/NAK, name/num derivation, is_licensed default.

Airtime: each refresh is NodeInfo + Position flooded hop_limit times. Keep pace_s (20 s) per device, resend only on change or every 3 h, and default the injection hop limit to 2.

Part 97: DMs from unlicensed mesh users to an HF node are third-party traffic. Every existing gate (allow_third_party, allowlist, deny list) applies unchanged; refused DMs are NAKed.