How to let webserver access file system of the SD Card

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: How to let webserver access file system of the SD Card

Postby snahmad75 » Wed Nov 28, 2018 11:23 am

Gfast2 wrote:
Mon Nov 06, 2017 7:45 pm
Hi ESP-IDF,

I just wunder, how to let ESP32 plays like a traditional static webserver?

My goal ist to let Mongoose Webserver access the virtual filesystem of SD card, and fetch the file that the webserver need.

I got this idea from Mongoose's stock example HERE
This is the code snippet that do the magic, and which also not works on my machine:

Code: Select all

  
  mg_set_protocol_http_websocket(nc);
  s_http_server_opts.document_root = ".";  // Serve current directory
  s_http_server_opts.enable_directory_listing = "yes";
 
---
The following is actually another question:
Right now i just specify one task for Webserver, one for SD Card I/O.
It that possible to pass file pointer between tasks? If yes, is that good practise?

Thanks

Gfast2
Does enable_directory_listing works for ESP32 WROVER with SD card. Does Web browser shows list of folders and files.

User avatar
Gfast2
Posts: 182
Joined: Fri Aug 11, 2017 1:52 am

Re: How to let webserver access file system of the SD Card

Postby Gfast2 » Thu Nov 29, 2018 12:48 pm

snahmad75 wrote:
Wed Nov 28, 2018 11:23 am
Gfast2 wrote:
Mon Nov 06, 2017 7:45 pm
Hi ESP-IDF,

I just wunder, how to let ESP32 plays like a traditional static webserver?

My goal ist to let Mongoose Webserver access the virtual filesystem of SD card, and fetch the file that the webserver need.

I got this idea from Mongoose's stock example HERE
This is the code snippet that do the magic, and which also not works on my machine:

Code: Select all

  
  mg_set_protocol_http_websocket(nc);
  s_http_server_opts.document_root = ".";  // Serve current directory
  s_http_server_opts.enable_directory_listing = "yes";
---
The following is actually another question:
Right now i just specify one task for Webserver, one for SD Card I/O.
It that possible to pass file pointer between tasks? If yes, is that good practise?

Thanks

Gfast2
Does enable_directory_listing works for ESP32 WROVER with SD card. Does Web browser shows list of folders and files.
Thanks, I will check this out when I have the next possibility accessing my dev enviroment in near future!

Thanks again!

LG

Su

sam_uk
Posts: 3
Joined: Thu Jun 13, 2019 12:27 pm

Re: How to let webserver access file system of the SD Card

Postby sam_uk » Thu Jun 13, 2019 12:57 pm

Hi I just brought one of these

https://www.ebay.co.uk/itm/Bluetooth-De ... 2749.l2649

I'm hoping to run a web server on it and access the files in the SD card.

What's the best way of doing this with this hardware in 2019?

<edit> This looks promising is it any good

https://github.com/espressif/arduino-es ... DWebServer

Who is online

Users browsing this forum: OSCPUDEV and 106 guests