-
Notifications
You must be signed in to change notification settings - Fork 7.6k
ESP32-S2 Webserver Library #6704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@asvith - Where are the web files in the S2? In SPIFFS folders? |
I serve javascript files with esp32 without any issues. Here's some tricks. Use
|
@lbernstone - In that case the JS files goes with the compiled blob, right? @asvith - Is there any error message in the console of you Arduino IDE? |
His issue may certainly be about partitioning. More info needed. My design philosophy is that if you are using a library (and javascipt like jquery is certainly a library in this case), it should be embedded in your code rather than a separate file. This means you know exactly what version is being delivered, and it gets replaced/updated with whatever code is calling the script. The file system should be reserved for use by user or sensor data that will be generated on the device. The file upload features may be handy for testing, but they get messy in any sort of long-term support situation where you want consistency in your end product. In practice, I put each javascript file into a separate header file, and include them from the code where I have my web server config. This makes it nearly as fast to replace as if it were a file in the |
@asvith - Is there any error message in the console of you Arduino IDE? |
we are not using any files, directly in code we are using char array. |
You are using a const char array? |
yes |
Please provide a minimal example that reproduces your error. Remove a large section of the 60k data like as in my example. |
@asvith - it didn't compile.... server.on("/inline", {
server.send(200, "text/plain", "this works as well");
}); I changed it to use an external function:
Results:I was able to retrive 68,262 bytes from the WebServer... |
Trying this. Works for small files, but bigger files trigger an A workaround for SPIFF was to send chunked data, but how to send chunked data from const char array ? |
server.send and server.send_P are different functions. send_P requires you to include the string length, because it does not assume you are sending \0x0 terminated strings. send() is not appropriate for binary text, and for long strings like this, I would recommend using send_P and knowing the length of your strings. Here's my example derived from yours. Note that strlen only works for zero terminated strings- you need to know the length of your strings in C code!.
|
@SuGlider Note, this is a bug in WebServer::send(). It should at least give some error as to why it is failing. I'm taking a look. |
Heh. https://github.com/espressif/arduino-esp32/blob/master/libraries/WebServer/src/WebServer.cpp#L430-L432 |
Board
ESP32S2MINI1U
Device Description
esp32-s2-mini-1_esp32-s2-mini-1u_datasheet_en.pdf
Hardware Configuration
ESP32-S2-DevkitM-1
v1.0
Version
other
IDE Name
Arduino IDE
Operating System
Windows10
Flash frequency
80Mhz
PSRAM enabled
yes
Upload speed
115200
Description
We are facing one more issue with web server library that is as we are sending request in "jquery.js" format with more than 60kb web server library is not supporting for esp32s2 , where as with esp8266 web server library there is no limitation with size. we also tried to include esp8266 web server library to esp32s2 its not supporting .we also tried webserver with "spiffs" library but it is supporting only "esptool.py" tool we have library with big sur tool so we are unable to proceed further.

Kindly support to resolve this issue to progress further.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: