From e364b37173fbee82a17ebf9c507d2025d63dd280 Mon Sep 17 00:00:00 2001 From: 1technophile Date: Sun, 28 Apr 2019 16:24:36 +0200 Subject: [PATCH] add repeat function to LORA through mqtt --- ZgatewayLORA.ino | 4 ++++ config_LORA.h | 1 + 2 files changed, 5 insertions(+) diff --git a/ZgatewayLORA.ino b/ZgatewayLORA.ino index 70c8d9e..8ab0e2a 100644 --- a/ZgatewayLORA.ino +++ b/ZgatewayLORA.ino @@ -76,7 +76,11 @@ void LORAtoMQTT(){ LORAdata.set("packetSize", (int)packetSize); LORAdata.set("message", (char *)packet.c_str()); pub(subjectLORAtoMQTT,LORAdata); + if (repeatLORAwMQTT){ + trc(F("Pub LORA for rpt")); + pub(subjectMQTTtoLORA,LORAdata); } + } } #ifdef jsonReceiving diff --git a/config_LORA.h b/config_LORA.h index 343edf0..559dd1c 100644 --- a/config_LORA.h +++ b/config_LORA.h @@ -37,6 +37,7 @@ #define LORA_PREAMBLE_LENGTH 8 #define LORA_SYNC_WORD 0x12 +#define repeatLORAwMQTT false // do we repeat a received signal by using mqtt with LORA gateway /*-------------------PIN DEFINITIONS----------------------*/ //TTGO LORA BOARD ESP32 PIN DEFINITION