mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-07-06 01:41:42 +02:00
adding digirepeater when not wifi available
This commit is contained in:
+38
-2
@@ -20,18 +20,21 @@
|
||||
Configuration Config;
|
||||
WiFiClient espClient;
|
||||
|
||||
String versionDate = "2023.07.17";
|
||||
String versionDate = "2023.07.30";
|
||||
int myWiFiAPIndex = 0;
|
||||
int myWiFiAPSize = Config.wifiAPs.size();
|
||||
WiFi_AP *currentWiFi = &Config.wifiAPs[myWiFiAPIndex];
|
||||
|
||||
int stationMode = Config.stationMode;
|
||||
bool statusAfterBoot = true;
|
||||
bool beaconUpdate = true;
|
||||
bool beaconUpdate = true;
|
||||
uint32_t lastBeaconTx = 0;
|
||||
uint32_t previousWiFiMillis = 0;
|
||||
uint32_t lastScreenOn = millis();
|
||||
|
||||
uint32_t lastWiFiCheck = 0;
|
||||
bool WiFiConnect = true;
|
||||
|
||||
String batteryVoltage;
|
||||
|
||||
std::vector<String> lastHeardStation;
|
||||
@@ -77,5 +80,38 @@ void loop() {
|
||||
Utils::checkBeaconInterval();
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0);
|
||||
DIGI_Utils::processPacket(LoRa_Utils::receivePacket());
|
||||
} else if (stationMode==5) {
|
||||
uint32_t WiFiCheck = millis() - lastWiFiCheck;
|
||||
if (WiFi.status() != WL_CONNECTED && WiFiCheck >= Config.lastWiFiCheck*33*1000) {
|
||||
WiFiConnect = true;
|
||||
}
|
||||
if (WiFiConnect) {
|
||||
Serial.println("\n\n###############\ncomenzando nueva revision\n###############");
|
||||
WIFI_Utils::startWiFi2();
|
||||
lastWiFiCheck = millis();
|
||||
WiFiConnect = false;
|
||||
}
|
||||
|
||||
if (WiFi.status() == WL_CONNECTED) { // Modo iGate
|
||||
Serial.println("conectado");
|
||||
} else { // Modo DigiRepeater
|
||||
Utils::checkDisplayInterval();
|
||||
Utils::checkBeaconInterval();
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0);
|
||||
DIGI_Utils::processPacket(LoRa_Utils::receivePacket());
|
||||
}
|
||||
|
||||
/* si wifi
|
||||
si aprs --> igate
|
||||
else --> digi/exit
|
||||
else--> be digi
|
||||
*/
|
||||
|
||||
/*if (!espClient.connected()) {
|
||||
APRS_IS_Utils::connect();
|
||||
|
||||
// if aprsis ok --> be igate
|
||||
// else --> be digirepeater
|
||||
}*/
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user