From a0080b249d242527ee775f8b32bd54fbc8b07d40 Mon Sep 17 00:00:00 2001 From: acidburns Date: Sun, 1 Feb 2026 20:09:44 +0100 Subject: [PATCH] increase lora throughput and improve receiver display --- include/config.h | 2 +- src/display_ui.cpp | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/include/config.h b/include/config.h index 250e727..e977193 100644 --- a/include/config.h +++ b/include/config.h @@ -49,7 +49,7 @@ constexpr uint8_t PIN_METER_RX = 34; #define LORA_FREQUENCY_HZ 433E6 #endif constexpr long LORA_FREQUENCY = LORA_FREQUENCY_HZ; -constexpr uint8_t LORA_SPREADING_FACTOR = 12; +constexpr uint8_t LORA_SPREADING_FACTOR = 10; constexpr long LORA_BANDWIDTH = 125E3; constexpr uint8_t LORA_CODING_RATE = 5; constexpr uint8_t LORA_SYNC_WORD = 0x34; diff --git a/src/display_ui.cpp b/src/display_ui.cpp index 3df8ecc..ac5a013 100644 --- a/src/display_ui.cpp +++ b/src/display_ui.cpp @@ -312,7 +312,15 @@ static void render_receiver_sender(uint8_t index) { display.setCursor(0, 0); uint8_t bat = status.has_data ? status.last_data.battery_percent : 0; if (status.has_data) { - display.printf("%s B%u", status.last_data.device_id, bat); + const char *device_id = status.last_data.device_id; + if (strlen(device_id) >= 4 && strncmp(device_id, "dd3-", 4) == 0) { + device_id += 4; + } + if (status.last_data.link_valid) { + display.printf("%s R:%d S:%.1f", device_id, status.last_data.link_rssi_dbm, status.last_data.link_snr_db); + } else { + display.printf("%s B%u", device_id, bat); + } } else { display.printf("%s B--", status.last_data.device_id); } @@ -342,11 +350,7 @@ static void render_receiver_sender(uint8_t index) { display.setCursor(0, 48); display.printf("L2 %.0fW", status.last_data.phase_power_w[1]); display.setCursor(0, 56); - if (status.last_data.link_valid) { - display.printf("R:%d S:%.1f", status.last_data.link_rssi_dbm, status.last_data.link_snr_db); - } else { - display.printf("L3 %.0fW", status.last_data.phase_power_w[2]); - } + display.printf("L3 %.0fW", status.last_data.phase_power_w[2]); display.display(); } @@ -368,7 +372,10 @@ void display_tick() { bool ctrl_high = digitalRead(PIN_OLED_CTRL) == HIGH; bool in_boot_window = (millis() - g_boot_ms) < OLED_AUTO_OFF_MS; - if (in_boot_window) { + if (g_role == DeviceRole::Receiver) { + g_oled_on = true; + g_oled_off_start = 0; + } else if (in_boot_window) { g_oled_on = true; } else { if (ctrl_high) {