Skip to content

Noise floor#1566

Open
RCGV1 wants to merge 4 commits into
mainfrom
noise-floor
Open

Noise floor#1566
RCGV1 wants to merge 4 commits into
mainfrom
noise-floor

Conversation

@RCGV1
Copy link
Copy Markdown
Member

@RCGV1 RCGV1 commented Jan 18, 2026

What changed?

Added noise floor readings to the app from local stats. Also added a Local Stats log page that is in Node details. Also added a button to request local stats from a non local node (30s cooldown)

Why did it change?

Local stats and Noise Floor are extremely useful for advanced users to visualize how their node is behaving.

Depends on:
meshtastic/firmware#9347

How is this tested?

Tested with my custom firmware extensively

Screenshots/Videos (when applicable)

Screenshot 2026-01-17 at 7 26 34 PM

Checklist

  • My code adheres to the project's coding and style guidelines.
  • I have conducted a self-review of my code.
  • I have commented my code, particularly in complex areas.
  • I have verified whether these changes require an update to existing documentation or if new documentation is needed, and created an issue in the docs repo if applicable.
  • I have tested the change to ensure that it works as intended.

RCGV1 added 3 commits January 17, 2026 19:30
Conflicts resolved:
- AccessoryManager+ToRadio.swift: Keep both sendLocalStatsRequest and exchangeUserInfo
- NodeDetail.swift: Keep both RequestLocalStatsButton and ExchangeUserInfoButton
- project.pbxproj: Add ExchangeUserInfoButton.swift to project
@garthvh garthvh requested a review from GUVWAF February 12, 2026 00:00
@GUVWAF
Copy link
Copy Markdown
Member

GUVWAF commented Feb 12, 2026

Left some comments in the firmware PR, but in general I would say it would be good to have an explanation with e.g. TipKit about it. It needs to be taken with a grain of salt, and it can vary quite a bit (as you can see in 2 minutes there is already almost 10dB difference). Adding filters does not necessarily help, e.g. when the noise/interference is in-band and may skew the result, as they have an insertion loss which will result in a lower noise floor shown.

@github-actions github-actions Bot added the Stale label Mar 15, 2026
@github-actions github-actions Bot closed this Mar 23, 2026
@thebentern thebentern reopened this Mar 23, 2026
@thebentern thebentern removed the Stale label Mar 23, 2026
@Deuteranomalous1
Copy link
Copy Markdown

Great feature that will really assist with infrastructure site selection. No more inferring noise floor via traceroute to other nodes.

@garthvh
Copy link
Copy Markdown
Member

garthvh commented Apr 18, 2026

@copilot resolve the merge conflicts in this pull request

@garthvh
Copy link
Copy Markdown
Member

garthvh commented Apr 18, 2026

Left some comments in the firmware PR, but in general I would say it would be good to have an explanation with e.g. TipKit about it. It needs to be taken with a grain of salt, and it can vary quite a bit (as you can see in 2 minutes there is already almost 10dB difference). Adding filters does not necessarily help, e.g. when the noise/interference is in-band and may skew the result, as they have an insertion loss which will result in a lower noise floor shown.

@copilot implement this tipkit suggestion

Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 18, 2026

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ RCGV1
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 18, 2026

@copilot resolve the merge conflicts in this pull request

Merged origin/main into the branch and resolved the two conflicts in commit 436ba7a0:

  • Meshtastic.xcodeproj/project.pbxproj: Took main's version — updated MARKETING_VERSION to 2.7.9 and added OTHER_LDFLAGS with the SwiftUI weak framework link.
  • Meshtastic/Helpers/MeshPackets.swift: Took main's refactored async nodeInfoPacket (returns NSManagedObjectID? via context.perform) and async telemetryPacket, while preserving the noise floor additions (telemetry.noiseFloor = telemetryMessage.localStats.noiseFloor and the updated log message).

Copilot AI requested a review from garthvh April 18, 2026 23:20
Copy link
Copy Markdown
Member

@garthvh garthvh left a comment

Choose a reason for hiding this comment

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

Thanks for the PR — noise floor and local stats are genuinely useful diagnostics for advanced users, and the overall structure of the feature (chart + table + CSV export + request button with cooldown) is solid and matches the pattern of the existing telemetry log views. A few blocking issues need to be resolved before this can merge.


Critical — .gitmodules points to a forked protobufs submodule

The PR changes .gitmodules to point at https://github.com/RCGV1/protobufs-fork.git on branch noise-floor. This cannot be merged — the submodule must always point to https://github.com/meshtastic/protobufs.git.

The good news: noiseFloor (field 15 in LocalStats) is already present in the official protobufs on maintelemetryMessage.localStats.noiseFloor is already available as Int32. Please revert the .gitmodules change and point the submodule back to the official repo.

Critical — Wrong persistence layer for TelemetryEntity

The PR modifies Meshtastic/Meshtastic.xcdatamodeld/MeshtasticDataModelV 55.xcdatamodel and TelemetryEntity+CoreDataClass.swift. Core Data has been replaced by SwiftData in this project. On main, TelemetryEntity is a SwiftData @Model at Meshtastic/Model/TelemetryEntity.swift.

The noiseFloor property must be added to the SwiftData model:

// Meshtastic/Model/TelemetryEntity.swift
var noiseFloor: Int32?

A VersionedSchema migration entry is also required in MeshtasticSchema.swift. See docs/developer/swiftdata.md for the migration pattern used in this project.

Critical — NSPredicate in LocalStatsLog and NodeDetail

NSPredicate is a Core Data API. Two places use it:

// LocalStatsLog.swift
node.telemetries?.filtered(using: NSPredicate(format: "metricsType == 4"))

// NodeDetail.swift
node.telemetries?.filtered(using: NSPredicate(format: "metricsType == 4")).count

With SwiftData, use Swift's native filter:

node.telemetries.filter { $0.metricsType == 4 }

Critical — @Environment(.managedObjectContext) in LocalStatsLog

@Environment(\.managedObjectContext) var context

This is the Core Data environment key. The SwiftData equivalent is:

@Environment(\.modelContext) var context

Warning — Proto type mismatch: noiseFloor is Int32, not Float

The protobuf defines noiseFloor as Int32 (whole dBm value). The PR stores and displays it as Float. Please keep it as Int32 throughout — in the SwiftData model, the CSV export, and the chart/table display. The noiseFloor != 0 nil check should also become hasValue optional pattern once stored as Int32?.

Warning — Typo in user-facing alert string

"Responses can some time."

Should be:

"Responses can take some time."

Warning — "Icky" as a localizable string

"Icky" is used as a RuleMark chart label and appears in Localizable.xcstrings with the comment "Icky" is slang for very bad. Slang does not translate well and will confuse translators. Please use a proper technical label such as "Poor Signal" or "Threshold (-85 dBm)".

Warning — Checklist not completed

All checklist items are unchecked. Please complete the self-review checklist before requesting review.


What to keep as-is

  • sendLocalStatsRequest() in AccessoryManager+ToRadio — clean, follows existing patterns perfectly
  • RateLimitedButton with 30s cooldown — correct approach
  • CSV export in WriteCsvFile.swift — well structured
  • Overall LocalStatsLog view structure (chart + table + export buttons) — matches DeviceMetricsLog and other telemetry log views nicely
  • noiseFloor colour coding logic — sensible thresholds

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.

7 participants