mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2025-12-06 07:42:00 +01:00
Added an option to enable WiFi on (PoE) Ethernet boards as proposed in issue #116
Added an option to adjust LoRa receiver gain
This commit is contained in:
parent
1390fc1ad0
commit
6612e3da16
|
|
@ -11,6 +11,7 @@
|
|||
"wifi": {
|
||||
"AP": [
|
||||
{
|
||||
"active": false,
|
||||
"SSID": "YOURSSID",
|
||||
"password": "YOURPASSWORD"
|
||||
}
|
||||
|
|
@ -36,6 +37,7 @@
|
|||
},
|
||||
"lora": {
|
||||
"frequency_rx": 433775000,
|
||||
"gain_rx": 6;
|
||||
"frequency_tx": 433775000,
|
||||
"power": 20,
|
||||
"spreading_factor": 12,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "LoRa_APRS.h"
|
||||
|
||||
LoRa_APRS::LoRa_APRS() : _RxFrequency(433775000), _TxFrequency(433775000) {
|
||||
LoRa_APRS::LoRa_APRS() : _RxFrequency(433775000), _TxFrequency(433775000), _RxGain(6) {
|
||||
}
|
||||
|
||||
bool LoRa_APRS::checkMessage() {
|
||||
|
|
@ -50,6 +50,11 @@ void LoRa_APRS::setRxFrequency(long frequency) {
|
|||
setFrequency(_RxFrequency);
|
||||
}
|
||||
|
||||
void LoRa_APRS::setRxGain(uint8_t gain) {
|
||||
_RxGain = gain;
|
||||
setGain(_RxGain);
|
||||
}
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
long LoRa_APRS::getRxFrequency() const {
|
||||
return _RxFrequency;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ public:
|
|||
void setRxFrequency(long frequency);
|
||||
long getRxFrequency() const;
|
||||
|
||||
void setRxGain(uint8_t gain);
|
||||
|
||||
void setTxFrequency(long frequency);
|
||||
long getTxFrequency() const;
|
||||
|
||||
|
|
@ -26,6 +28,7 @@ private:
|
|||
std::shared_ptr<APRSMessage> _LastReceivedMsg;
|
||||
long _RxFrequency;
|
||||
long _TxFrequency;
|
||||
uint8_t _RxGain;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#include "TaskWifi.h"
|
||||
#include "project_configuration.h"
|
||||
|
||||
#define VERSION "21.35.0-dev"
|
||||
#define VERSION "21.44.0-dev"
|
||||
|
||||
String create_lat_aprs(double lat);
|
||||
String create_long_aprs(double lng);
|
||||
|
|
@ -100,9 +100,10 @@ void setup() {
|
|||
LoRaSystem.getTaskManager().addTask(&routerTask);
|
||||
|
||||
if (userConfig.aprs_is.active) {
|
||||
if (boardConfig->Type == eETH_BOARD) {
|
||||
if (boardConfig->Type == eETH_BOARD && !userConfig.wifi.active) {
|
||||
LoRaSystem.getTaskManager().addAlwaysRunTask(ðTask);
|
||||
} else {
|
||||
}
|
||||
if (userConfig.wifi.active) {
|
||||
LoRaSystem.getTaskManager().addAlwaysRunTask(&wifiTask);
|
||||
}
|
||||
LoRaSystem.getTaskManager().addTask(&otaTask);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ bool ModemTask::setup(System &system) {
|
|||
;
|
||||
}
|
||||
_lora_aprs.setRxFrequency(system.getUserConfig()->lora.frequencyRx);
|
||||
_lora_aprs.setRxGain(system.getUserConfig()->lora.gainRx);
|
||||
_lora_aprs.setTxFrequency(system.getUserConfig()->lora.frequencyTx);
|
||||
_lora_aprs.setTxPower(system.getUserConfig()->lora.power);
|
||||
_lora_aprs.setSpreadingFactor(system.getUserConfig()->lora.spreadingFactor);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ void ProjectConfigurationManagement::readProjectConfiguration(DynamicJsonDocumen
|
|||
conf.network.dns2.fromString(data["network"]["dns2"].as<String>());
|
||||
}
|
||||
|
||||
conf.wifi.active = data["wifi"]["active"];
|
||||
JsonArray aps = data["wifi"]["AP"].as<JsonArray>();
|
||||
for (JsonVariant v : aps) {
|
||||
Configuration::Wifi::AP ap;
|
||||
|
|
@ -39,6 +40,7 @@ void ProjectConfigurationManagement::readProjectConfiguration(DynamicJsonDocumen
|
|||
conf.digi.active = data["digi"]["active"] | false;
|
||||
conf.digi.beacon = data["digi"]["beacon"] | false;
|
||||
conf.lora.frequencyRx = data["lora"]["frequency_rx"] | 433775000;
|
||||
conf.lora.gainRx = data["lora"]["gain_rx"] | 6;
|
||||
conf.lora.frequencyTx = data["lora"]["frequency_tx"] | 433775000;
|
||||
conf.lora.power = data["lora"]["power"] | 20;
|
||||
conf.lora.spreadingFactor = data["lora"]["spreading_factor"] | 12;
|
||||
|
|
@ -82,6 +84,7 @@ void ProjectConfigurationManagement::writeProjectConfiguration(Configuration &co
|
|||
data["network"]["dns2"] = conf.network.dns2.toString();
|
||||
}
|
||||
|
||||
data["wifi"]["active"] = conf.wifi.active;
|
||||
JsonArray aps = data["wifi"].createNestedArray("AP");
|
||||
for (Configuration::Wifi::AP ap : conf.wifi.APs) {
|
||||
JsonObject v = aps.createNestedObject();
|
||||
|
|
@ -99,6 +102,7 @@ void ProjectConfigurationManagement::writeProjectConfiguration(Configuration &co
|
|||
data["digi"]["active"] = conf.digi.active;
|
||||
data["digi"]["beacon"] = conf.digi.beacon;
|
||||
data["lora"]["frequency_rx"] = conf.lora.frequencyRx;
|
||||
data["lora"]["gain_rx"] = conf.lora.gainRx;
|
||||
data["lora"]["frequency_tx"] = conf.lora.frequencyTx;
|
||||
data["lora"]["power"] = conf.lora.power;
|
||||
data["lora"]["spreading_factor"] = conf.lora.spreadingFactor;
|
||||
|
|
|
|||
|
|
@ -21,13 +21,14 @@ public:
|
|||
|
||||
class Wifi {
|
||||
public:
|
||||
bool active;
|
||||
class AP {
|
||||
public:
|
||||
String SSID;
|
||||
String password;
|
||||
};
|
||||
|
||||
Wifi() {
|
||||
Wifi() : active(true) {
|
||||
}
|
||||
|
||||
std::list<AP> APs;
|
||||
|
|
@ -70,6 +71,7 @@ public:
|
|||
}
|
||||
|
||||
long frequencyRx;
|
||||
uint8_t gainRx;
|
||||
long frequencyTx;
|
||||
int power;
|
||||
int spreadingFactor;
|
||||
|
|
|
|||
Loading…
Reference in a new issue