More photos and the article about this project are here.
The idea is to build drive distributed storage device with FTP interface on Node.js.
- distributes files on a bunch of USB-drives
- keeps up file duplication for redundancy
- provides FTP interface.
4Gb USB-drive -| *-----------------------*
4Gb USB-drive -| | S T O R A G E |
4Gb USB-drive -|<--->| 6.6Gb capacity |<---> FTP client
4Gb USB-drive -| | 3 copies of each file |
4Gb USB-drive -| *-----------------------*
... or 10Gb storage (2 copies of each file).
Tested with Raspberry Pi 3.
Almost complete list of used components:
- 1 x RPi 3 (ID:3055) = $35.00
- 1 x Pimoroni Micro Dot pHAT with Included LED Modules - Red (ID:3248) = $29.95
- 4 x USB 3.0 4-Port USB Hub (eBay) = $16.40
- 1 x 8GB Class 10 MicroSD Memory Card (ID:2692) = $9.95
- 2 x DC 0-3V Analog Voltmeter (eBay) = $8.56
- 1 x Mini Panel Mount SPDT Toggle Switch (ID:3221) = $0.95
- 1 x Slim Metal Potentiometer Knob - 10mm Diameter x 10mm - T18 (ID:2058) = $1.90
- 1 x Solid Machined Metal Knob - 1" Diameter (ID:2056) = $3.95
- 2 x Mini 8-Way Rotary Selector Switch - SP8T (ID:2925) = $3.90
- 2 x LED diode - red and yellow
Box and indicators blueprints.
RPi PIN connections:
- pHAT
- for selectors, gauges, leds and toggle switch look for
const PIN = ...
for each component's class: src/hardware.
I used 3A power supply which enough just for 4 USB-drives.
Disclaimer: this is a proof of concept device and cannot be used as reliable place to store your data.
- Install Raspbian SSH and WiFi configuration instruction
- SSH to RPi (how to find RPi in the network)
- Install dependencies:
sudo su # install deps apt-get install -y gcc g++ make git vim htop; # set timezone echo "America/Los_Angeles" > /etc/timezone dpkg-reconfigure tzdata # install nodejs curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - apt install -y nodejs # install application git clone https://github.com/antonfisher/sloth-storage.git cd sloth-storage npm install cd src/hardware npm install cd - # display curl -sS https://get.pimoroni.com/microdotphat | bash # https://pinout.xyz/pinout/micro_dot_phat
4. GPIO configuration:
```bash
sudo cat >/etc/udev/rules.d/20-gpiomem.rules <<EOF
SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio", MODE="0660"
EOF
sudo usermod -a -G gpio pi
sudo usermod -a -G gpio root
Note: RPi doesn't mount USB storage devices automatically.
# mount usb storage devices
npm run mount # show available devices
npm run mount:do # mount available devices
# start application on RPi
npm run rpi
IP:7002
# "Anonymous" user
# unmount all mounted usb storage devices
npm run umount:do
# show full help
npm start -- --help
# run only application
npm start
# set different device path (not /media/<USER>)
npm start -- --devices-path <path>
MIT License. Free use and change.