mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-04-20 22:05:11 +00:00
commit
ffd27f03f2
2 changed files with 20 additions and 13 deletions
|
|
@ -82,11 +82,11 @@ void loop() {
|
|||
|
||||
WIFI_Utils::checkIfAutoAPShouldPowerOff();
|
||||
|
||||
if (!WiFiConnected) {
|
||||
thirdLine = Utils::getLocalIP();
|
||||
}
|
||||
|
||||
if (stationMode==1 || stationMode==2 ) { // iGate (1 Only Rx / 2 Rx+Tx)
|
||||
if (!WiFiConnected) {
|
||||
thirdLine = Utils::getLocalIP();
|
||||
}
|
||||
|
||||
WIFI_Utils::checkWiFi();
|
||||
if (!espClient.connected()) {
|
||||
APRS_IS_Utils::connect();
|
||||
|
|
@ -96,8 +96,8 @@ void loop() {
|
|||
DIGI_Utils::loop();
|
||||
} else if (stationMode==5) { // iGate when WiFi and APRS available , DigiRepeater when not (RxFreq=TxFreq)
|
||||
Utils::checkWiFiInterval();
|
||||
thirdLine = Utils::getLocalIP();
|
||||
if (WiFi.status() == WL_CONNECTED) { // iGate Mode
|
||||
thirdLine = Utils::getLocalIP();
|
||||
if (!espClient.connected()) {
|
||||
APRS_IS_Utils::connect();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#include "pins_config.h"
|
||||
#include "wifi_utils.h"
|
||||
#include "display.h"
|
||||
#include "utils.h"
|
||||
|
||||
extern Configuration Config;
|
||||
extern WiFi_AP *currentWiFi;
|
||||
|
|
@ -27,6 +28,16 @@ namespace WIFI_Utils {
|
|||
}
|
||||
}
|
||||
|
||||
void startAutoAP() {
|
||||
WiFi.mode(WIFI_MODE_NULL);
|
||||
|
||||
WiFi.mode(WIFI_AP);
|
||||
WiFi.softAP(Config.callsign + " AP", "1234567890");
|
||||
|
||||
WiFiAutoAPTime = millis();
|
||||
WiFiAutoAPStarted = true;
|
||||
}
|
||||
|
||||
void startWiFi() {
|
||||
bool startAP = false;
|
||||
if (currentWiFi->ssid == "") {
|
||||
|
|
@ -88,13 +99,7 @@ namespace WIFI_Utils {
|
|||
Serial.println("\nNot connected to WiFi! Starting Auto AP");
|
||||
show_display("", "", " Starting Auto AP", " Please connect to it " , " loading ...", 1000);
|
||||
|
||||
WiFi.mode(WIFI_MODE_NULL);
|
||||
|
||||
WiFi.mode(WIFI_AP);
|
||||
WiFi.softAP(Config.callsign + " AP", "1234567890");
|
||||
|
||||
WiFiAutoAPTime = millis();
|
||||
WiFiAutoAPStarted = true;
|
||||
startAutoAP();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -132,10 +137,12 @@ namespace WIFI_Utils {
|
|||
} else {
|
||||
Serial.println("stationMode ---> DigiRepeater (Rx freq != Tx freq)");
|
||||
}
|
||||
WiFi.mode(WIFI_OFF);
|
||||
startAutoAP();
|
||||
btStop();
|
||||
} else if (stationMode==5) {
|
||||
Serial.println("stationMode ---> iGate when Wifi/APRS available (DigiRepeater when not)");
|
||||
startWiFi();
|
||||
btStop();
|
||||
} else {
|
||||
Serial.println("stationMode ---> NOT VALID");
|
||||
show_display("------- ERROR -------", "stationMode Not Valid", "device will autofix", "and then reboot", 1000);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue