From 1e74d6fd4dfa26d4e3e4ff05a12acf59edd9b9bb Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 8 May 2025 15:48:55 +0200 Subject: [PATCH] Fix LoRa(Wan) response after config change --- tasmota/tasmota_xdrv_driver/xdrv_73_9_lora.ino | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_73_9_lora.ino b/tasmota/tasmota_xdrv_driver/xdrv_73_9_lora.ino index 370722075..50cab344c 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_73_9_lora.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_73_9_lora.ino @@ -449,9 +449,9 @@ void CmndLoraConfig(void) { // LoRaConfig {"SyncWord":18} - Enter decimal parameter (=0x12) if (XdrvMailbox.data_len > 0) { if (XdrvMailbox.payload > 0) { - uint32_t region = (XdrvMailbox.payload / 10) &0x0F; // 0 .. 15 - if (region > 9) { region = 0; } // 0 .. 9 - uint32_t option = ((XdrvMailbox.payload -1) &0x01) +1; // Option 1 or 2 + uint32_t region = (XdrvMailbox.payload / 10) &0x0F; // 0 .. 15 + if (region > 9) { region = 0; } // 0 .. 9 + uint32_t option = ((XdrvMailbox.payload -1) &0x01) +1; // Option 1 or 2 switch (option) { case 1: LoraDefaults(region); // Default region LoRa values @@ -484,6 +484,8 @@ void CmndLoraConfig(void) { Lora->Config(); } } + uint8_t data[1] = { 0 }; + LoraSend(data, 0, false); // Fix init SX12xx after config change } ResponseCmnd(); // {"LoRaConfig": ResponseAppend_P(PSTR("{"));