-
Notifications
You must be signed in to change notification settings - Fork 51
Spiffs not work #2
Comments
Hi,
Sorry for not being able to help anymore as I'm so busy now. I'll definitely will have a look whenever I have time. Please post the result of your findings. Regards, |
I made a small modification to check the simultaneous operation of spiffs and ethernet. I am reading a file into a string variable. And I bring to the site in a standard way. It works. Spiffs and ethernet work together. The "streamFile" function in the ethernetwebserver library does not work. At least on esp 32.
|
That's good news. I already post the code to increase the 2K buffer to 4K/8K/16K in W5x00 in BlynkEthernet_WM: to increase Ethernet buffer. Regards, |
MOSI:23 |
Good day. Any news? |
Did you try the new Ethernet lib with 2+K buffer fix as in
I send 2+K strings using the modified Ethernet library OK. You can test using the examples in Pls inform if this is OK. I still haven't worked on your issue with ESP32 yet as the lib is not original made for ESPs. I'll do it soon. The 2+K string problem can possibly happen because the way you use local var too large (you have to test to be sure if the heap/stack OK). I got similar problem with some boards and solve by moving very long local vars to global.
Try somethng like this to see if it's better
|
My webpage is over 60k. Increasing the buffer will not solve the problem. But tomorrow I will definitely try a global variable and write the result here. |
Also see in my ESP_WiFiManager Library how to stream large files directly, without reading every byte into String buffer, with FSWebServer.
But that is for ESP8266/ESP32WebServer. I still haven't tested with this EthernetServer library to see it's working or not. template<typename T> size_t streamFile(T &file, const String& contentType);
{
setContentLength(file.size());
if (String(file.name()).endsWith(".gz") &&
contentType != "application/x-gzip" &&
contentType != "application/octet-stream") {
sendHeader("Content-Encoding", "gzip");
}
send(200, contentType, "");
return _currentClient.write(file);
} and use exactly the same to the previous example
|
It seems that ESP32 WebServer has severe bug in handling large file, using either SPIFFS or FFat. You can test using ESP32 FSBrowser example using the data in this directory
Testing files
You can upload the files to ESP32 filesystem (SPIFFS or FFat) as follows
Testing the similar example for ESP8266 is OK with that large file using these examples It's possibly some bugs in ESP32 WebServer / system library code, but I don't have time to follow up with this. You can open an issue in ESP32 support, mentioned details about your test with
I'm sorry I can't spend more time on this matter. Please open issue on ESP32, and give me a link / update. |
I tried using global variables. This also does not work. |
I already update the version to v1.0.6 to support ESP32 and ESP8266. Your contribution is noted in README by initiating the work on ESP32/ESP8266. Thanks to Vladimir to initiate the work on ESP32 in Spiffs not work Issue #2 |
I checked the new library 1.0.6 |
I don't expect v1.0.6 to work in your case. Just for normal smaller file applications only. About SPI The SPI bus is designed for 1 master and multiple slaves and you have to check if
That's why the ESP8266 is working OK with the same hardware / software, while ESP32 can't. Did you have time to verify the ESP32 and ESP8266 examples in my previous posts to have some ideas, then post issue on ESP32 so that someone will have a look? You can also have some easy try with ESP8266 using the same code / W5500 and SPIFFS to see how it handles large files. |
Hi @workpage2 , @tcpipchip Good news. I think I find out the problem now. As you see in Each SPI slave must use a different CS/SS pin, and pin SS in ESP32 has been use by Flash/SPIFFS/EEPROM and defined as SPISS. That's why we have all conflict issues so far. Sending a small piece of data might be OK, but larger data will create SPI bus conflict problem. //KH for ESP32
#elif defined(ESP32)
//pin SS already defined in ESP32 as pin 5, don't use this as conflict with SPIFFS, EEPROM, etc.
// Use in GPIO13
#warning w5100.cpp Use ESP32, change SS_PIN_DEFAULT to GPIO13, MOSI(23), MISO(19), SCK(18)
#define SS_PIN_DEFAULT 13 //SS
/////// Please test and inform me the result. |
I checked "ESP32 FSBrowser example". |
Studied esp32 documentation. Internal flash memory is connected by a separate spi interface. Pin 6-11 are involved and in no way connected with the user spi. |
This code is working correctly. Displays large files in the browser.
This is the most important piece of code. If you need a complete code - write. |
If you can post the whole code to save me some time to rewrite, I'll test and hope to see something wrong. |
Here, two connections are launched simultaneously - wifi and ethernet. Also, two web servers are launched simultaneously. The web server for ethernet only works with the index.html page, which must be uploaded to SPIFFS in advance.
|
Simple also works
But the speed is still low. |
Did you try to increase W5500 buffer larger, such as 8K, 16K? |
No. I use standart buffer. |
Ideally, you should fix the "streamFile" in the EthernetWebServer library. |
To change, modify w5100.cpp
and Ethernet.h
Hope so. But the real issue is possibly somewhere else. |
In this case, webserver.h is not an esp32 library. This is the WebDuino library. |
I still want to use EthernetWebServer, because I consider this the best solution. |
That's even better to raise ESP32 issue as you can show that standard ESP32 WebServer lib is not working. |
Glad you see that way. I'll try my best later on to find out why (but it seems very hard to catch), then find a work-around solution. Did you try using ENC28J60 or LAN8270?? |
I have 28j60 board. I will test it. |
But I never like ENC and don't think ENC will solve the issue as ENC is much worse (support, ease-of-use, etc.) than W5500. But good to try to see the real reason behind the issue (not W5500, but other libraries) |
ENC28J60 still working fine here!!!!! 24 hours!
…________________________________
De: Vladimir <[email protected]>
Enviado: domingo, 3 de maio de 2020 19:08
Para: khoih-prog/EthernetWebServer <[email protected]>
Cc: tcpipchip <[email protected]>; Mention <[email protected]>
Assunto: Re: [khoih-prog/EthernetWebServer] Spiffs not work (#2)
I have 28j60 board. I will test it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACXUZTHKQCKUWV4X2SAVXXTRPW6KNANCNFSM4MG4522Q>.
[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png]<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Livre de vírus. www.avg.com<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>.
|
But with higher workload / speed (much larger file transfer), I don't know. |
depending on aplication is not a problem!
Btw, i am thinking to test with ARDUINO MEGA + ENC28J60 on PROTEUS late :)
…________________________________
De: Khoi Hoang <[email protected]>
Enviado: domingo, 3 de maio de 2020 19:16
Para: khoih-prog/EthernetWebServer <[email protected]>
Cc: tcpipchip <[email protected]>; Mention <[email protected]>
Assunto: Re: [khoih-prog/EthernetWebServer] Spiffs not work (#2)
ENC28J60 still working fine here!!!!! 24 hours!
But with higher workload / speed (much larger file transfer), I don't know.
I still can see the ENC webpage upload speed slower than W5500, even for small files.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACXUZTCGBIMH7NB7R2ZLCFDRPW7J5ANCNFSM4MG4522Q>.
[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png]<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Livre de vírus. www.avg.com<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>.
|
OK now, sorry. using this AsyncTCP |
How do you proceed with your test and know it's running slowly. This is the terminal output and it's running OK so far
|
you have 2 ip addresses. Test 192.168.2.78 |
Upload large index.html and check the download time. |
Buffer overflow solution on w5100 |
Can you try using Ethernet3 lib to see if the problem relating to Ethernet lib only Sketch change
You just need to change the Webduino's WebServer.h into WebServer_Webduino.h and don't need to erase Standard webserver.h library WebServer_Webduino.h mod
|
I am using esp32 + w5500. The output of the index.html file to the web site via spiffs does not work. Simple helloserver works. I used this construction in standard webserver.h + esp32 via WiFi. Everything works. Plz help.
The text was updated successfully, but these errors were encountered: