[E][vfs_api.cpp:243] VFSFileImpl(): fopen(/spiffs/DeviceInfo.inf) failed

PreetiN
Posts: 4
Joined: Sat Jun 05, 2021 10:45 am

[E][vfs_api.cpp:243] VFSFileImpl(): fopen(/spiffs/DeviceInfo.inf) failed

Postby PreetiN » Sat Jun 05, 2021 12:02 pm

Module or chip used: ESP32-WROOM-32D
Operating System: Windows
Using an IDE: Visual Studio Code
Extensions used in Visual Studio Code: Platformio IDE V1.10.0, C/C++ V1.4.0
Power Supply: external 5V

Elaborating the issue a bit. I have attached a small sketch below which shows how the data is written into the file and retrieved from it. Also I have attached the output which shows fopen failed. This might not be the case every time, in fact the code works successfully in some of the Esp32 devices.

The Firmware contains the data folder containing empty files as ConnectionInfo.inf, DeviceInfo.inf, AlertSettings.inf, DeviceModelSensorInfo.inf, CalibrationInfo.inf, CalibValuesInfo.inf and is uploaded using Visual Studio Code Platformio.
But once the data is written to the file ConnectionInfo.inf or in DeviceInfo.inf and even in the remaining .inf files,
on rewriting the files for the second time or so, the Esp32 throws an error as fopen(/spiffs/ConnectionInfo.inf) failed.

Additional Firmware Logic:
Also the Esp32 has some files saved spontaneously in SPIFFS when the internet goes down and the files gets automatically deleted when the internet is available again.
How many files each of around 100 bytes can be stored in SPIFFS?

The Partition used in ESP32-WROOM-32D is as attached below for your reference.
Also a code snippet is attached where data is written to a file and and retrieved from the file.
https://drive.google.com/file/d/1n7r_81 ... sp=sharing
The output too is attached below.
Attachments
Output.txt
(521 Bytes) Downloaded 354 times
vi-partition.csv
(237 Bytes) Downloaded 360 times


Who is online

Users browsing this forum: No registered users and 53 guests