SPIFFS clarification please

orbitcoms
Posts: 149
Joined: Fri Aug 03, 2018 10:08 pm
Location: Sydney, Australia

SPIFFS clarification please

Postby orbitcoms » Tue Mar 16, 2021 5:08 am

I am a bit confused about the spiffs base_paths and pointing to the different partitions using file functions.

Is the base path the actual path in your editor list where the files are kept and you set up and use like below?

Created 2 spiffs partitions
"log_recs" and "html_files"

I created 2 folders in my main editor for files like this
>main
>html_dir
>log_dir

Is the code below correct to configure and used both partitions? (Note I add spiffs_create_partition_image(html_dir ../ FLASH_IN_PROJECT)

#define log_file "log_recs/log.txt"

esp_vfs_spiffs_conf_t log_log_config = {
.base_path = "/log_dir",
.partition_label = "log_recs",
.max_files = 5,
.format_if_mount_failed = true,
};
esp_vfs_spiffs_register(&html_config);

//FILE * f = open(log_file,"w");

#define html_index "hmtl_files/index.html"

esp_vfs_spiffs_conf_t html_config = {
.base_path = "/spiffs/html_dir",
.partition_label = "html_files",
.max_files = 5,
.format_if_mount_failed = true};
esp_vfs_spiffs_register(&html_config);

FILE * f = open(html_index,"w");
esp_vfs_spiffs_unregister("html_files");

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Re: SPIFFS clarification please

Postby PeterR » Wed Mar 17, 2021 10:51 pm

I suspect that a little seeding on your part would be quicker than any one else unraveling your question.
You can fstat a partition and so work out how your config relates to the FS etc.
Or just a whole set of fopens working through the possible paths strings and printing the return code.....
& I also believe that IDF CAN should be fixed.

orbitcoms
Posts: 149
Joined: Fri Aug 03, 2018 10:08 pm
Location: Sydney, Australia

Re: SPIFFS clarification please

Postby orbitcoms » Wed Mar 17, 2021 10:54 pm

Sorry, I have no idea what you are talking about

Who is online

Users browsing this forum: Google [Bot] and 73 guests