Closed tipeter closed 3 years ago
Why not figuring it out and creating a PR ?
Did you reduce max PATH for ESP8266 the same way was done on ESP32? Reducing max path prevented stack overflow on ESP32.
Thanks for the idea, I will look into it. Although with ESP8266 it is an additional complication that the only somewhat working debug solution is printf. I have tried JTAG, it works for the most part but in practice it is not very useful.
Why not figuring it out and creating a PR ?
You're right, but I've only been working with ESP8266 for a few weeks and the documentation for the platform is inadequate to say the least. I develop primarily on STM32, it's a whole different world. My biggest problem with the ESP8266 is that I don't know which SDK to use in the long run. I would like to develop on it at least approximately like I did on the STM32. I am currently trying ESP8266_RTOS_SDK and the SMING Framework. I favor the former because of FreeRTOS, but Espressif doesn't really keep it up anymore. Perhaps you as an experienced developer would recommend? ESP32 is currently out of the question, I need to find a solution for ESP8266. Many thanks!
@tipeter thanks for the context.
For ESP8266, there are historically two SDKs: a baremetal non-OS and FreeRTOS-based. Espressif supports only the 2nd one, FreeRTOS based, in the long run. However many projects (like arduino infrastructure for ESP8266) are still on non-OS due to various reasons.
So to answer your question: on ESP8266, an rtos-based SDK should be used. SMING is nonOS based, and from a first glance, looks kinda familiar to Mongoose OS, another product of ours. If you plan to use a framework, take a look at mongoose os.
@cpq Thanks a lot for the advice!
@tipeter Out of curiosity, could you elaborate on why to switch from STM32 line to ESP8266? ST provides its own connectivity options.
I have not changed at all! However, I have a project I need to solve with EPS8266. Basically, the ESP8266 as a device is interesting to me, but I didn't think it would be so problematic... :)
From what I can tell, ESP8266 is obsoleted by ESP32S2 (which is a cut-down version of ESP32, without bluetooth). There are many projects that employ ESP8266 historically, but I can see no justification sticking to ESP8266 for any new development.
For a production project that needs security, ESP8266 is basically a no-go. Too many issues to even consider it.
@tipeter please modify mongoose.h in the following way:
diff --git a/mongoose.h b/mongoose.h
index e4ce27f8..09a9a6d5 100644
--- a/mongoose.h
+++ b/mongoose.h
@@ -229,8 +229,13 @@ static __inline struct tm *localtime_r(time_t *t, struct tm *tm) {
#include <esp_system.h>
+#undef MG_PATH_MAX
+#undef MG_ENABLE_DIRLIST
+
#define MG_DIRSEP '/'
#define MG_INT64_FMT "%lld"
+#define MG_PATH_MAX 128
+#define MG_ENABLE_DIRLIST 1
#endif
Then rebuild and report.
Hello! Thanks for addressing this issue! Unfortunately, I had a very busy week and only now was able to address this topic. I have made the changes. The file list is now displayed in the browser, but it still restarts the MCU with stack owerflow. I'll try to debug it in the next few days and report back! Yesterday I tried Mongoose OS. I followed the quick start guide using ESP8266 and ESP32. The ESP8266 (1M and 4M flash models) crashed with a stack overflow error. The ESP32 worked. Maybe ESP8266's limited SRAM is causing the issue.
Closing this issue.
I also noticed that the current ESP8266 example does not even use the filesystem.
Feel free to reopen when you have time to reproduce. Make sure to include the full source code, and use the latest codebase.
Hello! I tested the fix on ESP8266. The directory listing now appears, but the files are missing from the list. (Empty list) The SPIFFS partition contains files (see the listing in the log). MCU still crashes.
Environment
My log: