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
// Paramètres de connexion wifi :
const char *ssid = "ESP32";
const char *password = "test12345";
// const char *ssid = "ESP32";
// const char *password = "test12345";
// For simulator only
const char *ssid = "Wokwi-GUEST";
const char *password = "";
// Temps d'attente entre deux impulsions :
int delayTime = 3;
@ -169,11 +172,24 @@ void setGlobals(String commandName, float commandValue)
void connectWiFi()
{
WiFi.mode(WIFI_AP);
WiFi.softAP(ssid, password);
Serial.print("[+] AP Created with IP Gateway ");
Serial.println(WiFi.softAPIP());
Serial.println("");
// For simulator only
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
if (WiFi.waitForConnectResult() != WL_CONNECTED)
{
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()