ESP 32 NAS
I wanted to make a nas for my house, but I wanted it to be as cheap as possible and work on sd cards, so that I can take it with me on the go. I made a case with my 3D printer that looks like a satellite, and I also added RAID 0.
Created by
chakrish.ish
Tier 3
13 views
0 followers
Timeline
CAN ⚡🚀
submitted ESP 32 NAS for review ago
chakrish.ish
submitted ESP 32 NAS for review ago
Shaurya Bisht
requested changes for ESP 32 NAS ago
needs screenshots of the 3d models in the readme also add a picture and a schematic file of the wiring please!
chakrish.ish
submitted ESP 32 NAS for review ago
chakrish.ish
added to the journal ago
Implemented RAID 0!
After getting everything working with one SD card, I thought it would be cool to make it faster and more reliable by using 2 sd cards at once. I wired up a second SD card module and made them work together with RAID 0, to spread files across both files faster, since the normal method was slow for larger files.
It was tricky to get both cards to talk to the ESP32 at one time, since they share SPI pins. I had to switch between using them really fast with different CS pins. At first I broke the system, and wasn't able to upload files at all, but eventually it started to work properly.
I also made a smart system that automatically chooses which SD to write on based on how much free space there is on each, and it also checks the health of both cards. If one fails, it tells you, but you can keep using the other one.
I also added drag and drop and automatic folder creation and more error messages on the web page instead of everything being on the serial monitor.
The only problem is that it is slower now.



chakrish.ish
added to the journal ago
Polished website and added searching
After making the case, I thought it would be nice to make the webapp look a little nicer, and to have search functionality for larger sd cards with more files. I also readded the refresh button, because it was so convenient and I miss having it. I also made the delete and download buttons proper buttons, since it is easier to click and test. I also made it display the available ram on the esp32.

chakrish.ish
added to the journal ago
Created and assembled case
Now that I had a pretty decent NAS going with my ESP32, I wanted to make a case for it, mainly to protect it from dust, damage and things of that nature. In making the case, I went through 3 failed iterations:
- I started with a tight case that I thought would save space, but I miscalculated the dimensions, but thankfully I noticed this when the 3D printer had just started.
- My second one failed, since the opening I had made for the ESP32 to get power was raised too high.
- My 3rd one didn't technically fail, but after making it I realized it looked pretty ugly, and I wanted to make one that looked cooler.
I started by modeling a new case (this one fits the NAS properly) in Fusion 360. I thought a satellite looking case would be cool, so that is the theme I went with.

After that I used glue to put the case I 3D printed together.




chakrish.ish
added to the journal ago
New UI and folder creation
To make the web interface look cleaner and seem less haphazard, I built a new ui using TailwindCSS. It now also tells you what WiFi it is connected to and its speed. It also displays the IP on the web interface if using full screen with multiple windows. I also made it so that you can create folders on the SD card.

chakrish.ish
added to the journal ago
Refresh, download, delete and file viewing
I gave functionality to the buttons I created, and added a refresh button that lets you see changes made without having to refresh the whole tab. Uploading now supports files up to 10 MB, and the server now streams data directly onto the SD card instead of loading everything into RAM and then onto the SD. I also added handling for failed uploads and made sure downloads always deliver the correct content length so the browser doesn’t corrupt anything (it was downloading as .file instead of as the correct type of file). I also made it so that when you upload a file it says how much space the file takes up.

chakrish.ish
added to the journal ago
HTTP Server and Authentication
I built the web server endpoints for root, file list, download, upload an delete. I added basic authentication and a login system (from browser). I also added browser alerts and verified access control. I also made it easier to look through the files on the SD card.


chakrish.ish
added to the journal ago
Created watchdog
I made sure that if the sd doesn't connect properly, it just doesn't load the web page, so I don't have to open serial monitor each time. I also made a 30 second watchdog timer to make sure that it catches freezes. I also tested system for lockups.

chakrish.ish
added to the journal ago
WiFi and SD Card connection
Since I could reliably upload and delete files from the SD card, I made sure that I could do it via internet by making the ESP32 create its own WiFi network. This allowed for faster speeds than connecting to a mutual network, so it made things a lot easier to test. I tested by uploading and deleting small files from the ESP32.


chakrish.ish
added to the journal ago
Connected ESP32 to SD Card
To begin the project, I wired an SD card module to my ESP32 Dev Board. I had never used a SD card module before so I had to figure out the wirings. I then attempted to make it read and write files onto the SD card. It failed, so I swapped SD cards and it then worked after formatting the SD card fully (instead of quick formatting it). After I was able to do that, I made sure that the ESP32 could reliably delete files. I had to make sure that when the SD card didn't work after working for a few times that the issue was in the module and not the SD, which I then swapped out.

chakrish.ish
started ESP 32 NAS ago