diff --git a/docs/cli_build_matrix.md b/docs/cli_build_matrix.md index 12fe637d3..aff20bf8c 100644 --- a/docs/cli_build_matrix.md +++ b/docs/cli_build_matrix.md @@ -88,6 +88,9 @@ The default `cascade` settings profile enables device and LoRa RX power saving; saved preferences take precedence, and active USB/network services can prevent device sleep. `--profile default` instead uses the upstream power-saving defaults. +Cascade Companions default to **2-byte path hashes per hop** (`path.hash.mode 1`) +on a fresh install or factory reset. Saved path settings take precedence. + ## Role comes first | Role | Text administration CLI | diff --git a/docs/cli_commands.md b/docs/cli_commands.md index 77862d743..fbcfd5937 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -3428,7 +3428,8 @@ installed images need an updated build. See the [setting-dispatch audit](test-re - `2`: 3 Byte hash size (16,777,216 unique ids)[21 max flood] - `3`: DO NOT USE (Reserved) -**Default:** `0` +**Default:** `0` (1 byte). Cascade Companions use `1` (2 bytes), and Cascade +Repeaters use `2` (3 bytes). Existing saved values are preserved. **Note:** the 'path.hash.mode' sets the low-level ID/hash encoding size used when the repeater adverts. This setting has no impact on what packet ID/hash size this repeater forwards, all sizes should be forwarded on firmware >= 1.14. This feature was added in firmware 1.14 diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index e3fd93c8d..4e2497d72 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -305,6 +305,14 @@ static bool save_filter(const ContactInfo& c); #ifndef DEFAULT_PATH_HASH_MODE #define DEFAULT_PATH_HASH_MODE 0 #endif +#ifndef DEFAULT_COMPANION_PATH_HASH_MODE +#if defined(CASCADE_PROFILE) && CASCADE_PROFILE +// Mode is zero-based: Cascade Companions use two bytes per path hop. +#define DEFAULT_COMPANION_PATH_HASH_MODE 1 +#else +#define DEFAULT_COMPANION_PATH_HASH_MODE DEFAULT_PATH_HASH_MODE +#endif +#endif #ifndef DEFAULT_MANUAL_ADD_CONTACTS #define DEFAULT_MANUAL_ADD_CONTACTS 0 #endif @@ -2909,7 +2917,7 @@ MyMesh::MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMe _prefs.peripherals_shared = 0; // A genuinely fresh missing image is GPS-only. #endif _prefs.autoadd_config = DEFAULT_AUTOADD_CONFIG; - _prefs.path_hash_mode = DEFAULT_PATH_HASH_MODE; + _prefs.path_hash_mode = DEFAULT_COMPANION_PATH_HASH_MODE; #ifdef RADIO_FEM_TXGAIN _prefs.radio_fem_txgain = RADIO_FEM_TXGAIN; #else