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

🐞 [Bug]: nodes UIs always shows “signal good” when RSSI value is unknown (indicated by 0) #930

Open
1 task done
powersjcb opened this issue Sep 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@powersjcb
Copy link
Contributor

Firmware Version

2.5.*

What did you do?

View nodes list page

Expected Behavior

It should show unknown or some other indicator if the data is missing. Ideally hiding the value when zero.

Current Behavior

UI shows 0 and “good” signal when only SNR is present.

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

I don’t have a lot of context on this could use help defining more clear behavior when data is missing.

@powersjcb powersjcb added the bug Something isn't working label Sep 14, 2024
@garthvh
Copy link
Member

garthvh commented Sep 14, 2024

Rssi is included in the snr and only tells us if there is noise, not sure what this would do

@powersjcb
Copy link
Contributor Author

powersjcb commented Sep 14, 2024

I think something might still be wrong in how we display this. I'm pretty sure our code assumes RSSI is always present, but a value of 0 represents. ("not available") Using RSSI of 0 would be extremely an strong signal.

This RSSI of 0 (actually null) seems to be getting plugged into some calculation for how we display link quality. ("good" "bad" "fair") I haven't dug into the source for this, but it looks like we are using something like SINR.

See these two nodes:

node 1: {
  rssi: 0 // actually an unknown value
  snr: -15
  display: "good"
node 2:
  rssi: -121
  snr: -10.75 // better signal to noise ratio than node 1
  display: "bad"

The node 2 has better SNR, but it's still showing up as a worse link than node 1.

image image

@powersjcb
Copy link
Contributor Author

powersjcb commented Sep 14, 2024

Yup, it looks like our code assumes that RSSI will always be available. (which isn't the case)

func getLoRaSignalStrength(snr: Float, rssi: Int32, preset: ModemPresets) -> LoRaSignalStrength {
	if rssi > -115 && snr > (preset.snrLimit()) {
		return .good
	} else if rssi < -126 && snr < (preset.snrLimit() - 7.5) {
		return .none
	} else if rssi <= -120 || snr <= (preset.snrLimit() - 5.5) {
		return .bad
	} else { return .fair }
}

I'm going to update this logic to ignore rssi when it's value is 0.

@powersjcb
Copy link
Contributor Author

powersjcb commented Sep 14, 2024

Per the discord #firmware channel

RSSI is not stored in NodeInfo, only SNR. So, if you haven't received any data from a node after connecting, you'll only see the SNR.

@powersjcb powersjcb changed the title 🐞 [Bug]: nodes UIs show “signal good” when RSSI value is unknown (indicated by 0) 🐞 [Bug]: nodes UIs always shows “signal good” when RSSI value is unknown (indicated by 0) Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants