Reorganisation fichiers

This commit is contained in:
Serge NOEL
2026-02-13 08:49:53 +01:00
parent ec9957d5b1
commit 758f73bc0e
33 changed files with 977 additions and 499 deletions

View File

@@ -1,16 +1,14 @@
#include <WiFi.h>
#include <ESPAsyncWebServer.h>
#include <AsyncTCP.h>
void launchWiFiConfig();
#include <Arduino.h>
#include <TFT_eSPI.h>
#include "color.h"
#include <EEPROM.h>
#include <WiFi.h>
#include <ESPAsyncWebServer.h>
#include <EEPROM.h>
#include <AsyncTCP.h>
#include <SD.h>
#include "color.h"
void launchWiFiConfig();
// Read WiFi credentials from EEPROM
#define WIFI_SSID_ADDR 0
@@ -75,13 +73,28 @@ void setup()
tft.println("WiFi credentials missing!");
tft.setCursor(10, 40);
tft.setTextColor(COLOR_YELLOW);
tft.println("Launch WiFiConfig to set them.");
tft.println("Please connect to CYD_Config AP");
tft.setCursor(10, 55);
tft.println("and set WiFi credentials");
launchWiFiConfig(); // Function to start WiFi configuration mode (not implemented here)
} else {
// Ok connect to WiFi
tft.setCursor(60, 10);
tft.setTextColor(COLOR_GREEN);
tft.println("OK");
DEBUG_MSG("WiFi SSID: %s", wifi_ssid);
DEBUG_MSG("WiFi PASS: %s", wifi_pass);
}
// Try to open SD card and read content
if (!SD.begin()) {
tft.println("SD Card not found!");
while (1); // or handle error as needed
}
if (!SD.exists("/loco")) {
tft.println("loco/ folder not found!");
while (1); // or handle error as needed
}
}
@@ -114,7 +127,7 @@ void launchWiFiConfig()
WiFi.softAP("CYD_Config", "12345678");
IPAddress myIP = WiFi.softAPIP();
DEBUG_MSG("AP IP address: %s", myIP.toString().c_str());
AsyncWebServer server(80);
AsyncWebServer server(80);
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
String html = "<html><body><h2>WiFi Config</h2>"
"<form action='/save' method='post'>"