Skip to content

Save extra_sf and discovery_mod_timestamp in /prefs.json - #3799

Open
marcelverdult wants to merge 1 commit into
meshcore-dev:devfrom
marcelverdult:upstream-candidate/prefs-extra-sf-disc
Open

marcelverdult wants to merge 1 commit into
meshcore-dev:devfrom
marcelverdult:upstream-candidate/prefs-extra-sf-disc

Conversation

@marcelverdult

@marcelverdult marcelverdult commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

NodePrefs::saveSerial()/loadSerial() leave out two fields that the firmware keeps as live state, so both are reset on every reboot of a node that boots from /prefs.json:

  • discovery_mod_timestamp ("has this node changed since", read by the repeater and sensor discovery replies). The legacy binary loader still reads it, so it was lost only after the move to /prefs.json.
  • extra_sf (side detector spread factors set with "extra.sf"). It was never persisted in either format.

Both are now written ("disc_mod" next to the advert intervals, "extra_sf" in the radio object as hex, like the companion's scope key). The constructor zeroes extra_sf, which had no initialiser and is now written out.

Compatibility: a file without the keys loads as before, the serializer leaves a field alone when its key is missing. A firmware that does not know the keys skips them like any unknown key.

marcelverdult added a commit to marcelverdult/MeshCore_Refactor that referenced this pull request Nov 11, 2026
…a-sf-disc

docs: note for upstream PR meshcore-dev#3799 (extra_sf, discovery_mod_timestamp)
@marcelverdult
marcelverdult force-pushed the upstream-candidate/prefs-extra-sf-disc branch from b9805cc to e27f68d Compare November 11, 2026 11:41
@liamcottle

Copy link
Copy Markdown
Member

Hey there, thanks for the PR. The tests aren't needed for this. Only the 3 lines in CommonCLI.cpp, please remove all other changes.

NodePrefs::saveSerial()/loadSerial() leave out two fields that the firmware
keeps as live state, so both are reset on every reboot of a node that boots
from /prefs.json:

- discovery_mod_timestamp ("has this node changed since", read by the
  repeater and sensor discovery replies). The legacy binary loader still reads
  it, so it was lost only after the move to /prefs.json.
- extra_sf (side detector spread factors set with "extra.sf"). It was never
  persisted in either format.

Both are now written ("disc_mod" next to the advert intervals, "extra_sf" in
the radio object as hex, like the companion's scope key). The constructor
zeroes extra_sf, which had no initialiser and is now written out.

Compatibility: a file without the keys loads as before, the serializer leaves
a field alone when its key is missing. A firmware that does not know the keys
skips them like any unknown key.
@marcelverdult
marcelverdult force-pushed the upstream-candidate/prefs-extra-sf-disc branch from e27f68d to 1dc2493 Compare November 12, 2026 12:04
@marcelverdult

Copy link
Copy Markdown
Contributor Author

Done, reduced to the three lines (they are in CommonCLI.h).

This branch has not been deployed

No deployments
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.

2 participants