-
Notifications
You must be signed in to change notification settings - Fork 239
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
Inconsistent use of "root" or "/spiffs/" in file module across esp8266 and esp32 targets? #208
Comments
@jim80 - I tested the httpserverputfile app unmodified on both my Moddable One ESP8266 and Moddable Two ESP32 products. The application worked as expected on both devices. For testing I used this cURL command line:
SPIFFS is supported for both ESP32 and ESP8266, though they are different implementations. On ESP32, you are required to prepend the file root The SPIFFS file system is flat. There are no directories. So if you write a file on ESP8266 named We specify the I hope this helps to clarify your understanding. Regards, |
Yes, it does, many thanks Brian! |
@jim80 - No worries... When running the example using the cURL command line I previously used, the application traces the following to the console:
The example app doesn't try to address platform specific rules regarding file system roots. The app demonstrates the basics on how to implement an HTTP server that accepts the request body in fragments and save those fragments to a file. You had written that the app didn't work for you on ESP32. The cURL command line I provided shows how to make the app work on both ESP8266 and ESP32 by modifying the cURL HTTP URI path. Tracing out the
In my version the path traced is The technique I used leverages the fact that ESP32 requires files to use the Regards, |
So I first noticed this in testing some other code, using /examples/...../httpserverputfile/ to upload a few files for testing on ESP8266 - that worked fine. I then plugged in an esp32 and built for that, and it gives "file Not found" exceptions.
So, I modified it to prepend "/spiffs" to the filepath before opening the file, and yes, it worked fine.
Back to the esp8266, and I upload and test my modified example, which works, but leads to files named "/spiffs/test.jpg", for example.
So, point one - the example doesn't work as is for esp32 ("on my computer").
Point 2 - I'm now a little confused! I know that I should really use the config.file.root from the file manifest, but it's actually the same for both build targets :
"esp": { "modules": { "*": "$(MODULES)/files/file/esp/*" }, "config": { "file": { "root": "/spiffs/" } } }, "esp32": { "modules": { "*": "$(MODULES)/files/file/esp32/*" }, "config": { "file": { "root": "/spiffs/" } } },
Any clarification would be much welcomed, many thanks!
The text was updated successfully, but these errors were encountered: