hoeken / PsychicHttp

Simple + Robust HTTP/S server with websockets for ESP32 based on ESP-IDF http server.
MIT License
119 stars 28 forks source link

sdcard (request info) #101

Closed Red-Owl closed 1 month ago

Red-Owl commented 3 months ago

server.serveStatic("/", SD, "/")->setFilter(ON_STA_FILTER); // request is "/sd" (mountpoint of sd) i use "/" root filesystem ^^^ error 404

server.serveStatic("/favicon.ico", SD, "/start/favicon.ico"); this found display my icon tnx for support

hoeken commented 2 months ago

Can you explain this problem a little bit more?

Red-Owl commented 2 months ago

It does not display any files present on the SD card, and returns 404

hoeken commented 2 months ago

I just got a board with SD card today, so I can test this if we find a real bug.

server.serveStatic("/", SD, "/")->setFilter(ON_STA_FILTER);

This code will serve the file at the request url from the / directory of the sd card. eg. request for /favicon.ico will look for sd /favicon.ico

It will also only serve the file through the STA interface (when esp32 is in client mode).

server.serveStatic("/favicon.ico", SD, "/start/favicon.ico");

If this code is working, then that means your web files are in sd: /start/ Try changing your first code to:

server.serveStatic("/", SD, "/start");

hoeken commented 1 month ago

I just pushed 09a04c76bf9f317a54216407106f69c9072741cb to #v2-dev with example of sd card. its working fine. if you're still having troubles, please re-open.

Red-Owl commented 1 month ago

Unable to allocate memory. (lvgl, i2s, wifi, sd, usb, ledc) remain free 32824 on call webserver from firefox wifi stop repsponse a ping

Serial.println( ESP.getFreeHeap() ); on esp32 webserver run (wifi psychicHttp) run