-
Notifications
You must be signed in to change notification settings - Fork 7.6k
SPIFFS + ESP32 Sketch Data Upload Problem (mkspiffs) #1022
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
Comments
Bug in Arduino-esp32 after 20/12/2017 ... duplicate issue: me-no-dev/arduino-esp32fs-plugin#6 (comment) and original source of solution(tips): https://www.mgo-tec.com/blog-entry-esp32-spiffs-easy-websocket-library.html |
@me-no-dev Here it's working after change |
Where is it in Arduino IDE? |
@smacyas this option is only available using arduino as IDF component... For Arduino IDE it depends of @me-no-dev recompiles the core |
@copercini thanks. Will be waiting for @me-no-dev recompile |
@copercini from your message i understood that was from the configs of the components itself, but actually, you must change this value from |
@copercini There is a file Arduino\hardware\espressif\esp32\tools\sdk\include\spiffs\spiffs_config.h, may be this option (size of per-file metadata field) is there can be defined? |
okey, if it is so long to recompile core with newest IDF with this bug fix, may be someone will tell how to do it myself to make arduino-esp32 from IDF? |
Pretty sure this problem is because of the change to the definition for SPIFFS_OBJ_META_LEN in spiffs_config.h that occurred a while back, but @me-no-dev will need to confirm. There was no corresponding change to the data upload plugin https://github.com/me-no-dev/arduino-esp32fs-plugin and that means file objects created by the plugin are no longer compatible with the SPIFFS library. As a temporary workaround I defined SPIFFS_OBJ_META_LEN to be 0 in Arduino/hardware/espressif/esp32/tools/sdk/include/spiffs/spiffs_config.h, then restarted the IDE. Reading uploaded data works fine for me now. |
Hello, |
@bospre, that is the only change I made, along with restarting the Arduino IDE. Before the change file.read() returned bogus data. After the change all is good. EDIT: Actually there was more thing I did that is what made the real difference -- see next sentence below: EDIT: Turns out the real workaround is just to run the SPIFFS_Test.ino program after uploading your data file. As part of that test, the program writes a 1MB test file and writing that file somehow makes the uploaded data file subsequently readable. |
@tferrin I think is rather impossible that you changed only the define in the 'spiffs_config.h' include file to the binary "libspiffs.a" is already compiled with the other setting and your define doesn't affect the code inside you'd have to recompile or get another "libspiffs.a" already compiled with the header modified setting |
So to fix this SPIFF issue then (one of both) |
I do not know why official person (@me-no-dev ) does not recompile the core |
@smacyas thank you |
@smacyas I suspect @me-no-dev is enjoying the Spring Festival or otherwise busy. He has been pulled into a number of things. |
As per (espressif/esp-idf#1610 (comment)), @igrr has provided a 0.2.2 version () of mkspiffs that can be downloaded on its own (https://github.com/igrr/mkspiffs/releases/tag/0.2.2) until @me-no-dev spins a new version. |
adopting the @igrr solution on espressif/esp-idf#1610 calling anyway now seems to work |
I'm honestly a bit confused still, so hopefully somebody can explain this. What is the correct way to fix this? It is a bit of a hack to manually download the new mkspiffs and drop it in the tools post install. After switching to the head of master and updating my git submodules, it looks like tools/mkspiffs/ is no longer part of the git repo? Does a submodule need to be added/modified? What needs to be done so that people who install arduino-esp32 actually get a working mkpsiffs? |
As @lonerzzz pointed out above, you need download and install version 0.2.2 of mkspiffs. It gets installed in hardware/espressif/esp32/tools/mkspiffs. |
Sorry I wasn't clearer. I would consider @lonerzzz's solution a workaround, not a fix. Previously, arduino-esp32 provided the tool (I'm not sure if it was a submodule, or if it was included directly, but either way when I followed the install procedures, it was there). It looks like that is no longer the case. So, I could see one of the following being done:
As a user of this library, I would prefer to see either option 1 or option 2, since the tool is located within the arduino-esp32 tree. If it is no longer appropriate for mkspiffs to be an esp32 tool, then the arduino-esp32fs-plugin should be updated to include its own copy of mkspiffs (and people probably shouldn't be directed to include it in the tools directory). |
I'm sure this will be fixed in due time. There has been some lag in commits during the past month due to work on other projects by key contributors. And please note that there has yet to be an actual release of the arduino-esp32 core, so officially it's all still experimental code. If you want a code base that is better supported you should consider the official Espressif IoT Development Framework -- https://github.com/espressif/esp-idf. It sees more active development and commits to the code base and is at the release 3.0-rc1 stage. (Not trying to be a nerd or make excuses. Just observations by one of many code contributors.) |
Sure, and I get that this is still experimental/in development. I dug a bit more into the get.py script that is part of the install, and it looks like with a few minor changes there it is easy enough to pull in the correct mkpsiffs. I'll submit a pull request with those changes. |
Thanks @tferrin for the explanation :) Works like a charm for me on MacOS with Arduino 1.8.5 ! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
Hardware:
Board: ?ESP32 Dev Module?
Core Installation/update date: latest
IDE name: Arduino IDE
Flash Frequency: 40Mhz?
Upload Speed: 115200
Description:
Hello.
I need help.
I have WROOM-32 ESP32 module.
In folder of my ino-project I created folder ‘data’ and put into it some files: css, html, txt by ESP32 Sketch Data Upload (https://github.com/me-no-dev/arduino-esp32fs-plugin), I have uploaded them successfully to my module.
When I try to read file from SPIFFS (previously mounted SPIFFS, of course) (latest arduino-esp32, https://github.com/espressif/arduino-esp32), listDir(SPIFFS, "/", 0) - OK; but while I use readFile(SPIFFS, "/style.css"); there is some trash, but no correct data. When I use write and read file, which was NOT uploaded by ESP32 Sketch Data Upload, it is OK.
By the way, I noticed string: flash read err, 1000 ets_main.c 371
Any ideas?
Thanks.
Sketch:
Debug Messages:
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078a58
Starting device...
ESP32 Chip ID: 9238022
FreeHeap: 126324
ChipRevision: 1
CpuFreqMHz: 240
SdkVersion: v3.1-dev-239-g1c3dd23f-dirty
FlashChipSize: 4194304
FlashChipSpeed: 40000000
FlashChipMode: 2
SPIFFS Mount succesfull:
Listing directory: /
FILE: /door.png SIZE: 846
FILE: /favicon.ico SIZE: 239
FILE: /index.html SIZE: 4875
FILE: /logo.png SIZE: 5075
FILE: /profile.png SIZE: 898
FILE: /style.css SIZE: 5844
FILE: /style.txt SIZE: 101
FILE: /variables.txt SIZE: 41
Started WiFi Station Terminal Access (STA) regim
Current SSID: myssid
ESP32 MAC STA: [D][WiFiGeneric.cpp:293] _eventCallback(): Event: 2 - STA_START
30:AE:A4:06:F6:8C
[D][WiFiGeneric.cpp:293] _eventCallback(): Event: 1 - SCAN_DONE
[D][WiFiGeneric.cpp:293] _eventCallback(): Event: 4 - STA_CONNECTED
[D][WiFiGeneric.cpp:293] _eventCallback(): Event: 7 - STA_GOT_IP
WiFi connected
WiFi channel: 1
WiFi RSSI: -56
192.168.200.162
Reading file: /style.css
Read from file: яяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяя
The text was updated successfully, but these errors were encountered: