mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-08-09 10:22:51 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 02d9448762 | |||
| 61fc6b5f2a | |||
| b45f378817 |
@@ -1,6 +1,7 @@
|
|||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
#include <SPIFFS.h>
|
#include <SPIFFS.h>
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "board_pinout.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -48,6 +49,9 @@ void Configuration::writeFile() {
|
|||||||
|
|
||||||
data["digi"]["mode"] = digi.mode;
|
data["digi"]["mode"] = digi.mode;
|
||||||
data["digi"]["ecoMode"] = digi.ecoMode;
|
data["digi"]["ecoMode"] = digi.ecoMode;
|
||||||
|
#if defined(HAS_A7670)
|
||||||
|
if (digi.ecoMode == 1) data["digi"]["ecoMode"] = 2;
|
||||||
|
#endif
|
||||||
|
|
||||||
data["lora"]["rxFreq"] = loramodule.rxFreq;
|
data["lora"]["rxFreq"] = loramodule.rxFreq;
|
||||||
data["lora"]["txFreq"] = loramodule.txFreq;
|
data["lora"]["txFreq"] = loramodule.txFreq;
|
||||||
@@ -171,6 +175,10 @@ bool Configuration::readFile() {
|
|||||||
digi.ecoMode = data["digi"]["ecoMode"] | 0;
|
digi.ecoMode = data["digi"]["ecoMode"] | 0;
|
||||||
if (digi.ecoMode == 1) shouldSleepStop = false;
|
if (digi.ecoMode == 1) shouldSleepStop = false;
|
||||||
|
|
||||||
|
#if defined(HAS_A7670)
|
||||||
|
if (digi.ecoMode == 1) digi.ecoMode = 2;
|
||||||
|
#endif
|
||||||
|
|
||||||
loramodule.txFreq = data["lora"]["txFreq"] | 433775000;
|
loramodule.txFreq = data["lora"]["txFreq"] | 433775000;
|
||||||
loramodule.rxFreq = data["lora"]["rxFreq"] | 433775000;
|
loramodule.rxFreq = data["lora"]["rxFreq"] | 433775000;
|
||||||
loramodule.spreadingFactor = data["lora"]["spreadingFactor"] | 12;
|
loramodule.spreadingFactor = data["lora"]["spreadingFactor"] | 12;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ namespace SLEEP_Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
#ifndef HAS_A7670
|
||||||
if (Config.digi.ecoMode == 1) {
|
if (Config.digi.ecoMode == 1) {
|
||||||
pinMode(RADIO_WAKEUP_PIN, INPUT);
|
pinMode(RADIO_WAKEUP_PIN, INPUT);
|
||||||
attachInterrupt(digitalPinToInterrupt(RADIO_WAKEUP_PIN), wakeUpLoRaPacketReceived, RISING);
|
attachInterrupt(digitalPinToInterrupt(RADIO_WAKEUP_PIN), wakeUpLoRaPacketReceived, RISING);
|
||||||
@@ -39,6 +40,7 @@ namespace SLEEP_Utils {
|
|||||||
esp_deep_sleep_enable_gpio_wakeup(1ULL << GPIO_WAKEUP_PIN, ESP_GPIO_WAKEUP_GPIO_HIGH);
|
esp_deep_sleep_enable_gpio_wakeup(1ULL << GPIO_WAKEUP_PIN, ESP_GPIO_WAKEUP_GPIO_HIGH);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getSecondsToSleep() {
|
uint32_t getSecondsToSleep() {
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ float newHum, newTemp, newPress, newGas;
|
|||||||
Adafruit_BME280 bme280;
|
Adafruit_BME280 bme280;
|
||||||
#if defined(HELTEC_V3) || defined(HELTEC_V3_2)
|
#if defined(HELTEC_V3) || defined(HELTEC_V3_2)
|
||||||
Adafruit_BMP280 bmp280(&Wire1);
|
Adafruit_BMP280 bmp280(&Wire1);
|
||||||
Adafruit_Si7021 sensor = Adafruit_Si7021();
|
Adafruit_Si7021 si7021 = Adafruit_Si7021();
|
||||||
#else
|
#else
|
||||||
Adafruit_BMP280 bmp280;
|
Adafruit_BMP280 bmp280;
|
||||||
Adafruit_BME680 bme680;
|
Adafruit_BME680 bme680;
|
||||||
|
|||||||
Reference in New Issue
Block a user