From 177530d03072b4805611960f910e74d8cd66c031 Mon Sep 17 00:00:00 2001
From: Stefan Ostermann
Date: Sun, 27 Jul 2025 12:37:21 +0200
Subject: [PATCH] File manager
---
src/main.cpp | 12 ++++++---
web/index.html | 27 +++++++++++++++++---
web/script.js | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 100 insertions(+), 6 deletions(-)
diff --git a/src/main.cpp b/src/main.cpp
index 1715a99..5a53854 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -18,6 +18,7 @@
// define pins for RFID
#define CS_RFID 32 // SIC, tried 4 and 32 but only this worked!
#define RST_RFID 33
+// this does not work as the irq pin is input only:
#define IRQ_RFID 34
// Audio DAC
@@ -471,6 +472,11 @@ String getState()
else
jsonState["title"] = "Angehalten"; // Store in flash
+ if (currentNode != nullptr)
+ jsonState["filepath"] = currentNode->getCurrentPlayingFilePath();
+ else
+ jsonState["filepath"] = "";
+
jsonState["time"] = audio.getAudioCurrentTime();
jsonState["volume"] = audio.getVolume();
jsonState["length"] = audio.getAudioFileDuration();
@@ -717,8 +723,8 @@ void setup()
pinMode(BTN_NEXT, INPUT_PULLUP);
pinMode(BTN_PREV, INPUT_PULLUP);
- /* setup the IRQ pin*/
- pinMode(IRQ_RFID, INPUT_PULLUP);
+ /* setup the IRQ pin, not working because the pin is input only:*/
+ //pinMode(IRQ_RFID, INPUT_PULLUP);
pinMode(CS_RFID, OUTPUT);
pinMode(CS_SDCARD, OUTPUT);
@@ -792,7 +798,7 @@ void setup()
AsyncWiFiManager wifiManager(&server, &dns);
// Memory optimizations for WiFiManager
- wifiManager.setDebugOutput(false); // Disable debug strings
+ wifiManager.setDebugOutput(true); // Disable debug strings
wifiManager.setMinimumSignalQuality(20); // Reduce AP scan results
wifiManager.setRemoveDuplicateAPs(true); // Remove duplicate APs from memory
diff --git a/web/index.html b/web/index.html
index ca3c825..3ad48dc 100644
--- a/web/index.html
+++ b/web/index.html
@@ -40,7 +40,15 @@
%DIRECTORY%
-
- Edit RFID Mapping
+ Edit RFID Mapping
+ Move / Rename File
+
+
+
+
+
+
+ Delete File
+
+
+
+
+