BrewManiacEsp8266 icon indicating copy to clipboard operation
BrewManiacEsp8266 copied to clipboard

how install audio files in esp32

Open felipeserta opened this issue 2 years ago • 10 comments

The code runs perfectly in esp32 but i dont know how to install the audio files. I tried copy files to esp32 via http://bm.local:8008/filemanager in the same way I did with esp8266 without sucess and file names lost the first letter. How to solve this issue. Thanks

image

felipeserta avatar Oct 07 '22 16:10 felipeserta

Also, after saving a recipe file it doesnt apear in saved list for future use. Maybe the cause is the diference in file names without the first letter. I ll try to download to a different esp32 board.

thnaks

felipeserta avatar Oct 10 '22 19:10 felipeserta

Which version do you use? I know there are issues about file names because of difference between SPIFFS and LITTLEFS. I've spent some time on this.

vitotai avatar Oct 11 '22 04:10 vitotai

I´m using last one, version 0.5.1. Yesterday I tried new board and update firmware esp32 to 5.2.0 without success. I tried to upload files creating a data folder and upload via platformio but in file manager lost the first letter again. thanks for any help.

felipeserta avatar Oct 11 '22 11:10 felipeserta

I am sorry by neglecting BrewManiacEx in this issue when I had fixed this in BrewPiLess. Please check the latest update.

vitotai avatar Oct 14 '22 06:10 vitotai

After a tried the new code the first letter apears again but without R/ at recipes files.

Before that I did the changes below and worked at filemanager image

At ESPAUpdateServer.cpp I made this changes static void handleFileList(void) { .... #if UseLittleFS output += entry.name(); #else //new code #if ESP32 output += String(entry.path()).substring(1); #else output += String(entry.name()).substring(1); #endif #endif //end of new code output += ""}";

But I still can´t retry recipes files image Serial print shows at this time image

I didn´t try brewlogs yet but show this image

Thanks a lot

felipeserta avatar Oct 14 '22 14:10 felipeserta

Vito, Recipes now work with few modifs image in BrewmaniacEx.cpp void listDirectory(const String& path,String& json){

	#if !UseLittleFS
	uint16_t len=path.length();
	#endif
	#if ESP32
	String tpath = path.substring(0,(len-1)); //to remove "/" from path "/R/"
	File dir = FileSystem.open(tpath);
	//File dir = FileSystem.open("/R"); //temporary test works fine 
	#else
	Dir dir = FileSystem.openDir(path);
	#endif

	json=String("[");
	bool comma=false;


	#if defined(ESP32)
	File entry = dir.openNextFile();
    DBG_PRINTF("LS path %s listdir:%s\n",path,String(entry.path()).substring(1));
	while(entry){
		 // String file=entry.name();

//new code String file= String(entry.path()).substring(len); #else

Best Regards, Felipe

felipeserta avatar Oct 14 '22 18:10 felipeserta

Brew logs are being saved, but still get this empty logs, I did not remember in other versions. image thanks

felipeserta avatar Oct 14 '22 19:10 felipeserta

I tried and found out that the latest SPIFFS of ESP32 framework might have issue with directory listing. I inserted a test code to create a file with subdirectory, but it appeared in root directory.

It might take a while to solve this issue. Well, It might never be solved.

I tried with LittleFS, and it seems to work.

BTW, I have issues with SPIFFS on BrewPiLess after running for 3 months. I am now switching to LittleFS and running.

vitotai avatar Oct 15 '22 09:10 vitotai

Sure looks like new issues with spiffs libs. With the changes above it behaves like previous version and everything is working filemanager, recipes and logs with esp32. Now I´ll take a look at audio files. Little FS looks like a better and cleaner code. Thanks

felipeserta avatar Oct 15 '22 13:10 felipeserta

After uploading sounds.json and sounds.mp4 I forgot to configure webpage to allow sound. All fine by now.

thks

felipeserta avatar Oct 15 '22 14:10 felipeserta