feat(server): ⚗️ update wifi settings to test on simulator

!wifi settings
This commit is contained in:
Julien Oculi 2024-06-26 12:18:45 +02:00
parent 5819c6174c
commit ff40bcc62a

View file

@ -16,8 +16,11 @@
#define IN4b 21 #define IN4b 21
// Paramètres de connexion wifi : // Paramètres de connexion wifi :
const char *ssid = "ESP32"; // const char *ssid = "ESP32";
const char *password = "test12345"; // const char *password = "test12345";
// For simulator only
const char *ssid = "Wokwi-GUEST";
const char *password = "";
// Temps d'attente entre deux impulsions : // Temps d'attente entre deux impulsions :
int delayTime = 3; int delayTime = 3;
@ -169,11 +172,24 @@ void setGlobals(String commandName, float commandValue)
void connectWiFi() void connectWiFi()
{ {
WiFi.mode(WIFI_AP); // For simulator only
WiFi.softAP(ssid, password); WiFi.mode(WIFI_STA);
Serial.print("[+] AP Created with IP Gateway "); WiFi.begin(ssid, password);
Serial.println(WiFi.softAPIP()); if (WiFi.waitForConnectResult() != WL_CONNECTED)
Serial.println(""); {
Serial.printf("WiFi Failed!\n");
return;
}
Serial.println(" Connected!");
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
// WiFi.mode(WIFI_AP);
// WiFi.softAP(ssid, password);
// Serial.print("[+] AP Created with IP Gateway ");
// Serial.println(WiFi.softAPIP());
// Serial.println("");
} }
void chooseCommand() void chooseCommand()