Compare commits

..

3 Commits

Author SHA1 Message Date
Thomas Göttgens
68f8f3219c add presets to onscreen menu for easy testing. 2025-11-19 22:31:18 +01:00
Thomas Göttgens
cd1cc032ed Add a new frequency range for EU SRD area with adaptive DC 2025-11-19 22:31:18 +01:00
github-actions[bot]
f9433a31d1 Automated version bumps (#8684)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2025-11-19 12:13:28 -06:00
20 changed files with 90 additions and 565 deletions

View File

@@ -87,6 +87,9 @@
</screenshots>
<releases>
<release version="2.7.16" date="2025-11-19">
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.16</url>
</release>
<release version="2.7.15" date="2025-11-13">
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.15</url>
</release>

6
debian/changelog vendored
View File

@@ -1,3 +1,9 @@
meshtasticd (2.7.16.0) unstable; urgency=medium
* Version 2.7.16
-- GitHub Actions <github-actions[bot]@users.noreply.github.com> Wed, 19 Nov 2025 16:12:32 +0000
meshtasticd (2.7.15.0) unstable; urgency=medium
* Version 2.7.15

View File

@@ -34,6 +34,9 @@ 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;
default:
return useShortName ? "Custom" : "Invalid";
break;

View File

@@ -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;
}
}

View File

@@ -103,44 +103,3 @@
#define FONT_HEIGHT_SMALL _fontHeight(FONT_SMALL)
#define FONT_HEIGHT_MEDIUM _fontHeight(FONT_MEDIUM)
#define FONT_HEIGHT_LARGE _fontHeight(FONT_LARGE)
// ============================================================================
// FINAL OVERRIDE: Force TomThumb font
// ============================================================================
#ifdef DISPLAY_FORCE_TOMTHUMB_FONT
#include "graphics/fonts/OLEDDisplayFontsTomThumb.h"
// -----------------------------
// Replace all Meshtastic fonts
// -----------------------------
#undef FONT_SMALL_LOCAL
#undef FONT_MEDIUM_LOCAL
#undef FONT_LARGE_LOCAL
#undef FONT_SMALL
#undef FONT_MEDIUM
#undef FONT_LARGE
#define FONT_SMALL_LOCAL TomThumb4x6
#define FONT_MEDIUM_LOCAL TomThumb4x6
#define FONT_LARGE_LOCAL TomThumb4x6
#define FONT_SMALL TomThumb4x6
#define FONT_MEDIUM TomThumb4x6
#define FONT_LARGE TomThumb4x6
// -------------------------------------------------------
// Override the *line height used for spacing*, NOT glyphs
// TomThumb is 6 px tall → we give it 11 px layout height
// -------------------------------------------------------
#undef FONT_HEIGHT_SMALL
#undef FONT_HEIGHT_MEDIUM
#undef FONT_HEIGHT_LARGE
#define FONT_HEIGHT_SMALL 6
#define FONT_HEIGHT_MEDIUM 6
#define FONT_HEIGHT_LARGE 6
#endif
// ============================================================================

View File

@@ -380,17 +380,6 @@ const int *getTextPositions(OLEDDisplay *display)
{
static int textPositions[7]; // Static array that persists beyond function scope
#ifdef DISPLAY_FORCE_TOMTHUMB_FONT
textPositions[0] = textZeroLine;
textPositions[1] = textFirstLine_tiny;
textPositions[2] = textSecondLine_tiny;
textPositions[3] = textThirdLine_tiny;
textPositions[4] = textFourthLine_tiny;
textPositions[5] = textFifthLine_tiny;
textPositions[6] = textSixthLine_tiny;
return textPositions;
#endif
if (isHighResolution) {
textPositions[0] = textZeroLine;
textPositions[1] = textFirstLine_medium;

View File

@@ -35,21 +35,6 @@ namespace graphics
#define textFifthLine_large (textFourthLine_large + (FONT_HEIGHT_SMALL + 5))
#define textSixthLine_large (textFifthLine_large + (FONT_HEIGHT_SMALL + 5))
// Tiny Font Spacing (TomThumb)
// Only active when DISPLAY_FORCE_TOMTHUMB_FONT is defined
#ifdef DISPLAY_FORCE_TOMTHUMB_FONT
#define TINY_REDUCE 5
#define textFirstLine_tiny (FONT_HEIGHT_SMALL + 1)
#define textSecondLine_tiny (textFirstLine_tiny + (FONT_HEIGHT_SMALL - TINY_REDUCE + 5))
#define textThirdLine_tiny (textSecondLine_tiny + (FONT_HEIGHT_SMALL - TINY_REDUCE + 5))
#define textFourthLine_tiny (textThirdLine_tiny + (FONT_HEIGHT_SMALL - TINY_REDUCE + 5))
#define textFifthLine_tiny (textFourthLine_tiny + (FONT_HEIGHT_SMALL - TINY_REDUCE + 5))
#define textSixthLine_tiny (textFifthLine_tiny + (FONT_HEIGHT_SMALL - TINY_REDUCE + 5))
#endif
// Quick screen access
#define SCREEN_WIDTH display->getWidth()
#define SCREEN_HEIGHT display->getHeight()

View File

@@ -102,7 +102,8 @@ void menuHandler::LoraRegionPicker(uint32_t duration)
"KZ_433",
"KZ_863",
"NP_865",
"BR_902"};
"BR_902",
"EU_866"};
BannerOverlayOptions bannerOptions;
#if defined(M5STACK_UNITC6L)
bannerOptions.message = "LoRa Region";
@@ -111,7 +112,7 @@ void menuHandler::LoraRegionPicker(uint32_t duration)
#endif
bannerOptions.durationMs = duration;
bannerOptions.optionsArrayPtr = optionsArray;
bannerOptions.optionsCount = 27;
bannerOptions.optionsCount = 28;
bannerOptions.InitialSelected = 0;
bannerOptions.bannerCallback = [](int selected) -> void {
if (selected != 0 && config.lora.region != _meshtastic_Config_LoRaConfig_RegionCode(selected)) {
@@ -141,7 +142,7 @@ void menuHandler::LoraRegionPicker(uint32_t duration)
}
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
}
@@ -194,8 +195,8 @@ void menuHandler::DeviceRolePicker()
void menuHandler::RadioPresetPicker()
{
static const char *optionsArray[] = {"Back", "LongSlow", "LongModerate", "LongFast", "MediumSlow",
"MediumFast", "ShortSlow", "ShortFast", "ShortTurbo"};
static const char *optionsArray[] = {"Back", "LongSlow", "LongModerate", "LongFast", "MediumSlow",
"MediumFast", "ShortSlow", "ShortFast", "ShortTurbo", "LiteFast"};
enum optionsNumbers {
Back = 0,
radiopreset_LongSlow = 1,
@@ -205,12 +206,13 @@ void menuHandler::RadioPresetPicker()
radiopreset_MediumFast = 5,
radiopreset_ShortSlow = 6,
radiopreset_ShortFast = 7,
radiopreset_ShortTurbo = 8
radiopreset_ShortTurbo = 8,
radiopreset_LiteFast = 9
};
BannerOverlayOptions bannerOptions;
bannerOptions.message = "Radio Preset";
bannerOptions.optionsArrayPtr = optionsArray;
bannerOptions.optionsCount = 9;
bannerOptions.optionsCount = 10;
bannerOptions.bannerCallback = [](int selected) -> void {
if (selected == Back) {
menuHandler::menuQueue = menuHandler::lora_Menu;
@@ -232,6 +234,8 @@ void menuHandler::RadioPresetPicker()
config.lora.modem_preset = meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST;
} else if (selected == radiopreset_ShortTurbo) {
config.lora.modem_preset = meshtastic_Config_LoRaConfig_ModemPreset_SHORT_TURBO;
} else if (selected == radiopreset_LiteFast) {
config.lora.modem_preset = meshtastic_Config_LoRaConfig_ModemPreset_LITE_FAST;
}
service->reloadConfig(SEGMENT_CONFIG);
rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000);

View File

@@ -24,11 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "configuration.h"
#if HAS_SCREEN
#include "MessageRenderer.h"
#ifdef DISPLAY_FORCE_TOMTHUMB_FONT
#define MESSAGE_TINY_Y_OFFSET -3
#else
#define MESSAGE_TINY_Y_OFFSET 0
#endif
// Core includes
#include "NodeDB.h"
#include "configuration.h"

View File

@@ -424,11 +424,7 @@ void drawNodeListScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t
EntryRenderer renderer, NodeExtrasRenderer extras, float heading, double lat, double lon)
{
const int COMMON_HEADER_HEIGHT = FONT_HEIGHT_SMALL - 1;
int rowYOffset = FONT_HEIGHT_SMALL - 3;
#ifdef DISPLAY_FORCE_TOMTHUMB_FONT
rowYOffset += 4;
#endif
const int rowYOffset = FONT_HEIGHT_SMALL - 3;
bool locationScreen = false;
if (strcmp(title, "Bearings") == 0)
@@ -447,9 +443,6 @@ void drawNodeListScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t
// Space below header
y += COMMON_HEADER_HEIGHT;
#ifdef DISPLAY_FORCE_TOMTHUMB_FONT
y += 2; // Push entire list down by 2 pixels for TomThumb
#endif
int totalEntries = nodeDB->getNumMeshNodes();
int totalRowsAvailable = (display->getHeight() - y) / rowYOffset;

View File

@@ -278,9 +278,6 @@ void NotificationRenderer::drawNodePicker(OLEDDisplay *display, OLEDDisplayUiSta
uint16_t totalLines = lineCount + alertBannerOptions;
uint16_t screenHeight = display->height();
uint8_t effectiveLineHeight = FONT_HEIGHT_SMALL - 3;
#ifdef DISPLAY_FORCE_TOMTHUMB_FONT
effectiveLineHeight = FONT_HEIGHT_SMALL + 2;
#endif
uint8_t visibleTotalLines = std::min<uint8_t>(totalLines, (screenHeight - vPadding * 2) / effectiveLineHeight);
uint8_t linesShown = lineCount;
const char *linePointers[visibleTotalLines + 1] = {0}; // this is sort of a dynamic allocation
@@ -411,9 +408,6 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp
uint16_t screenHeight = display->height();
uint8_t effectiveLineHeight = FONT_HEIGHT_SMALL - 3;
#ifdef DISPLAY_FORCE_TOMTHUMB_FONT
effectiveLineHeight = FONT_HEIGHT_SMALL + 2;
#endif
uint8_t visibleTotalLines = std::min<uint8_t>(totalLines, (screenHeight - vPadding * 2) / effectiveLineHeight);
uint8_t linesShown = lineCount;
const char *linePointers[visibleTotalLines + 1] = {0}; // this is sort of a dynamic allocation
@@ -639,9 +633,6 @@ void NotificationRenderer::drawNotificationBox(OLEDDisplay *display, OLEDDisplay
uint16_t screenHeight = display->height();
uint8_t effectiveLineHeight = FONT_HEIGHT_SMALL - 3;
#ifdef DISPLAY_FORCE_TOMTHUMB_FONT
effectiveLineHeight = FONT_HEIGHT_SMALL + 2;
#endif
uint8_t visibleTotalLines = std::min<uint8_t>(lineCount, (screenHeight - vPadding * 2) / effectiveLineHeight);
uint16_t contentHeight = visibleTotalLines * effectiveLineHeight;
uint16_t boxHeight = contentHeight + vPadding * 2;
@@ -673,9 +664,6 @@ void NotificationRenderer::drawNotificationBox(OLEDDisplay *display, OLEDDisplay
// === Draw Content ===
int16_t lineY = boxTop + vPadding;
#ifdef DISPLAY_FORCE_TOMTHUMB_FONT
lineY += 2; // Offset entire options list downward
#endif
for (int i = 0; i < lineCount; i++) {
int16_t textX = boxLeft + (boxWidth - lineWidths[i]) / 2;
if (needs_bell && i == 0) {

View File

@@ -1,410 +0,0 @@
#include "OLEDDisplayFontsTomThumb.h"
const uint8_t TomThumb4x6[] PROGMEM = {
0x05, // heightMinus1 = 5 → height = 6
0x04, // width (unused by Meshtastic, but must exist)
0x20, // first char
0xBD, // last char
// Jump Table:
0xFF, 0xFF, 0x00, 0x04, // space (advance 3->4)
0x00, 0x00, 0x02, 0x04, // exclam (advance 3->4)
0x00, 0x02, 0x03, 0x04, // quotedbl (advance 3->4)
0x00, 0x05, 0x03, 0x04, // numbersign (advance 3->4)
0x00, 0x08, 0x03, 0x04, // dollar (advance 3->4)
0x00, 0x0B, 0x03, 0x04, // percent (advance 3->4)
0x00, 0x0E, 0x03, 0x04, // ampersand (advance 3->4)
0x00, 0x11, 0x02, 0x04, // quotesingle (advance 3->4)
0x00, 0x13, 0x03, 0x04, // parenleft (advance 3->4)
0x00, 0x16, 0x02, 0x04, // parenright (advance 3->4)
0x00, 0x18, 0x03, 0x04, // asterisk (advance 3->4)
0x00, 0x1B, 0x03, 0x04, // plus (advance 3->4)
0x00, 0x1E, 0x02, 0x04, // comma (advance 3->4)
0x00, 0x20, 0x03, 0x04, // hyphen (advance 3->4)
0x00, 0x23, 0x02, 0x04, // period (advance 3->4)
0x00, 0x25, 0x03, 0x04, // slash (advance 3->4)
0x00, 0x28, 0x03, 0x04, // zero (advance 3->4)
0x00, 0x2B, 0x02, 0x04, // one (advance 3->4)
0x00, 0x2D, 0x03, 0x04, // two (advance 3->4)
0x00, 0x30, 0x03, 0x04, // three (advance 3->4)
0x00, 0x33, 0x03, 0x04, // four (advance 3->4)
0x00, 0x36, 0x03, 0x04, // five (advance 3->4)
0x00, 0x39, 0x03, 0x04, // six (advance 3->4)
0x00, 0x3C, 0x03, 0x04, // seven (advance 3->4)
0x00, 0x3F, 0x03, 0x04, // eight (advance 3->4)
0x00, 0x42, 0x03, 0x04, // nine (advance 3->4)
0x00, 0x45, 0x02, 0x04, // colon (advance 3->4)
0x00, 0x47, 0x02, 0x04, // semicolon (advance 3->4)
0x00, 0x49, 0x03, 0x04, // less (advance 3->4)
0x00, 0x4C, 0x03, 0x04, // equal (advance 3->4)
0x00, 0x4F, 0x03, 0x04, // greater (advance 3->4)
0x00, 0x52, 0x03, 0x04, // question (advance 3->4)
0x00, 0x55, 0x03, 0x04, // at (advance 3->4)
0x00, 0x58, 0x03, 0x04, // A (advance 3->4)
0x00, 0x5B, 0x03, 0x04, // B (advance 3->4)
0x00, 0x5E, 0x03, 0x04, // C (advance 3->4)
0x00, 0x61, 0x03, 0x04, // D (advance 3->4)
0x00, 0x64, 0x03, 0x04, // E (advance 3->4)
0x00, 0x67, 0x03, 0x04, // F (advance 3->4)
0x00, 0x6A, 0x03, 0x04, // G (advance 3->4)
0x00, 0x6D, 0x03, 0x04, // H (advance 3->4)
0x00, 0x70, 0x03, 0x04, // I (advance 3->4)
0x00, 0x73, 0x03, 0x04, // J (advance 3->4)
0x00, 0x76, 0x03, 0x04, // K (advance 3->4)
0x00, 0x79, 0x03, 0x04, // L (advance 3->4)
0x00, 0x7C, 0x03, 0x04, // M (advance 3->4)
0x00, 0x7F, 0x03, 0x04, // N (advance 3->4)
0x00, 0x82, 0x03, 0x04, // O (advance 3->4)
0x00, 0x85, 0x03, 0x04, // P (advance 3->4)
0x00, 0x88, 0x03, 0x04, // Q (advance 3->4)
0x00, 0x8B, 0x03, 0x04, // R (advance 3->4)
0x00, 0x8E, 0x03, 0x04, // S (advance 3->4)
0x00, 0x91, 0x03, 0x04, // T (advance 3->4)
0x00, 0x94, 0x03, 0x04, // U (advance 3->4)
0x00, 0x97, 0x03, 0x04, // V (advance 3->4)
0x00, 0x9A, 0x03, 0x04, // W (advance 3->4)
0x00, 0x9D, 0x03, 0x04, // X (advance 3->4)
0x00, 0xA0, 0x03, 0x04, // Y (advance 3->4)
0x00, 0xA3, 0x03, 0x04, // Z (advance 3->4)
0x00, 0xA6, 0x03, 0x04, // bracketleft (advance 3->4)
0x00, 0xA9, 0x03, 0x04, // backslash (advance 3->4)
0x00, 0xAC, 0x03, 0x04, // bracketright (advance 3->4)
0x00, 0xAF, 0x03, 0x04, // asciicircum (advance 3->4)
0x00, 0xB2, 0x03, 0x04, // underscore (advance 3->4)
0x00, 0xB5, 0x02, 0x04, // grave (advance 3->4)
0x00, 0xB7, 0x03, 0x04, // a (advance 3->4)
0x00, 0xBA, 0x03, 0x04, // b (advance 3->4)
0x00, 0xBD, 0x03, 0x04, // c (advance 3->4)
0x00, 0xC0, 0x03, 0x04, // d (advance 3->4)
0x00, 0xC3, 0x03, 0x04, // e (advance 3->4)
0x00, 0xC6, 0x03, 0x04, // f (advance 3->4)
0x00, 0xC9, 0x03, 0x04, // g (advance 3->4)
0x00, 0xCC, 0x03, 0x04, // h (advance 3->4)
0x00, 0xCF, 0x02, 0x04, // i (advance 3->4)
0x00, 0xD1, 0x03, 0x04, // j (advance 3->4)
0x00, 0xD4, 0x03, 0x04, // k (advance 3->4)
0x00, 0xD7, 0x03, 0x04, // l (advance 3->4)
0x00, 0xDA, 0x03, 0x04, // m (advance 3->4)
0x00, 0xDD, 0x03, 0x04, // n (advance 3->4)
0x00, 0xE0, 0x03, 0x04, // o (advance 3->4)
0x00, 0xE3, 0x03, 0x04, // p (advance 3->4)
0x00, 0xE6, 0x03, 0x04, // q (advance 3->4)
0x00, 0xE9, 0x03, 0x04, // r (advance 3->4)
0x00, 0xEC, 0x03, 0x04, // s (advance 3->4)
0x00, 0xEF, 0x03, 0x04, // t (advance 3->4)
0x00, 0xF2, 0x03, 0x04, // u (advance 3->4)
0x00, 0xF5, 0x03, 0x04, // v (advance 3->4)
0x00, 0xF8, 0x03, 0x04, // w (advance 3->4)
0x00, 0xFB, 0x03, 0x04, // x (advance 3->4)
0x00, 0xFE, 0x03, 0x04, // y (advance 3->4)
0x01, 0x01, 0x03, 0x04, // z (advance 3->4)
0x01, 0x04, 0x03, 0x04, // braceleft (advance 3->4)
0x01, 0x07, 0x02, 0x04, // bar (advance 3->4)
0x01, 0x09, 0x03, 0x04, // braceright (advance 3->4)
0x01, 0x0C, 0x03, 0x04, // asciitilde (advance 3->4)
0x01, 0x0F, 0x02, 0x04, // exclamdown (advance 3->4)
0x01, 0x11, 0x03, 0x04, // cent
0x01, 0x14, 0x03, 0x04, // sterling
0x01, 0x17, 0x03, 0x04, // currency
0x01, 0x1A, 0x03, 0x04, // yen
0x01, 0x1D, 0x02, 0x04, // brokenbar
0x01, 0x1F, 0x03, 0x04, // section
0x01, 0x22, 0x03, 0x04, // dieresis
0x01, 0x25, 0x03, 0x04, // copyright
0x01, 0x28, 0x03, 0x04, // ordfeminine
0x01, 0x2B, 0x02, 0x04, // guillemotleft
0x01, 0x2D, 0x03, 0x04, // logicalnot
0x01, 0x30, 0x02, 0x04, // softhyphen
0x01, 0x32, 0x03, 0x04, // registered
0x01, 0x35, 0x03, 0x04, // macron
0x01, 0x38, 0x03, 0x04, // degree
0x01, 0x3B, 0x03, 0x04, // plusminus
0x01, 0x3E, 0x03, 0x04, // twosuperior
0x01, 0x41, 0x03, 0x04, // threesuperior
0x01, 0x44, 0x03, 0x04, // acute
0x01, 0x47, 0x03, 0x04, // mu
0x01, 0x4A, 0x03, 0x04, // paragraph
0x01, 0x4D, 0x03, 0x04, // periodcentered
0x01, 0x50, 0x03, 0x04, // cedilla
0x01, 0x53, 0x02, 0x04, // onesuperior
0x01, 0x55, 0x03, 0x04, // ordmasculine
0x01, 0x58, 0x03, 0x04, // guillemotright
0x01, 0x5B, 0x03, 0x04, // onequarter
0x01, 0x5E, 0x03, 0x04, // onehalf
0x01, 0x61, 0x03, 0x04, // threequarters
0x01, 0x64, 0x03, 0x04, // questiondown
0x01, 0x67, 0x03, 0x04, // Agrave
0x01, 0x6A, 0x03, 0x04, // Aacute
0x01, 0x6D, 0x03, 0x04, // Acircumflex
0x01, 0x70, 0x03, 0x04, // Atilde
0x01, 0x73, 0x03, 0x04, // Adieresis
0x01, 0x76, 0x03, 0x04, // Aring
0x01, 0x79, 0x03, 0x04, // AE
0x01, 0x7C, 0x03, 0x04, // Ccedilla
0x01, 0x7F, 0x03, 0x04, // Egrave
0x01, 0x82, 0x03, 0x04, // Eacute
0x01, 0x85, 0x03, 0x04, // Ecircumflex
0x01, 0x88, 0x03, 0x04, // Edieresis
0x01, 0x8B, 0x03, 0x04, // Igrave
0x01, 0x8E, 0x03, 0x04, // Iacute
0x01, 0x91, 0x03, 0x04, // Icircumflex
0x01, 0x94, 0x03, 0x04, // Idieresis
0x01, 0x97, 0x03, 0x04, // Eth
0x01, 0x9A, 0x03, 0x04, // Ntilde
0x01, 0x9D, 0x03, 0x04, // Ograve
0x01, 0xA0, 0x03, 0x04, // Oacute
0x01, 0xA3, 0x03, 0x04, // Ocircumflex
0x01, 0xA6, 0x03, 0x04, // Otilde
0x01, 0xA9, 0x03, 0x04, // Odieresis
0x01, 0xAC, 0x03, 0x04, // multiply
0x01, 0xAF, 0x03, 0x04, // Oslash
0x01, 0xB2, 0x03, 0x04, // Ugrave
0x01, 0xB5, 0x03, 0x04, // Uacute
0x01, 0xB8, 0x03, 0x04, // Ucircumflex
0x01, 0xBB, 0x03, 0x04, // Udieresis
0x01, 0xBE, 0x03, 0x04, // Yacute
0x01, 0xC1, 0x03, 0x04, // Thorn
0x01, 0xC4, 0x03, 0x04, // germandbls
0x01, 0xC7, 0x03, 0x04, // agrave
0x01, 0xCA, 0x03, 0x04, // aacute
0x01, 0xCD, 0x03, 0x04, // acircumflex
0x01, 0xD0, 0x03, 0x04, // atilde
0x01, 0xD3, 0x03, 0x04, // adieresis
0x01, 0xD6, 0x03, 0x04, // aring
0x01, 0xD9, 0x03, 0x04, // ae
0x01, 0xDC, 0x03, 0x04, // ccedilla
0x01, 0xDF, 0x03, 0x04, // egrave
0x01, 0xE2, 0x03, 0x04, // eacute
0x01, 0xE5, 0x03, 0x04, // ecircumflex
0x01, 0xE8, 0x03, 0x04, // edieresis
0x01, 0xEB, 0x03, 0x04, // igrave
0x01, 0xEE, 0x02, 0x04, // iacute
0x01, 0xF0, 0x03, 0x04, // icircumflex
0x01, 0xF3, 0x03, 0x04, // idieresis
0x01, 0xF6, 0x03, 0x04, // eth
0x01, 0xF9, 0x03, 0x04, // ntilde
0x01, 0xFC, 0x03, 0x04, // ograve
0x01, 0xFF, 0x03, 0x04, // oacute
0x02, 0x02, 0x03, 0x04, // ocircumflex
0x02, 0x05, 0x03, 0x04, // otilde
0x02, 0x08, 0x03, 0x04, // odieresis
0x02, 0x0B, 0x03, 0x04, // divide
0x02, 0x0E, 0x03, 0x04, // oslash
0x02, 0x11, 0x03, 0x04, // ugrave
0x02, 0x14, 0x03, 0x04, // uacute
0x02, 0x17, 0x03, 0x04, // ucircumflex
0x02, 0x1A, 0x03, 0x04, // udieresis
0x02, 0x1D, 0x03, 0x04, // yacute
0x02, 0x20, 0x03, 0x04, // thorn
// =================
// Font Bitmap Data:
// =================
0x00, 0x17, // exclam
0x03, 0x00, 0x04, // quotedbl
0x1F, 0x0A, 0x1F, // numbersign
0x0A, 0x1F, 0x05, // dollar
0x09, 0x04, 0x12, // percent
0x0F, 0x17, 0x1C, // ampersand
0x00, 0x04, // quotesingle
0x00, 0x0E, 0x11, // parenleft
0x11, 0x0E, // parenright
0x05, 0x02, 0x05, // asterisk
0x04, 0x0E, 0x04, // plus
0x10, 0x08, // comma
0x04, 0x04, 0x04, // hyphen
0x00, 0x10, // period
0x18, 0x04, 0x04, // slash
0x1E, 0x11, 0x0F, // zero
0x02, 0x1F, // one
0x19, 0x15, 0x12, // two
0x11, 0x15, 0x0A, // three
0x07, 0x04, 0x1F, // four
0x17, 0x15, 0x09, // five
0x1E, 0x15, 0x1D, // six
0x19, 0x05, 0x04, // seven
0x1F, 0x15, 0x1F, // eight
0x17, 0x15, 0x0F, // nine
0x00, 0x0A, // colon
0x10, 0x0A, // semicolon
0x04, 0x0A, 0x11, // less
0x0A, 0x0A, 0x0A, // equal
0x11, 0x0A, 0x04, // greater
0x01, 0x15, 0x04, // question
0x0E, 0x15, 0x16, // at
0x1E, 0x05, 0x1E, // A
0x1F, 0x15, 0x0A, // B
0x0E, 0x11, 0x11, // C
0x1F, 0x11, 0x0E, // D
0x1F, 0x15, 0x15, // E
0x1F, 0x05, 0x05, // F
0x0E, 0x15, 0x1D, // G
0x1F, 0x04, 0x1F, // H
0x11, 0x1F, 0x11, // I
0x08, 0x10, 0x0F, // J
0x1F, 0x04, 0x1B, // K
0x1F, 0x10, 0x10, // L
0x1F, 0x06, 0x1F, // M
0x1F, 0x0E, 0x1F, // N
0x0E, 0x11, 0x0E, // O
0x1F, 0x05, 0x02, // P
0x0E, 0x19, 0x1E, // Q
0x1F, 0x0D, 0x16, // R
0x12, 0x15, 0x09, // S
0x01, 0x1F, 0x01, // T
0x0F, 0x10, 0x1F, // U
0x07, 0x18, 0x07, // V
0x1F, 0x0C, 0x1F, // W
0x1B, 0x04, 0x1B, // X
0x03, 0x1C, 0x04, // Y
0x19, 0x15, 0x13, // Z
0x1F, 0x11, 0x11, // bracketleft
0x02, 0x04, 0x08, // backslash
0x11, 0x11, 0x1F, // bracketright
0x02, 0x01, 0x02, // asciicircum
0x10, 0x10, 0x10, // underscore
0x01, 0x02, // grave
0x1A, 0x16, 0x1C, // a
0x1F, 0x12, 0x0C, // b
0x0C, 0x12, 0x12, // c
0x0C, 0x12, 0x1F, // d
0x0C, 0x1A, 0x16, // e
0x04, 0x1E, 0x05, // f
0x0C, 0x2A, 0x1E, // g
0x1F, 0x02, 0x1C, // h
0x00, 0x1D, // i
0x10, 0x20, 0x1D, // j
0x1F, 0x0C, 0x12, // k
0x11, 0x1F, 0x10, // l
0x1E, 0x0E, 0x1E, // m
0x1E, 0x02, 0x1C, // n
0x0C, 0x12, 0x0C, // o
0x3E, 0x12, 0x0C, // p
0x0C, 0x12, 0x3E, // q
0x1C, 0x02, 0x02, // r
0x14, 0x1E, 0x0A, // s
0x02, 0x1F, 0x12, // t
0x0E, 0x10, 0x1E, // u
0x0E, 0x18, 0x0E, // v
0x1E, 0x1C, 0x1E, // w
0x12, 0x0C, 0x12, // x
0x06, 0x28, 0x1E, // y
0x1A, 0x1E, 0x16, // z
0x04, 0x1B, 0x11, // braceleft
0x00, 0x1B, // bar
0x11, 0x1B, 0x04, // braceright
0x02, 0x03, 0x01, // asciitilde
0x00, 0x1D, // exclamdown
0x0E, 0x1B, 0x0A, // cent
0x14, 0x1F, 0x15, // sterling
0x15, 0x0E, 0x15, // currency
0x0B, 0x1C, 0x0B, // yen
0x00, 0x1B, // brokenbar
0x14, 0x1B, 0x05, // section
0x01, 0x00, 0x01, // dieresis
0x02, 0x05, 0x05, // copyright
0x16, 0x15, 0x17, // ordfeminine
0x02, 0x05, // guillemotleft
0x02, 0x02, 0x06, // logicalnot
0x04, 0x04, // softhyphen
0x07, 0x03, 0x04, // registered
0x01, 0x01, 0x01, // macron
0x02, 0x05, 0x02, // degree
0x12, 0x17, 0x12, // plusminus
0x01, 0x07, 0x04, // twosuperior
0x05, 0x07, 0x07, // threesuperior
0x00, 0x02, 0x01, // acute
0x1F, 0x08, 0x07, // mu
0x02, 0x1D, 0x1F, // paragraph
0x0E, 0x0E, 0x0E, // periodcentered
0x10, 0x14, 0x08, // cedilla
0x00, 0x07, // onesuperior
0x12, 0x15, 0x12, // ordmasculine
0x00, 0x05, 0x02, // guillemotright
0x03, 0x08, 0x18, // onequarter
0x0B, 0x18, 0x10, // onehalf
0x03, 0x0B, 0x18, // threequarters
0x18, 0x15, 0x10, // questiondown
0x18, 0x0D, 0x1A, // Agrave
0x1A, 0x0D, 0x18, // Aacute
0x19, 0x0D, 0x19, // Acircumflex
0x1A, 0x0F, 0x19, // Atilde
0x1D, 0x0A, 0x1D, // Adieresis
0x1F, 0x0B, 0x1C, // Aring
0x1E, 0x1F, 0x15, // AE
0x06, 0x29, 0x19, // Ccedilla
0x1C, 0x1D, 0x16, // Egrave
0x1E, 0x1D, 0x14, // Eacute
0x1D, 0x1D, 0x15, // Ecircumflex
0x1D, 0x1C, 0x15, // Edieresis
0x14, 0x1D, 0x16, // Igrave
0x16, 0x1D, 0x14, // Iacute
0x15, 0x1D, 0x15, // Icircumflex
0x15, 0x1C, 0x15, // Idieresis
0x1F, 0x15, 0x0E, // Eth
0x1D, 0x0B, 0x1E, // Ntilde
0x1C, 0x15, 0x1E, // Ograve
0x1E, 0x15, 0x1C, // Oacute
0x1D, 0x15, 0x1D, // Ocircumflex
0x1D, 0x17, 0x1E, // Otilde
0x1D, 0x14, 0x1D, // Odieresis
0x0A, 0x04, 0x0A, // multiply
0x1E, 0x15, 0x0F, // Oslash
0x1D, 0x12, 0x1C, // Ugrave
0x1C, 0x12, 0x1D, // Uacute
0x1D, 0x11, 0x1D, // Ucircumflex
0x1D, 0x10, 0x1D, // Udieresis
0x0C, 0x1A, 0x0D, // Yacute
0x1F, 0x0A, 0x0E, // Thorn
0x3E, 0x15, 0x0B, // germandbls
0x18, 0x15, 0x1E, // agrave
0x1A, 0x15, 0x1C, // aacute
0x19, 0x15, 0x1D, // acircumflex
0x1A, 0x17, 0x1D, // atilde
0x19, 0x14, 0x1D, // adieresis
0x18, 0x17, 0x1F, // aring
0x1C, 0x1E, 0x0E, // ae
0x04, 0x2A, 0x1A, // ccedilla
0x08, 0x1D, 0x1E, // egrave
0x0A, 0x1D, 0x1C, // eacute
0x09, 0x1D, 0x1D, // ecircumflex
0x09, 0x1C, 0x1D, // edieresis
0x00, 0x1D, 0x02, // igrave
0x02, 0x1D, // iacute
0x01, 0x1D, 0x01, // icircumflex
0x01, 0x1C, 0x01, // idieresis
0x0A, 0x17, 0x1D, // eth
0x1D, 0x07, 0x1A, // ntilde
0x08, 0x15, 0x0A, // ograve
0x0A, 0x15, 0x08, // oacute
0x09, 0x15, 0x09, // ocircumflex
0x09, 0x17, 0x0A, // otilde
0x09, 0x14, 0x09, // odieresis
0x04, 0x15, 0x04, // divide
0x1C, 0x16, 0x0E, // oslash
0x0D, 0x12, 0x1C, // ugrave
0x0C, 0x12, 0x1D, // uacute
0x0D, 0x11, 0x1D, // ucircumflex
0x0D, 0x10, 0x1D, // udieresis
0x04, 0x2A, 0x1D, // yacute
0x3E, 0x14, 0x08 // thorn
};
// ============================================================================
// FONT_INFO wrapper required by Meshtastic
// ============================================================================
//
// NOTE:
// Meshtastic OLED renderer does *not* use the FONT_CHAR_INFO jump table when
// the font uses the raw-array jump table format. But this struct MUST exist.
//
static const FONT_CHAR_INFO TomThumb4x6_CharInfo[] PROGMEM = {};
// ============================================================================
// Final FONT_INFO Export
// ============================================================================
const FONT_INFO TomThumb4x6_Info = {.heightBits = 6, // REAL glyph height
.baseline = 4, // Correct baseline for 6px font
.startChar = 0x20,
.endChar = 0xBD,
.charInfo = TomThumb4x6_CharInfo,
.data = TomThumb4x6};

View File

@@ -1,32 +0,0 @@
#pragma once
#include <Arduino.h>
#ifdef __cplusplus
extern "C" {
#endif
// Information about a single character
typedef struct {
uint8_t widthBits; // Glyph width in bits
uint16_t offset; // Offset into the bitmap table
} FONT_CHAR_INFO;
// Information about the whole font
typedef struct {
uint8_t heightBits; // Character height in pixels (6px)
uint8_t baseline; // baseline (height-1) = 5
uint8_t startChar; // First supported char = 0x20
uint8_t endChar; // Last supported char = 0xBD
const FONT_CHAR_INFO *charInfo; // Jump table
const uint8_t *data; // Bitmap table
} FONT_INFO;
// Raw PROGMEM font data (jump table + bitmap stream)
extern const uint8_t TomThumb4x6[] PROGMEM;
// Wrapper combining the tables so OLED code can use it
extern const FONT_INFO TomThumb4x6_Info;
#ifdef __cplusplus
}
#endif

View File

@@ -22,4 +22,11 @@ struct RegionInfo {
extern const RegionInfo regions[];
extern const RegionInfo *myRegion;
extern void initRegion();
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();

View File

@@ -187,6 +187,13 @@ const RegionInfo regions[] = {
*/
RDEF(BR_902, 902.0f, 907.5f, 100, 0, 30, true, false, false),
/*
EU 866MHz RFID band (ETSI EN 302 208): 4 channels at 865.7/866.3/866.9/867.5 MHz
475 kHz gap between channels, 27 dBm, duty cycle 2.5% (mobile) or 10% (fixed)
https://www.etsi.org/deliver/etsi_en/302200_302299/302208/03.04.01_60/en_302208v030401p.pdf
*/
RDEF(EU_866, 865.6375f, 867.5625f, 2.5, 0.475, 27, true, false, false),
/*
2.4 GHZ WLAN Band equivalent. Only for SX128x chips.
*/
@@ -219,6 +226,23 @@ void initRegion()
myRegion = r;
}
/**
* Get duty cycle for current region. EU_866: 10% for routers, 2.5% for mobile.
*/
float getEffectiveDutyCycle()
{
if (myRegion->code == meshtastic_Config_LoRaConfig_RegionCode_EU_866) {
if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ||
config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_LATE) {
return 10.0f;
} else {
return 2.5f;
}
}
// For all other regions, return the standard duty cycle
return myRegion->dutyCycle;
}
/**
* ## LoRaWAN for North America
@@ -518,6 +542,11 @@ void RadioInterface::applyModemConfig()
cr = 8;
sf = 12;
break;
case meshtastic_Config_LoRaConfig_ModemPreset_LITE_FAST:
bw = 125;
cr = 5;
sf = 9;
break;
}
} else {
sf = loraConfig.spread_factor;
@@ -551,6 +580,19 @@ void RadioInterface::applyModemConfig()
// Set to default modem preset
loraConfig.use_preset = true;
loraConfig.modem_preset = meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST;
} else if (myRegion->code == meshtastic_Config_LoRaConfig_RegionCode_EU_866 && bw != 125) {
static const char *err_string = "EU_866 requires 125kHz bandwidth. Fall back to LiteFast preset";
LOG_ERROR(err_string);
RECORD_CRITICALERROR(meshtastic_CriticalErrorCode_INVALID_RADIO_SETTING);
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
cn->level = meshtastic_LogRecord_Level_ERROR;
sprintf(cn->message, err_string);
service->sendClientNotification(cn);
// Set to LiteFast preset which is compliant
loraConfig.use_preset = true;
loraConfig.modem_preset = meshtastic_Config_LoRaConfig_ModemPreset_LITE_FAST;
} else {
validConfig = true;
}
@@ -569,8 +611,9 @@ void RadioInterface::applyModemConfig()
// Set final tx_power back onto config
loraConfig.tx_power = (int8_t)power; // cppcheck-suppress assignmentAddressToInteger
// Calculate the number of channels
uint32_t numChannels = floor((myRegion->freqEnd - myRegion->freqStart) / (myRegion->spacing + (bw / 1000)));
// Calculate number of channels: spacing = gap between channels (0 for continuous spectrum)
float channelSpacing = myRegion->spacing + (bw / 1000);
uint32_t numChannels = round((myRegion->freqEnd - myRegion->freqStart + myRegion->spacing) / channelSpacing);
// If user has manually specified a channel num, then use that, otherwise generate one by hashing the name
const char *channelName = channels.getName(channels.getPrimaryIndex());
@@ -582,11 +625,8 @@ void RadioInterface::applyModemConfig()
channel_num ==
hash(DisplayFormatters::getModemPresetDisplayName(config.lora.modem_preset, false, config.lora.use_preset)) % numChannels;
// Old frequency selection formula
// float freq = myRegion->freqStart + ((((myRegion->freqEnd - myRegion->freqStart) / numChannels) / 2) * channel_num);
// New frequency selection formula
float freq = myRegion->freqStart + (bw / 2000) + (channel_num * (bw / 1000));
// Calculate frequency: freqStart is band edge, add half bandwidth to get first channel center
float freq = myRegion->freqStart + (bw / 2000) + (channel_num * channelSpacing);
// override if we have a verbatim frequency
if (loraConfig.override_frequency) {

View File

@@ -294,10 +294,11 @@ ErrorCode Router::send(meshtastic_MeshPacket *p)
} // should have already been handled by sendLocal
// Abort sending if we are violating the duty cycle
if (!config.lora.override_duty_cycle && myRegion->dutyCycle < 100) {
float effectiveDutyCycle = getEffectiveDutyCycle();
if (!config.lora.override_duty_cycle && effectiveDutyCycle < 100) {
float hourlyTxPercent = airTime->utilizationTXPercent();
if (hourlyTxPercent > myRegion->dutyCycle) {
uint8_t silentMinutes = airTime->getSilentMinutes(hourlyTxPercent, myRegion->dutyCycle);
if (hourlyTxPercent > effectiveDutyCycle) {
uint8_t silentMinutes = airTime->getSilentMinutes(hourlyTxPercent, effectiveDutyCycle);
LOG_WARN("Duty cycle limit exceeded. Aborting send for now, you can send again in %d mins", silentMinutes);

View File

@@ -793,7 +793,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
}
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
}
// Compare the entire string, we are sure of the length as a topic has never been set

View File

@@ -1,8 +1,6 @@
#define LED_PIN LED
#define USE_SSD1306 // Heltec_v3 has a SSD1306 display
#define DISPLAY_FORCE_SMALL_FONTS
#define DISPLAY_FORCE_TOMTHUMB_FONT
#define RESET_OLED RST_OLED
#define I2C_SDA SDA_OLED // I2C pins for this board

View File

@@ -7,12 +7,6 @@
#define VARIANT_MCK (64000000ul) // Master clock frequency
#define USE_LFXO // 32.768kHz crystal for LFCLK
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// Sample size change
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#define DISPLAY_FORCE_SMALL_FONTS
#define DISPLAY_FORCE_TOMTHUMB_FONT
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// Pin Capacity Definitions
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

View File

@@ -1,4 +1,4 @@
[VERSION]
major = 2
minor = 7
build = 15
build = 16