Skip to main content
Specified languages in code examples to enable syntax highlighting.
Source Link

I can load spiff docs, but I get a 404. Wireless works, IP addressing works and I can load other examples successfully. This simple image load ino is giving me fits!

#include <WiFi.h>
#include <AsyncTCP.h>
#include <SPIFFS.h>
#include <ESPAsyncWebServer.h>
const char *ssid = "x";
const char *password =  "123456789";
IPAddress staticIP(10,0,0,1); //ESP static ip
IPAddress gateway(0,0,0,0);   //IP Address of your WiFi Router (Gateway)
IPAddress subnet(255, 255, 255, 0);  //Subnet mask

AsyncWebServer server(80);

void setup() {
  Serial.begin(115200);
  WiFi.softAP(ssid, password);

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/index.htm", "text/html");});
     
server.on("/image.png", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/image.png", "image/png");});

server.begin();

}//END setup

void loop() 
{
}
#include <WiFi.h>
#include <AsyncTCP.h>
#include <SPIFFS.h>
#include <ESPAsyncWebServer.h>
const char *ssid = "x";
const char *password =  "123456789";
IPAddress staticIP(10,0,0,1); //ESP static ip
IPAddress gateway(0,0,0,0);   //IP Address of your WiFi Router (Gateway)
IPAddress subnet(255, 255, 255, 0);  //Subnet mask

AsyncWebServer server(80);

void setup() {
  Serial.begin(115200);
  WiFi.softAP(ssid, password);

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/index.htm", "text/html");});
     
server.on("/image.png", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/image.png", "image/png");});

server.begin();

}//END setup

void loop() 
{
}
<!DOCTYPE HTML>
<html>
<head>
     <meta charset='UTF-8'>
</head>
<body>
     <img src="image.png" alt=" image goes here">
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
     <meta charset='UTF-8'>
</head>
<body>
     <img src="image.png" alt=" image goes here">
</body>
</html>

I can load spiff docs, but I get a 404. Wireless works, IP addressing works and I can load other examples successfully. This simple image load ino is giving me fits!

#include <WiFi.h>
#include <AsyncTCP.h>
#include <SPIFFS.h>
#include <ESPAsyncWebServer.h>
const char *ssid = "x";
const char *password =  "123456789";
IPAddress staticIP(10,0,0,1); //ESP static ip
IPAddress gateway(0,0,0,0);   //IP Address of your WiFi Router (Gateway)
IPAddress subnet(255, 255, 255, 0);  //Subnet mask

AsyncWebServer server(80);

void setup() {
  Serial.begin(115200);
  WiFi.softAP(ssid, password);

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/index.htm", "text/html");});
     
server.on("/image.png", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/image.png", "image/png");});

server.begin();

}//END setup

void loop() 
{
}
<!DOCTYPE HTML>
<html>
<head>
     <meta charset='UTF-8'>
</head>
<body>
     <img src="image.png" alt=" image goes here">
</body>
</html>

I can load spiff docs, but I get a 404. Wireless works, IP addressing works and I can load other examples successfully. This simple image load ino is giving me fits!

#include <WiFi.h>
#include <AsyncTCP.h>
#include <SPIFFS.h>
#include <ESPAsyncWebServer.h>
const char *ssid = "x";
const char *password =  "123456789";
IPAddress staticIP(10,0,0,1); //ESP static ip
IPAddress gateway(0,0,0,0);   //IP Address of your WiFi Router (Gateway)
IPAddress subnet(255, 255, 255, 0);  //Subnet mask

AsyncWebServer server(80);

void setup() {
  Serial.begin(115200);
  WiFi.softAP(ssid, password);

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/index.htm", "text/html");});
     
server.on("/image.png", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/image.png", "image/png");});

server.begin();

}//END setup

void loop() 
{
}
<!DOCTYPE HTML>
<html>
<head>
     <meta charset='UTF-8'>
</head>
<body>
     <img src="image.png" alt=" image goes here">
</body>
</html>
added 1 character in body
Source Link

I can load spiff docs, but I get a 404. Wireless works, IP addressing works and I can load other examples successfully. This simple image load ino is giving me fits!

#include <WiFi.h>
#include <AsyncTCP.h>
#include <SPIFFS.h>
#include <ESPAsyncWebServer.h>
const char *ssid = "x";
const char *password =  "123456789";
IPAddress staticIP(10,0,0,1); //ESP static ip
IPAddress gateway(0,0,0,0);   //IP Address of your WiFi Router (Gateway)
IPAddress subnet(255, 255, 255, 0);  //Subnet mask

AsyncWebServer server(80);

void setup() {
  Serial.begin(115200);
  WiFi.softAP(ssid, password);

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/index.htm", "text/html");});
     
server.on("/image.png", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/image.png", "text"image/png");});

server.begin();

}//END setup

void loop() 
{
}
<!DOCTYPE HTML>
<html>
<head>
     <meta charset='UTF-8'>
</head>
<body>
     <img src="image.png" alt=" image goes here">
</body>
</html>

I can load spiff docs, but I get a 404. Wireless works, IP addressing works and I can load other examples successfully. This simple image load ino is giving me fits!

#include <WiFi.h>
#include <AsyncTCP.h>
#include <SPIFFS.h>
#include <ESPAsyncWebServer.h>
const char *ssid = "x";
const char *password =  "123456789";
IPAddress staticIP(10,0,0,1); //ESP static ip
IPAddress gateway(0,0,0,0);   //IP Address of your WiFi Router (Gateway)
IPAddress subnet(255, 255, 255, 0);  //Subnet mask

AsyncWebServer server(80);

void setup() {
  Serial.begin(115200);
  WiFi.softAP(ssid, password);

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/index.htm", "text/html");});
     
server.on("/image.png", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/image.png", "text/png");});

server.begin();

}//END setup

void loop() 
{
}
<!DOCTYPE HTML>
<html>
<head>
     <meta charset='UTF-8'>
</head>
<body>
     <img src="image.png" alt=" image goes here">
</body>
</html>

I can load spiff docs, but I get a 404. Wireless works, IP addressing works and I can load other examples successfully. This simple image load ino is giving me fits!

#include <WiFi.h>
#include <AsyncTCP.h>
#include <SPIFFS.h>
#include <ESPAsyncWebServer.h>
const char *ssid = "x";
const char *password =  "123456789";
IPAddress staticIP(10,0,0,1); //ESP static ip
IPAddress gateway(0,0,0,0);   //IP Address of your WiFi Router (Gateway)
IPAddress subnet(255, 255, 255, 0);  //Subnet mask

AsyncWebServer server(80);

void setup() {
  Serial.begin(115200);
  WiFi.softAP(ssid, password);

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/index.htm", "text/html");});
     
server.on("/image.png", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/image.png", "image/png");});

server.begin();

}//END setup

void loop() 
{
}
<!DOCTYPE HTML>
<html>
<head>
     <meta charset='UTF-8'>
</head>
<body>
     <img src="image.png" alt=" image goes here">
</body>
</html>
Source Link

ESP32 AsyncWebServer SPIFFS problem loading page

I can load spiff docs, but I get a 404. Wireless works, IP addressing works and I can load other examples successfully. This simple image load ino is giving me fits!

#include <WiFi.h>
#include <AsyncTCP.h>
#include <SPIFFS.h>
#include <ESPAsyncWebServer.h>
const char *ssid = "x";
const char *password =  "123456789";
IPAddress staticIP(10,0,0,1); //ESP static ip
IPAddress gateway(0,0,0,0);   //IP Address of your WiFi Router (Gateway)
IPAddress subnet(255, 255, 255, 0);  //Subnet mask

AsyncWebServer server(80);

void setup() {
  Serial.begin(115200);
  WiFi.softAP(ssid, password);

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/index.htm", "text/html");});
     
server.on("/image.png", HTTP_GET, [](AsyncWebServerRequest *request)
{request->send(SPIFFS, "/image.png", "text/png");});

server.begin();

}//END setup

void loop() 
{
}
<!DOCTYPE HTML>
<html>
<head>
     <meta charset='UTF-8'>
</head>
<body>
     <img src="image.png" alt=" image goes here">
</body>
</html>