I am working on ESP32_Core_board_v2. I am developing an application in which I need to develop http web-server which presents static web pages when requested by http client. I followed discussion at http://www.esp32.com/viewtopic.php?t=676 and tried but didn't succeed. Need help regarding what I am missing.
I made SPIFFS image using https://github.com/igrr/mkspiffs tool. That has 3 static pages. The output of ./mkspiffs -l command on the image is:
Code: Select all
9774 /resource/image.png
5251 /resource/index.html
2650 /resource/ajax_script.js
The vfs structure is assigned values as below:
Code: Select all
vfs.flags = ESP_VFS_FLAG_DEFAULT;
vfs.write = esp_vfs_write;
vfs.read = esp_vfs_read;
vfs.open = esp_vfs_open;
Code: Select all
esp_vfs_register("/resource", &vfs, NULL);
Now, I am trying to open index.html file like shown below:
Code: Select all
open("/resource/index.html", O_RDONLY);
Thanks!