Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hops Away implementation #966

Merged
merged 8 commits into from
Apr 21, 2024
Merged

Conversation

DayleDrinkwater
Copy link
Contributor

A basic implementation of Hops Away, closing #922

Modifies SignalInfo, if hopsAway is more than 0 it replaces the RSSI with the number of hops.

hops

@CLAassistant
Copy link

CLAassistant commented Apr 11, 2024

CLA assistant check
All committers have signed the CLA.

@prokrypt
Copy link
Contributor

prokrypt commented Apr 12, 2024

Nice! But it leaves an ambiguity: a node with RSSI/SNR displayed is either a neighbor or a packet [possibly rebroadcasted] from an older firmware node. Perhaps try to find a way to differentiate between the two (different color, additional text like [N] or [Neighbor])...

…when hopStart isn't included on packets (with this info, we can't differentiate between a node which is Hops Away but on old firmware, or nodes which are on new firmware but direct. Both are 0)

Check if hopStart is 0 but hopLimit is not 0, if true set hopsAway to -1.

Show nodes with hopsAway with -1 with a (!) appended to the RSSI details, to show this probably isn't true. (eg they are using old firmware)

Change the default of hopsAway to -1, until we know it is direct (0) or hops away (1+)
@DayleDrinkwater
Copy link
Contributor Author

Hi @prokrypt , good point. I've now made some changes. It now marks RSSI on nodes with a (!) if hopStart is 0, but hopLimit isn't. this will differentiate between nodes which are direct (no (!)) and nodes which are running old FW (not sending hopStart).

by default it marks all nodes with (!) until it knows for certain, at which point it will remove the ! if the are direct, or show Hops Away. if they are running old FW or it doesn't know, it'll continue to mark them with a (!)
hops2

Copy link
Contributor

@prokrypt prokrypt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible lifehack:
if (packet.hopStart < packet.hopLimit) ... (just a random musing. totally untested!)

@DayleDrinkwater
Copy link
Contributor Author

I did think that after I commited, I'll try it later on

app/src/main/java/com/geeksville/mesh/NodeInfo.kt Outdated Show resolved Hide resolved
.idea/inspectionProfiles/Project_Default.xml Outdated Show resolved Hide resolved
Move hopsAway var to end of NodeInfo Class.

Schema update due to change above.
hopsAway now imported from radio (installNodeInfo)
@andrekir andrekir linked an issue Apr 16, 2024 that may be closed by this pull request
@andrekir andrekir merged commit 47b2ecc into meshtastic:master Apr 21, 2024
2 checks passed
danwelch3 pushed a commit to danwelch3/meshtastic-android that referenced this pull request Oct 3, 2024
* Initial Hops Away feature

* Generate our own hopsAway, comparing hopStart to hopLimit

* Remove import of hopsAway from device nodeInfo, as this only shows 0 when hopStart isn't included on packets (with this info, we can't differentiate between a node which is Hops Away but on old firmware, or nodes which are on new firmware but direct. Both are 0)

Check if hopStart is 0 but hopLimit is not 0, if true set hopsAway to -1.

Show nodes with hopsAway with -1 with a (!) appended to the RSSI details, to show this probably isn't true. (eg they are using old firmware)

Change the default of hopsAway to -1, until we know it is direct (0) or hops away (1+)

* tidy up: move from nested if else to when

* Revert Project_Default.xml

* Move hopsAway when block in to updateNodeInfo() block above it.

Move hopsAway var to end of NodeInfo Class.

Schema update due to change above.

* hopsAway now follows firmware implementation.
hopsAway now imported from radio (installNodeInfo)

* reformat

---------

Co-authored-by: andrekir <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hops Away
4 participants