The PiDrive Node Zero with a little bit of clever scripting can be made into a Wireless Mobile Backup Machine. ie., An alternative to the Seagate Wireless Plus / Corsair Voyager Air / WD My Passport Wireless range of devices.
Our aim was to have a Pi assembly that can :
- Detect & Automatically back up SD Cards
- Function as an Access Point so that Phone snaps can be backed up over WiFi.
- Function as a wireless Hub so that Devices connected to the PiDrive Node Zero can view backed up Photos and Videos.
- Function as a Portable Shared Drive
The PiDrive Node Zero is a Pi Zero mated with a 314 GB Drive via a bespoke Interface. Priced at 45 $ on the WD Labs site, It is a clever little device that comes with 2 USB ports, a mini HDMI port a Micro USB Power input. We thought the PiDrive Node Zero measuring at 14 cms x 7 cms x 1.5 cms (with the wifi dongle) and with 314GB was an ideal candidate for this Projpi project.
We used the Raspberry Pi USB Dongle to connect to the internet and eventually, function as a WiFi wireless Hub. The Pi USB Dongle is a nano usb dongle with native Raspbian support and is based on the BCM43143 chipset (802.11b/g/n) with150Mbps maximum throughput.
This Project references :
- Little Backup Box by Dmitri Popov (firstname.lastname@example.org), Author of The Linux Photography Book.
- Raspberry Pi WiFi Access point using Hostapd by Phil Martin
(Two excellent guides and all Credit goes to these authors for their very useful work.)
- We recommend connecting the PiDrive Node Zero to a monitor and Keyboard. Since the WiFi dongle will need to be configured as an accesspoint outlet, SSH is not going to be possible.
- Download and install the Little Backup box script.
- Edit the script so that Pi does not shutdown automatically.
- Install Samba and Configure a Public shared folder.
- Configure MiniDLNA server.
- Lastly, Install and configure Hostapd to make the Pi a wireless accesspoint.
Time and Difficulty :
- Time : 45 to 60 mins once you have the Raspbian Image file and the rest of the software.
- Newbie Difficulty level : Moderate ; Will need to use terminal and type in commands.
What you will need :
- WD PiDrive Node Zero
- Raspberry Pi compatible WiFi dongle
- SD or Micro SD Card that fits into your Pi (4GB or above is recommended)
- USB Keyboard and Mouse
- Connection to a TV or Monitor
STEP 1 : Update the Pi
Log in to Raspbian and enter the following commands into the terminal :
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
The steps above will update the software and the raspbian distribution to the latest available.
reboot your pi with “sudo reboot“
STEP 2 : Install Mini Backup Box script
Enter the following command into the terminal. It is a single one line entry that will download, install and configure the Pi to run as a Mini Backup Box :
cd ~ && wget https://chiselapp.com/user/dmpop/repository/little-backup-box/tarball/little-backup-box.tar.gz && tar xzvf little-backup-box.tar.gz && cd little-backup-box && chmod +x install-little-backup-box.sh && ./install-little-backup-box.sh
Be Patient, will take a bit of time as the Pi displays the script running as the packages download and install.
Once you are back to the command prompt at the terminal, The PiDrive Node Zero is configured to automatically, detect a SD Card / USB when connected to it, Copy files and Shutdown.
We will now need to edit the script so that the Pi Does not shutdown automatically. Navigate to the Little Backup Box folder and edit the Script by entering the commands into the terminal :
sudo nano backup.sh
Navigate to the bottom of the Script file and add a
shutdown -h now so that the Line now reads as
# shutdown -h now
The Pi is now configured to wait till a card is inserted, Flash the LED in a heart beat Pattern while the back up is ongoing and stop the LED flashing after back up completes with out shutting down automatically.
STEP 3 : Install & Configure Samba as a Public share.
A Samba shared folder along with a WiFi accesspoint, will allow mobile Phones to backup and browse photos to the PiDrive Node Zero’s shared folder wirelessly.
To install Samba, Enter the following commands at the terminal :
sudo apt-get install samba samba-common-bin
Backup the Native Samba configuration file and then edit the Samba configuration file by entering :
sudo cp /etc/samba/smb.conf /etc/samba/smb-conf.bak
sudo nano /etc/samba/smb.conf
To Give a name to the Pi, in [global] section, under workgroup = WORKGROUP, add :
netbios = Little Backup Box
Navigate down to Share Definitions and delete all the lines below that section. Then add the lines below to make the Little Backup Box’s backup folder a Public share :
[Little Backup Box's Share]
path = /media
comment = Public Share Folder
guest ok = yes
read only = No
create mask = 0777
directory mask = 0777
Change the Tiny Backup Box’s media folder to a public share and Restart Samba by entering :
sudo chmod 777 -R /media
sudo service smbd restart
sudo service nmbd restart
The Pi is now configured to share the Backup Box’s Folder as public drive via the Samba protocol.
STEP 4 : Install HOSTAPD, DNSMASQ and configure the Pi to act as an WiFi Backup Hub.
The only exception we did was modify the hostapd.conf file so that it was as the lines below :
The PiDrive Node Zero now works as a headless device :
- WiFi Accesspoint with a Shared Folder so that Android and IOS devices can back up images and data wirelessly.
- A Backup Drive for SD Cards / CF cards and USB drives.
- A MiniDLNA server that shows the backed up images to Clients connected to it’s WiFi via the DLNA Protocol.
- Provide a shared WiFi Network.
- Do all of the Above while connected to a Powerbank.
- A WiFi Access point serving a “bridge connection” If you have used this project with a Raspberry Pi 2 or Pi 3 and have the Ethernet cable connected to the router.