Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b4a20c1
Add a new frequency range for EU SRD area with adaptive DC
caveman99 Nov 19, 2025
b1a0633
new presets yo
NomDeTom Dec 20, 2025
d6b58c7
Update protobufs
NomDeTom Dec 20, 2025
6d5b632
Merge pull request #4 from NomDeTom/create-pull-request/update-protobufs
NomDeTom Dec 20, 2025
d8bfab5
guards against using presets outside of region
NomDeTom Dec 20, 2025
dcf476c
update EU 866MHz band description
NomDeTom Dec 23, 2025
8fa1c4a
Refactor preset validation to happen before applying radio config (an…
Stary2001 Dec 24, 2025
94aa0fb
add default preset to regions
NomDeTom Dec 24, 2025
3921945
update RDEF macro to include default presets and preset bits
NomDeTom Dec 24, 2025
44a2fda
Refactor RDEF macro for improved readability and consistency; adjust …
NomDeTom Dec 24, 2025
8b22774
Improved the allowed presets checking by adding a bitfield to each re…
NomDeTom Dec 25, 2025
ab601fa
Check settings against the new region, not the old one
Stary2001 Dec 26, 2025
9536221
use array of accepted modes per region
phaseloop Dec 28, 2025
e624b8f
fix compliation error
phaseloop Dec 28, 2025
52664f9
Merge pull request #6 from phaseloop/New_presets-array
NomDeTom Dec 29, 2025
e1ea21f
added ham check
NomDeTom Dec 29, 2025
9162a6f
interim for review
NomDeTom Dec 29, 2025
72b350c
Update HAM US433 frequency range and config settings
wehooper4 Jan 3, 2026
c4087d9
Merge pull request #7 from wehooper4/patch-1
NomDeTom Jan 3, 2026
4693296
remove hamfast
NomDeTom Jan 3, 2026
ef959cc
Update protobufs
NomDeTom Jan 3, 2026
0748de7
Merge pull request #8 from NomDeTom/create-pull-request/update-protobufs
NomDeTom Jan 3, 2026
2a25a15
tidy up removing hamfast
NomDeTom Jan 3, 2026
4a70f79
fixed license check
NomDeTom Jan 4, 2026
b87e88f
Add overrideSlot to RegionInfo and update RDEF macro usage, added err…
NomDeTom Jan 5, 2026
7255a02
added logging if slot override is being used
NomDeTom Jan 5, 2026
ebb70c4
Merge upstream branch changes, inc KZ region update and custom CR cha…
NomDeTom Jan 5, 2026
879daab
trunk FML
NomDeTom Jan 5, 2026
f64e69c
fixed error in CR check, added logic for if a lower CR than default i…
NomDeTom Jan 5, 2026
be0223e
Merge branch 'develop' into New_presets
NomDeTom Jan 6, 2026
b09dbf8
Remove ham settings for now.
NomDeTom Jan 17, 2026
8910650
Update protobufs
NomDeTom Jan 17, 2026
07e8fbf
Merge pull request #10 from NomDeTom/create-pull-request/update-proto…
NomDeTom Jan 17, 2026
d0a611b
Update protobuf submodule to latest commit
NomDeTom Jan 17, 2026
7a3ed22
Update protobufs
NomDeTom Jan 17, 2026
dd7efd3
Merge pull request #11 from NomDeTom/create-pull-request/update-proto…
NomDeTom Jan 17, 2026
0d2f3a5
Update protobuf submodule to latest commit
NomDeTom Jan 21, 2026
d8f5d6f
Update protobufs
NomDeTom Jan 21, 2026
30e9907
Merge pull request #12 from NomDeTom/create-pull-request/update-proto…
NomDeTom Jan 21, 2026
d1e639a
Merge branch 'develop' into New_presets
NomDeTom Jan 22, 2026
42548b7
Fix preset configuration for EU_866 region and update channel details…
NomDeTom Jan 22, 2026
fe01a40
Enhance region definitions by adding text, position, and telemetry th…
NomDeTom Jan 27, 2026
8bc35ac
tunk
NomDeTom Jan 27, 2026
694f4c9
Revert protobuf change
NomDeTom Jan 30, 2026
76e9293
Merge remote-tracking branch 'origin/develop' into New_presets
NomDeTom Jan 30, 2026
96a55f5
Merge remote-tracking branch 'origin/develop' into New_presets
NomDeTom Feb 2, 2026
34e39ae
padding added to supplement spacing of channels
NomDeTom Feb 2, 2026
93ebbfc
added more commentary
NomDeTom Feb 2, 2026
3b824c6
merge conflicts fixed - TY Stary
NomDeTom Feb 2, 2026
329b302
Add MeshRadio includes and region-specific throttling checks in telem…
NomDeTom Feb 3, 2026
47f8f40
committing changes to protobufs
NomDeTom Feb 14, 2026
20dcd7b
Merge remote-tracking branch 'origin/develop' into New_presets
NomDeTom Feb 14, 2026
d619cf3
Update protobuf submodule to latest commit
NomDeTom Feb 14, 2026
2083d3d
Merge branch 'develop' into New_presets
NomDeTom Feb 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion protobufs
12 changes: 12 additions & 0 deletions src/DisplayFormatters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ const char *DisplayFormatters::getModemPresetDisplayName(meshtastic_Config_LoRaC
case meshtastic_Config_LoRaConfig_ModemPreset_LONG_MODERATE:
return useShortName ? "LongM" : "LongMod";
break;
case meshtastic_Config_LoRaConfig_ModemPreset_LITE_FAST:
return useShortName ? "LiteF" : "LiteFast";
break;
case meshtastic_Config_LoRaConfig_ModemPreset_LITE_SLOW:
return useShortName ? "LiteS" : "LiteSlow";
break;
case meshtastic_Config_LoRaConfig_ModemPreset_NARROW_FAST:
return useShortName ? "NarF" : "NarrowFast";
break;
case meshtastic_Config_LoRaConfig_ModemPreset_NARROW_SLOW:
return useShortName ? "NarS" : "NarrowSlow";
break;
default:
return useShortName ? "Custom" : "Invalid";
break;
Expand Down
7 changes: 4 additions & 3 deletions src/airtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@ bool AirTime::isTxAllowedChannelUtil(bool polite)

bool AirTime::isTxAllowedAirUtil()
{
if (!config.lora.override_duty_cycle && myRegion->dutyCycle < 100) {
if (utilizationTXPercent() < myRegion->dutyCycle * polite_duty_cycle_percent / 100) {
float effectiveDutyCycle = getEffectiveDutyCycle();
if (!config.lora.override_duty_cycle && effectiveDutyCycle < 100) {
if (utilizationTXPercent() < effectiveDutyCycle * polite_duty_cycle_percent / 100) {
return true;
} else {
LOG_WARN("TX air util. >%f%%. Skip send", myRegion->dutyCycle * polite_duty_cycle_percent / 100);
LOG_WARN("TX air util. >%f%%. Skip send", effectiveDutyCycle * polite_duty_cycle_percent / 100);
return false;
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/graphics/draw/MenuHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ void menuHandler::LoraRegionPicker(uint32_t duration)
{"US", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_US},
{"EU_433", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_EU_433},
{"EU_868", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_EU_868},
{"NARROW_868", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_NARROW_868},
{"EU_866", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_EU_866},
{"CN", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_CN},
{"JP", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_JP},
{"ANZ", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_ANZ},
Expand All @@ -137,8 +139,7 @@ void menuHandler::LoraRegionPicker(uint32_t duration)
{"KZ_433", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_KZ_433},
{"KZ_863", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_KZ_863},
{"NP_865", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_NP_865},
{"BR_902", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_BR_902},
};
{"BR_902", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_BR_902}};

constexpr size_t regionCount = sizeof(regionOptions) / sizeof(regionOptions[0]);
static std::array<const char *, regionCount> regionLabels{};
Expand Down Expand Up @@ -188,7 +189,7 @@ void menuHandler::LoraRegionPicker(uint32_t duration)
#endif
config.lora.tx_enabled = true;
initRegion();
if (myRegion->dutyCycle < 100) {
if (getEffectiveDutyCycle() < 100) {
config.lora.ignore_mqtt = true; // Ignore MQTT by default if region has a duty cycle limit
}

Expand Down Expand Up @@ -325,7 +326,10 @@ void menuHandler::radioPresetPicker()
{"ShortSlow", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_SHORT_SLOW},
{"ShortFast", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST},
{"ShortTurbo", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_SHORT_TURBO},
};
{"LiteFast", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_LITE_FAST},
{"LiteSlow", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_LITE_SLOW},
{"NarrowFast", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_NARROW_FAST},
{"NarrowSlow", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_NARROW_SLOW}};

constexpr size_t presetCount = sizeof(presetOptions) / sizeof(presetOptions[0]);
static std::array<const char *, presetCount> presetLabels{};
Expand Down
49 changes: 46 additions & 3 deletions src/mesh/MeshRadio.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,21 @@ struct RegionInfo {
meshtastic_Config_LoRaConfig_RegionCode code;
float freqStart;
float freqEnd;
float dutyCycle;
float spacing;
float dutyCycle; // modified by getEffectiveDutyCycle
float spacing; // gaps between radio channels
float padding; // padding at each side of the "operating channel"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@caveman99 this is the method we're using to centralise the frequency slots within the allowed bands.

uint8_t powerLimit; // Or zero for not set
bool audioPermitted;
bool freqSwitching;
bool wideLora;
bool licensedOnly; // Only allow in HAM mode
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is unused for now, but lays the ground work for the hambands

int8_t textThrottle; // text broadcast throttle - signed to allow future changes
int8_t positionThrottle; // position broadcast throttle - signed to allow future changes
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is used for the PositionModule.cpp changes - current check is just for non-zero.

int8_t telemetryThrottle; // telemetry broadcast throttle - signed to allow future changes
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is used for all the other telemetry changes - current check is just for non-zero.

uint8_t overrideSlot; // default frequency slot if not using channel hashing
meshtastic_Config_LoRaConfig_ModemPreset defaultPreset;
// static list of available presets
const meshtastic_Config_LoRaConfig_ModemPreset *availablePresets;
const char *name; // EU433 etc
};

Expand All @@ -24,6 +33,20 @@ extern const RegionInfo *myRegion;

extern void initRegion();

/**
* Get the effective duty cycle for the current region based on device role.
* For EU_866, returns 10% for fixed devices (ROUTER, ROUTER_LATE) and 2.5% for mobile devices.
* For other regions, returns the standard duty cycle.
*/
extern float getEffectiveDutyCycle();

extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_STD[];
extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_EU_868[];
extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_LITE[];
extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_NARROW[];
// extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_HAM[];
extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_UNDEF[];

static inline float bwCodeToKHz(uint16_t bwCode)
{
if (bwCode == 31)
Expand Down Expand Up @@ -102,6 +125,26 @@ static inline void modemPresetToParams(meshtastic_Config_LoRaConfig_ModemPreset
cr = 8;
sf = 12;
break;
case meshtastic_Config_LoRaConfig_ModemPreset_LITE_FAST:
bwKHz = 125;
cr = 5;
sf = 9;
break;
case meshtastic_Config_LoRaConfig_ModemPreset_LITE_SLOW:
bwKHz = 125;
cr = 5;
sf = 10;
break;
case meshtastic_Config_LoRaConfig_ModemPreset_NARROW_FAST:
bwKHz = 62.5f;
cr = 6;
sf = 7;
break;
case meshtastic_Config_LoRaConfig_ModemPreset_NARROW_SLOW:
bwKHz = 62.5f;
cr = 6;
sf = 8;
break;
default: // LONG_FAST (or illegal)
bwKHz = wideLora ? 812.5f : 250.0f;
cr = 5;
Expand All @@ -117,4 +160,4 @@ static inline float modemPresetToBwKHz(meshtastic_Config_LoRaConfig_ModemPreset
uint8_t cr = 0;
modemPresetToParams(preset, wideLora, bwKHz, sf, cr);
return bwKHz;
}
}
2 changes: 1 addition & 1 deletion src/mesh/NodeDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ void NodeDB::loadFromDisk()
// Coerce LoRa config fields derived from presets while bootstrapping.
// Some clients/UI components display bandwidth/spread_factor directly from config even in preset mode.
if (config.has_lora && config.lora.use_preset) {
RadioInterface::bootstrapLoRaConfigFromPreset(config.lora);
RadioInterface::validateModemConfig(config.lora);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a rewrite of @thebentern checks, but using the tools we developed for this PR.

}

if (backupSecurity.private_key.size > 0) {
Expand Down
Loading
Loading