2.5 KiB
2.5 KiB
SD Card Setup Instructions for HannaBox
Required Directory Structure
Your SD card must have the following directory structure for the HannaBox to work properly:
SD Card Root/
├── system/
│ ├── style.css (Web interface CSS - copy from web/style.css)
│ ├── script.js (Web interface JavaScript - copy from web/script.js)
| ├── index.html (homepage - copy from web/index.html)
│ ├── start.mp3 (Startup sound)
│ └── sleep.mp3 (Sleep sound)
├── [your music folders]/
└── [your music files]/
Setup Steps
-
Format your SD card (FAT32 recommended)
-
Create the system directory:
- Create a folder named
systemin the root of your SD card
- Create a folder named
-
Copy the web interface files:
- Copy the file
web/style.cssfrom this project tosystem/style.csson your SD card - Copy the file
web/script.jsfrom this project tosystem/script.json your SD card - Copy the file
web/index.htmlfrom this project tosystem/index.htmlon your SD card - These files contain all the styling and functionality for the web interface
- Copy the file
-
Add sound files (optional):
- Copy
sounds/start.mp3tosystem/start.mp3on your SD card (startup sound) - Copy
sounds/sleep.mp3tosystem/sleep.mp3on your SD card (sleep sound)
- Copy
-
Add your music:
- Copy your MP3 files and folders to the root of the SD card
- The HannaBox will automatically scan and build a directory tree
Memory Optimization
By moving the CSS and JavaScript files to the SD card, we've freed up approximately 7-8KB of flash memory on the ESP32. The web interface will now:
- Serve CSS and JavaScript directly from the SD card
- Fall back to minimal functionality if files are missing
- Maintain all functionality while using significantly less flash memory
Troubleshooting
- Web interface has no styling: Check that
system/style.cssexists on your SD card - Web interface not working properly: Check that
system/script.jsexists on your SD card - SD card not detected: Ensure the SD card is properly formatted (FAT32) and inserted
- Files not loading: Verify the file paths are exactly
/system/style.cssand/system/script.js(case sensitive)
File Locations
- Source files:
web/style.cssandweb/script.js(in this project) - Target locations:
system/style.cssandsystem/script.js(on SD card) - Fallbacks: Minimal CSS and JavaScript if files are missing