Working great. Appreciate the help!
William
Explore... Chat... Share...
void listen() // Listen for client connection
{
// Check if a client has connected
[b]client = server.available();[/b]
if (client)
{
// Process this request until it completes or times out.
// Note that this is explicitly limited to handling one request at a time!
void readFile()
{
digitalWrite(online, HIGH); //turn-on online LED indicator
String filename = (const char *)&MyBuffer;
Serial.print("File: ");
Serial.println(filename);
File webFile = SPIFFS.open(filename, "r");
if (!webFile)
{
Serial.println("File failed to open");
Serial.println("\n");
}
else
{
char buf[1024];
int siz = webFile.size();
//.setContentLength(str.length() + siz);
//webserver.send(200, "text/plain", str);
while (siz > 0)
{
size_t len = std::min((int)(sizeof(buf) - 1), siz);
webFile.read((uint8_t *)buf, len);
client.write((const char*)buf, len);
//client.write(webFile);
siz -= len;
}
webFile.close();
}
error = 0;
delayTime = 1000;
MyBuffer[0] = '\0';
// digitalWrite(online, LOW); //turn-off online LED indicator
listen();
}
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]