From 290f8cf6f5524019177360496f18e24d095935a5 Mon Sep 17 00:00:00 2001 From: George <509474+giannoug@users.noreply.github.com> Date: Tue, 8 Sep 2026 20:29:54 +0300 Subject: [PATCH] fix: show ROUTING ACK/NAK instead of misleading "error_reason: NONE" (#160) error_reason sits in a protobuf oneof, so the NONE zero value is written to the wire and printed verbatim, making successful ACKs look like errors. Render NONE as "ACK" and anything else as "NAK: ". Confirmed against live MQTT traffic (19 NONE, 22 NO_RESPONSE, all with request_id set). --- meshview/web.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/meshview/web.py b/meshview/web.py index 03f61fd..a393196 100644 --- a/meshview/web.py +++ b/meshview/web.py @@ -16,6 +16,7 @@ from google.protobuf.message import Message from jinja2 import Environment, PackageLoader, Undefined, select_autoescape from markupsafe import Markup +from meshtastic.protobuf.mesh_pb2 import Routing from meshtastic.protobuf.portnums_pb2 import PortNum from meshview import config, database, decode_payload, migrations, models, store from meshview.__version__ import ( @@ -81,6 +82,17 @@ class Packet: if payload is None: text_payload = "Did not decode" + elif ( + packet.portnum == PortNum.ROUTING_APP + and isinstance(payload, Routing) + and payload.WhichOneof("variant") == "error_reason" + ): + # error_reason NONE is the implicit ACK, not a failure. + text_payload = ( + "ACK" + if payload.error_reason == Routing.Error.NONE + else f"NAK: {Routing.Error.Name(payload.error_reason)}" + ) elif isinstance(payload, Message): text_payload = text_format.MessageToString(payload) elif packet.portnum == PortNum.TEXT_MESSAGE_APP and packet.to_node_id != 0xFFFFFFFF: