Skip to content

Commit

Permalink
Lora change
Browse files Browse the repository at this point in the history
  • Loading branch information
richonguzman committed May 23, 2024
1 parent 7c17cd2 commit bfa6666
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 162 deletions.
58 changes: 29 additions & 29 deletions data/igate_conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
},
"AP": []
},
"aprs_is": {
"active": false,
"passcode": "XYZVW",
"server": "rotate.aprs2.net",
"port": 14580,
"filter": "m/10",
"toRF": false,
"messagesToRF": false,
"objectsToRF": false
},
"beacon": {
"latitude": 0.0,
"longitude": 0.0,
Expand All @@ -21,21 +31,6 @@
"digi": {
"mode": 0
},
"tnc": {
"enableServer": false,
"enableSerial": false,
"acceptOwn": false
},
"aprs_is": {
"active": false,
"passcode": "XYZVW",
"server": "rotate.aprs2.net",
"port": 14580,
"filter": "m/10",
"toRF": false,
"messagesToRF": false,
"objectsToRF": false
},
"lora": {
"txFreq": 433775000,
"rxFreq": 433775000,
Expand All @@ -51,20 +46,6 @@
"timeout": 4,
"turn180": false
},
"syslog": {
"active": false,
"server": "192.168.0.100",
"port": 514
},
"bme": {
"active": false,
"heightCorrection": 0,
"temperatureCorrection": 0.0
},
"ota": {
"username": "",
"password": ""
},
"battery": {
"sendInternalVoltage": false,
"sendExternalVoltage": false,
Expand All @@ -74,6 +55,25 @@
"externalMonitor": false,
"externalSleepVoltage": 0.0
},
"bme": {
"active": false,
"heightCorrection": 0,
"temperatureCorrection": 0.0
},
"syslog": {
"active": false,
"server": "192.168.0.100",
"port": 514
},
"tnc": {
"enableServer": false,
"enableSerial": false,
"acceptOwn": false
},
"ota": {
"username": "",
"password": ""
},
"other": {
"rememberStationTime": 30,
"lowPowerMode": false,
Expand Down
6 changes: 3 additions & 3 deletions src/LoRa_APRS_iGate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ________________________________________________________________________________
#include "A7670_utils.h"
#endif

String versionDate = "2024.05.22";
String versionDate = "2024.05.23";
Configuration Config;
WiFiClient espClient;

Expand Down Expand Up @@ -109,7 +109,7 @@ void setup() {
esp_light_sleep_start();
Serial.println("Waked up");
}
Config.loramodule.rxActive = false;
Config.lora.rxActive = false;
}
#endif

Expand Down Expand Up @@ -155,7 +155,7 @@ void loop() {
APRS_IS_Utils::checkStatus(); // Need that to update display, maybe split this and send APRSIS status to display func?

String packet = "";
if (Config.loramodule.rxActive) {
if (Config.lora.rxActive) {
packet = LoRa_Utils::receivePacket(); // We need to fetch LoRa packet above APRSIS and Digi
}

Expand Down
70 changes: 35 additions & 35 deletions src/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ void Configuration::writeFile() {
data["beacon"]["sendViaRF"] = beacon.sendViaRF;
data["beacon"]["path"] = beacon.path;

// data["lora"]["iGateFreq"] = loramodule.iGateFreq;
// data["lora"]["digirepeaterTxFreq"] = loramodule.digirepeaterTxFreq;
// data["lora"]["digirepeaterRxFreq"] = loramodule.digirepeaterRxFreq;
data["lora"]["rxFreq"] = loramodule.rxFreq;
data["lora"]["txFreq"] = loramodule.txFreq;
data["lora"]["spreadingFactor"] = loramodule.spreadingFactor;
data["lora"]["signalBandwidth"] = loramodule.signalBandwidth;
data["lora"]["codingRate4"] = loramodule.codingRate4;
data["lora"]["power"] = loramodule.power;
data["lora"]["txActive"] = loramodule.txActive;
data["lora"]["rxActive"] = loramodule.rxActive;
// data["lora"]["iGateFreq"] = lora.iGateFreq;
// data["lora"]["digirepeaterTxFreq"] = lora.digirepeaterTxFreq;
// data["lora"]["digirepeaterRxFreq"] = lora.digirepeaterRxFreq;
data["lora"]["rxFreq"] = lora.rxFreq;
data["lora"]["txFreq"] = lora.txFreq;
data["lora"]["spreadingFactor"] = lora.spreadingFactor;
data["lora"]["signalBandwidth"] = lora.signalBandwidth;
data["lora"]["codingRate4"] = lora.codingRate4;
data["lora"]["power"] = lora.power;
data["lora"]["txActive"] = lora.txActive;
data["lora"]["rxActive"] = lora.rxActive;

data["display"]["alwaysOn"] = display.alwaysOn;
data["display"]["timeout"] = display.timeout;
Expand Down Expand Up @@ -154,10 +154,10 @@ bool Configuration::readFile() {
aprs_is.server = data["aprs_is"]["server"].as<String>();
aprs_is.port = data["aprs_is"]["port"].as<int>();

loramodule.spreadingFactor = data["lora"]["spreadingFactor"].as<int>();
loramodule.signalBandwidth = data["lora"]["signalBandwidth"].as<long>();
loramodule.codingRate4 = data["lora"]["codingRate4"].as<int>();
loramodule.power = data["lora"]["power"].as<int>();
lora.spreadingFactor = data["lora"]["spreadingFactor"].as<int>();
lora.signalBandwidth = data["lora"]["signalBandwidth"].as<long>();
lora.codingRate4 = data["lora"]["codingRate4"].as<int>();
lora.power = data["lora"]["power"].as<int>();

display.alwaysOn = data["display"]["alwaysOn"].as<bool>();
display.timeout = data["display"]["timeout"].as<int>();
Expand Down Expand Up @@ -219,10 +219,10 @@ bool Configuration::readFile() {
aprs_is.messagesToRF = data["aprs_is"]["messagesToRF"].as<bool>();
aprs_is.objectsToRF = data["aprs_is"]["objectsToRF"].as<bool>();

loramodule.txFreq = data["lora"]["txFreq"].as<long>();
loramodule.rxFreq = data["lora"]["rxFreq"].as<long>();
loramodule.txActive = data["lora"]["txActive"].as<bool>();
loramodule.rxActive = data["lora"]["rxActive"].as<bool>();
lora.txFreq = data["lora"]["txFreq"].as<long>();
lora.rxFreq = data["lora"]["rxFreq"].as<long>();
lora.txActive = data["lora"]["txActive"].as<bool>();
lora.rxActive = data["lora"]["rxActive"].as<bool>();
} else {
// Load old settings and put into new variables not actual config

Expand All @@ -244,24 +244,24 @@ bool Configuration::readFile() {
beacon.interval = beaconInterval;
// beacon.igateSendsLoRaBeacons = igateSendsLoRaBeacons;
// beacon.igateRepeatsLoRaPackets = igateRepeatsLoRaPackets;
loramodule.txFreq = digirepeaterTxFreq;
loramodule.rxFreq = digirepeaterRxFreq;
loramodule.rxActive = true;
lora.txFreq = digirepeaterTxFreq;
lora.rxFreq = digirepeaterRxFreq;
lora.rxActive = true;
beacon.sendViaAPRSIS = true;
beacon.sendViaRF = false;

switch (stationMode) {
case 1: // IGate only
// aprs_is.active = true; // better don't do that automatically
beacon.comment = iGateComment;
loramodule.rxFreq = iGateFreq;
lora.rxFreq = iGateFreq;
break;
case 5: // Digi + IGate
case 2: // Digi + IGate
// aprs_is.active = true; // better don't do that automatically
// digi.mode = 2; // better don't do that automatically
beacon.comment = digiComment;
loramodule.rxFreq = iGateFreq;
lora.rxFreq = iGateFreq;
break;
case 3: // Digi
case 4: // Digi
Expand Down Expand Up @@ -336,17 +336,17 @@ void Configuration::init() {
aprs_is.messagesToRF = false;
aprs_is.objectsToRF = false;

// loramodule.iGateFreq = 433775000; // deprecated
// loramodule.digirepeaterTxFreq = 433775000; // deprecated
// loramodule.digirepeaterRxFreq = 433900000; // deprecated
loramodule.txFreq = 433775000; // new
loramodule.rxFreq = 433775000; // new
loramodule.spreadingFactor = 12;
loramodule.signalBandwidth = 125000;
loramodule.codingRate4 = 5;
loramodule.power = 20;
loramodule.txActive = false; // new
loramodule.rxActive = true; // new
// lora.iGateFreq = 433775000; // deprecated
// lora.digirepeaterTxFreq = 433775000; // deprecated
// lora.digirepeaterRxFreq = 433900000; // deprecated
lora.txFreq = 433775000; // new
lora.rxFreq = 433775000; // new
lora.spreadingFactor = 12;
lora.signalBandwidth = 125000;
lora.codingRate4 = 5;
lora.power = 20;
lora.txActive = false; // new
lora.rxActive = true; // new

display.alwaysOn = true;
display.timeout = 4;
Expand Down
Loading

0 comments on commit bfa6666

Please sign in to comment.