Skip to content

Conversation

@esev
Copy link

@esev esev commented Jan 2, 2026

Description

Update the number of hops away for each node in the 'Connections' column of the node list table as new packets arrive.

Related Issues

Follows the logic from the firmware project: meshtastic/firmware#9120

Changes Made

hopsAway for a node is calculated each time a new packet is received. It is set based on the difference between the hop_start & hop_limit in the MeshPacket.

Prior to firmware version v2.3.0 nodes did not provide a hop_start in packets. This meant that receiving a hop_start value of 0 could mean two different things; either the node was older and didn't supply a hop_start, or the transmitting node had LoRa number of hops set to 0. This PR uses the presence of the bitfield, added in v2.5.0, to distinguish between these two cases.

When hop_start=0 and the bitfield is present, we can trust that the transmitting node had LoRa number of hops set to 0. Otherwise the value for hopsAway is undefined.

Testing Done

Updated existing unit tests and verified the hops are calculated correctly by connecting to a bluetooth device.

Checklist

  • Code follows project style guidelines
  • Documentation has been updated or added
  • Tests have been added or updated
  • All i18n translation labels have been added (read
    CONTRIBUTING_I18N_DEVELOPER_GUIDE.md for more details)

@esev esev added the feature request New feature or request label Jan 2, 2026
@vercel
Copy link

vercel bot commented Jan 2, 2026

@esev is attempting to deploy a commit to the Meshtastic Team on Vercel.

A member of the Team first needs to authorize it.

@esev esev marked this pull request as ready for review January 2, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant