mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-02-04 14:54:17 +01:00
first test
This commit is contained in:
parent
0afca08ac6
commit
3246dc6f87
|
|
@ -15,6 +15,14 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"network": {
|
||||
"DHCP": false,
|
||||
"ip": "192.168.0.50",
|
||||
"subnet": "255.255.255.0",
|
||||
"gateway": "192.168.0.1",
|
||||
"dns1": "8.8.8.8",
|
||||
"dns2": "8.8.4.4"
|
||||
},
|
||||
"aprs_is": {
|
||||
"passcode": "23201",
|
||||
"server": "soam.aprs2.net",
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@ void setup_wifi() {
|
|||
WiFi.disconnect();
|
||||
delay(100);
|
||||
unsigned long start = millis();
|
||||
|
||||
if (!Config.network.DHCP) {
|
||||
WiFi.setHostname(Config.callsign.c_str());
|
||||
WiFi.config(Config.network.ip, Config.network.gateway, Config.network.subnet, Config.network.dns1, Config.network.dns2);
|
||||
}
|
||||
|
||||
WiFi.begin(currentWiFi->ssid.c_str(), currentWiFi->password.c_str());
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
Serial.print('.');
|
||||
|
|
|
|||
|
|
@ -15,6 +15,16 @@ public:
|
|||
double longitude;
|
||||
};
|
||||
|
||||
class Network {
|
||||
public:
|
||||
bool DHCP;
|
||||
String ip;
|
||||
String subnet;
|
||||
String gateway;
|
||||
String dns1;
|
||||
String dns2;
|
||||
};
|
||||
|
||||
class APRS_IS {
|
||||
public:
|
||||
int passcode;
|
||||
|
|
@ -51,6 +61,7 @@ public:
|
|||
bool statusAfterBoot;
|
||||
String defaultStatus;
|
||||
std::vector<WiFi_AP> wifiAPs;
|
||||
Network network;
|
||||
APRS_IS aprs_is;
|
||||
LoraModule loramodule;
|
||||
Display display;
|
||||
|
|
@ -91,7 +102,14 @@ private:
|
|||
beaconInterval = data["other"]["beaconInterval"].as<int>();
|
||||
statusAfterBoot = data["other"]["statusAfterBoot"].as<bool>();
|
||||
defaultStatus = data["other"]["defaultStatus"].as<String>();
|
||||
|
||||
|
||||
network.DHCP = data["network"]["DHCP"].as<bool>();
|
||||
network.ip = data["network"]["ip"].as<String>();
|
||||
network.subnet = data["network"]["subnet"].as<String>();
|
||||
network.gateway = data["network"]["gateway"].as<String>();
|
||||
network.dns1 = data["network"]["dns1"].as<String>();
|
||||
network.dns2 = data["network"]["dns2"].as<String>();
|
||||
|
||||
aprs_is.passcode = data["aprs_is"]["passcode"].as<int>();
|
||||
aprs_is.server = data["aprs_is"]["server"].as<String>();
|
||||
aprs_is.port = data["aprs_is"]["port"].as<int>();
|
||||
|
|
|
|||
Loading…
Reference in a new issue