increase lora throughput and improve receiver display

This commit is contained in:
2026-02-01 20:09:44 +01:00
parent 876c572bb3
commit a0080b249d
2 changed files with 15 additions and 8 deletions

View File

@@ -49,7 +49,7 @@ constexpr uint8_t PIN_METER_RX = 34;
#define LORA_FREQUENCY_HZ 433E6 #define LORA_FREQUENCY_HZ 433E6
#endif #endif
constexpr long LORA_FREQUENCY = LORA_FREQUENCY_HZ; 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 long LORA_BANDWIDTH = 125E3;
constexpr uint8_t LORA_CODING_RATE = 5; constexpr uint8_t LORA_CODING_RATE = 5;
constexpr uint8_t LORA_SYNC_WORD = 0x34; constexpr uint8_t LORA_SYNC_WORD = 0x34;

View File

@@ -312,7 +312,15 @@ static void render_receiver_sender(uint8_t index) {
display.setCursor(0, 0); display.setCursor(0, 0);
uint8_t bat = status.has_data ? status.last_data.battery_percent : 0; uint8_t bat = status.has_data ? status.last_data.battery_percent : 0;
if (status.has_data) { 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 { } else {
display.printf("%s B--", status.last_data.device_id); 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.setCursor(0, 48);
display.printf("L2 %.0fW", status.last_data.phase_power_w[1]); display.printf("L2 %.0fW", status.last_data.phase_power_w[1]);
display.setCursor(0, 56); 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(); display.display();
} }
@@ -368,7 +372,10 @@ void display_tick() {
bool ctrl_high = digitalRead(PIN_OLED_CTRL) == HIGH; bool ctrl_high = digitalRead(PIN_OLED_CTRL) == HIGH;
bool in_boot_window = (millis() - g_boot_ms) < OLED_AUTO_OFF_MS; 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; g_oled_on = true;
} else { } else {
if (ctrl_high) { if (ctrl_high) {