From b0e7a4c92ed4a8b8f2c53468418aef7fb3e7fd60 Mon Sep 17 00:00:00 2001 From: nikito7 <45373783+nikito7@users.noreply.github.com> Date: Mon, 10 Jul 2023 01:09:01 +0100 Subject: [PATCH 1/2] LoRa ESP8266 fix --- main/ZgatewayLORA.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main/ZgatewayLORA.ino b/main/ZgatewayLORA.ino index a1a8f88b97..e9ea30c643 100644 --- a/main/ZgatewayLORA.ino +++ b/main/ZgatewayLORA.ino @@ -128,7 +128,13 @@ boolean _MQTTtoWiPhone(JsonObject& LORAdata) { } void setupLORA() { + +# ifdef ESP8266 + SPI.begin(); +# else SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_SS); +# endif + LoRa.setPins(LORA_SS, LORA_RST, LORA_DI0); if (!LoRa.begin(LORA_BAND)) { From b2bb081020d1d3ea1e077be319d5b53813a08aac Mon Sep 17 00:00:00 2001 From: nikito7 <45373783+nikito7@users.noreply.github.com> Date: Mon, 10 Jul 2023 01:16:28 +0100 Subject: [PATCH 2/2] Update ZgatewayLORA.ino --- main/ZgatewayLORA.ino | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main/ZgatewayLORA.ino b/main/ZgatewayLORA.ino index e9ea30c643..48ac2ee17e 100644 --- a/main/ZgatewayLORA.ino +++ b/main/ZgatewayLORA.ino @@ -128,12 +128,11 @@ boolean _MQTTtoWiPhone(JsonObject& LORAdata) { } void setupLORA() { - -# ifdef ESP8266 +# ifdef ESP8266 SPI.begin(); -# else +# else SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_SS); -# endif +# endif LoRa.setPins(LORA_SS, LORA_RST, LORA_DI0);