diff --git a/meshtastic/config.proto b/meshtastic/config.proto index 649495e9..f3d29678 100644 --- a/meshtastic/config.proto +++ b/meshtastic/config.proto @@ -262,6 +262,11 @@ message Config { * Defaults to ENABLED */ BuzzerMode buzzer_mode = 13; + + /* + * How often to broadcast routing stats packets (0 to disable) + */ + uint32 routing_stats_broadcast_secs = 14; } /* diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 3117af29..2ac20636 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -2565,3 +2565,91 @@ message ChunkedPayloadResponse { resend_chunks resend_chunks = 4; } } + +message RoutingStats { + /* + * Number of seconds these stats cover + */ + uint32 window_secs = 1; + + /* + * Current channel util (0-100) + */ + uint32 channel_util_pct = 2; + + /* + * Current TX duty (0-100) + */ + uint32 tx_duty_pct = 3; + + /* + * Total number of packets transmitted + */ + uint32 tx_total = 4; + + /* + * Total transmission time in milliseconds + */ + uint32 tx_total_ms = 5; + + /* + * Number of packets we originated + */ + uint32 tx_mine = 6; + + /* + * Number of zero-hop packets we originated + */ + uint32 tx_zero = 7; + + /* + * Number of transmitted packets that we didn't originate + */ + uint32 tx_relayed = 8; + + /* + * Number of packets dropped from the TX queue without being sent + */ + uint32 tx_dropped = 9; + + /* + * Number of packets deferred to the late contention window + */ + uint32 tx_deferred = 10; + + /* + * Maximum number of packets in the TX queue + */ + uint32 tx_hwm = 11; + + /* + * Total number of packets received + */ + uint32 rx_total = 12; + + /* + * Total receive time in milliseconds + */ + uint32 rx_total_ms = 13; + + /* + * Number of packets we failed to successfully receive + */ + uint32 rx_bad = 14; + + /* + * Number of packets we received directly from the original sender (excludes zero-hop) + */ + uint32 rx_direct = 15; + + /* + * Number of packets we received that were sent zero-hop + */ + uint32 rx_zero = 16; + + /* + * Number of packets we received with hop_limit=0 (excludes zero-hop) + */ + uint32 rx_eol = 17; + +} \ No newline at end of file diff --git a/meshtastic/portnums.proto b/meshtastic/portnums.proto index 918b0633..f27a3eac 100644 --- a/meshtastic/portnums.proto +++ b/meshtastic/portnums.proto @@ -150,6 +150,14 @@ enum PortNum { */ NODE_STATUS_APP = 36; + /* + * Routing statistics module included in the firmware + * ENCODING: protobuf + * This module sends windowed stats about the node's routing behaviour, to facilitate troubleshooting + * & planning of infrastructure nodes, and better insight into traffic flow during testing. + */ + ROUTING_STATS_APP = 37; + /* * Provides a hardware serial interface to send and receive from the Meshtastic network. * Connect to the RX/TX pins of a device with 38400 8N1. Packets received from the Meshtastic