mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-04-04 22:19:00 +00:00
test MQTT 1
This commit is contained in:
parent
8a02e953c3
commit
03991e245d
13 changed files with 371 additions and 27 deletions
|
|
@ -136,6 +136,13 @@ void Configuration::writeFile() {
|
|||
data["remoteManagement"]["managers"] = remoteManagement.managers;
|
||||
data["remoteManagement"]["rfOnly"] = remoteManagement.rfOnly;
|
||||
|
||||
data["mqtt"]["active"] = mqtt.active;
|
||||
data["mqtt"]["server"] = mqtt.server;
|
||||
data["mqtt"]["topic"] = mqtt.topic;
|
||||
data["mqtt"]["username"] = mqtt.username;
|
||||
data["mqtt"]["password"] = mqtt.password;
|
||||
data["mqtt"]["port"] = mqtt.port;
|
||||
|
||||
serializeJson(data, configFile);
|
||||
|
||||
configFile.close();
|
||||
|
|
@ -264,6 +271,13 @@ bool Configuration::readFile() {
|
|||
remoteManagement.managers = data["remoteManagement"]["managers"] | "";
|
||||
remoteManagement.rfOnly = data["remoteManagement"]["rfOnly"] | true;
|
||||
|
||||
mqtt.active = data["mqtt"]["active"] | false;
|
||||
mqtt.server = data["mqtt"]["server"] | "";
|
||||
mqtt.topic = data["mqtt"]["topic"] | "aprs-igate";
|
||||
mqtt.username = data["mqtt"]["username"] | "";
|
||||
mqtt.password = data["mqtt"]["password"] | "";
|
||||
mqtt.port = data["mqtt"]["port"] | 1883;
|
||||
|
||||
if (wifiAPs.size() == 0) { // If we don't have any WiFi's from config we need to add "empty" SSID for AUTO AP
|
||||
WiFi_AP wifiap;
|
||||
wifiap.ssid = "";
|
||||
|
|
@ -382,6 +396,13 @@ void Configuration::init() {
|
|||
remoteManagement.managers = "";
|
||||
remoteManagement.rfOnly = true;
|
||||
|
||||
mqtt.active = false;
|
||||
mqtt.server = "";
|
||||
mqtt.topic = "aprs-igate";
|
||||
mqtt.username = "";
|
||||
mqtt.password = "";
|
||||
mqtt.port = 1883;
|
||||
|
||||
Serial.println("All is Written!");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue