mirror of
https://github.com/me-no-dev/ESPAsyncWebServer.git
synced 2025-08-03 12:44:45 +02:00
update sample
This commit is contained in:
@@ -183,6 +183,20 @@ void setup() {
|
|||||||
|
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
||||||
|
#ifndef CONFIG_IDF_TARGET_ESP32H2
|
||||||
|
// WiFi.mode(WIFI_STA);
|
||||||
|
// WiFi.begin("YOUR_SSID", "YOUR_PASSWORD");
|
||||||
|
// if (WiFi.waitForConnectResult() != WL_CONNECTED) {
|
||||||
|
// Serial.printf("WiFi Failed!\n");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// Serial.print("IP Address: ");
|
||||||
|
// Serial.println(WiFi.localIP());
|
||||||
|
|
||||||
|
WiFi.mode(WIFI_AP);
|
||||||
|
WiFi.softAP("esp-captive");
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
LittleFS.begin(true);
|
LittleFS.begin(true);
|
||||||
#else
|
#else
|
||||||
@@ -201,20 +215,6 @@ void setup() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_IDF_TARGET_ESP32H2
|
|
||||||
// WiFi.mode(WIFI_STA);
|
|
||||||
// WiFi.begin("YOUR_SSID", "YOUR_PASSWORD");
|
|
||||||
// if (WiFi.waitForConnectResult() != WL_CONNECTED) {
|
|
||||||
// Serial.printf("WiFi Failed!\n");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// Serial.print("IP Address: ");
|
|
||||||
// Serial.println(WiFi.localIP());
|
|
||||||
|
|
||||||
WiFi.mode(WIFI_AP);
|
|
||||||
WiFi.softAP("esp-captive");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// curl -v -X GET http://192.168.4.1/handler-not-sending-response
|
// curl -v -X GET http://192.168.4.1/handler-not-sending-response
|
||||||
server.on("/handler-not-sending-response", HTTP_GET, [](AsyncWebServerRequest* request) {
|
server.on("/handler-not-sending-response", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||||
// handler forgot to send a response to the client => 501 Not Implemented
|
// handler forgot to send a response to the client => 501 Not Implemented
|
||||||
@@ -389,9 +389,8 @@ void setup() {
|
|||||||
request->send(200, "text/html", htmlContent);
|
request->send(200, "text/html", htmlContent);
|
||||||
});
|
});
|
||||||
|
|
||||||
server.on("/file", HTTP_GET, [](AsyncWebServerRequest* request) {
|
// curl -v -X GET http://192.168.4.1/index.txt
|
||||||
request->send(LittleFS, "/index.txt");
|
server.serveStatic("/index.txt", LittleFS, "/index.txt");
|
||||||
});
|
|
||||||
|
|
||||||
// Issue #14: assert failed: tcp_update_rcv_ann_wnd (needs help to test fix)
|
// Issue #14: assert failed: tcp_update_rcv_ann_wnd (needs help to test fix)
|
||||||
// > curl -v http://192.168.4.1/issue-14
|
// > curl -v http://192.168.4.1/issue-14
|
||||||
|
@@ -2,10 +2,10 @@
|
|||||||
default_envs = arduino-2, arduino-3, arduino-310rc1, esp8266, raspberrypi
|
default_envs = arduino-2, arduino-3, arduino-310rc1, esp8266, raspberrypi
|
||||||
lib_dir = .
|
lib_dir = .
|
||||||
; src_dir = examples/CaptivePortal
|
; src_dir = examples/CaptivePortal
|
||||||
; src_dir = examples/SimpleServer
|
src_dir = examples/SimpleServer
|
||||||
; src_dir = examples/StreamFiles
|
; src_dir = examples/StreamFiles
|
||||||
; src_dir = examples/Filters
|
; src_dir = examples/Filters
|
||||||
src_dir = examples/Issue85
|
; src_dir = examples/Issue85
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
Reference in New Issue
Block a user