Wireless Powered Thunder-Safe (overvoltage protected) NAS Backup System
The Problem:
Since documents, paper, photos, etc. became digital, it is required to have a backup of the digital data. Thunders can distroy computers and hard disks connected via USB or Ethernet. Saving data in the cloud is one possibility but vulnerable by hackers via the internet. With a server at home the risk is high an overvoltage or thunders are destroying the hardware and the stored data.
The Solution:
The general idea is to attach the NAS by WIFI to disconnect the wired connected Ethernet. But the power delivery causes in some problems, but can we solved with the Wireless Powerkit of Futura Electronica. The Wireless Power Kit includes an FT1235 5W transmitter and an FT1236 5W receiver.
While the NAS functionality is needing more power than the 5W the Wireless Power Kit can offer, a battery will be charged additionally providing an USV functionallity during backup operation. The NAS functionality itself will only be turned on periodically or by some wake-up functionality.
During Idle the System consumes about 350mA. The Battery and the battery will be charged. As soon the NAS functionality will be used, the drive is start spinning and the system will be powered by battery and wireless power.
The First Prototype
The current is measured by a USB power meter
The power is delivered wirelessly
This is how the overall prototype is look like
The setup consists of:
- FT1235 5W transmitter with added Adafruit Micro-USB breakout connected to 2A USB power supply
- FT1236 5W receiver with added USB Host connector
- LiFePo4 2500mA with Charger
- 3V-5V to 5V Step-up DC/DC
- Raspberry PI Zerro with min. 4GB SD Card
- 1TB WD PiDrive connected
- USB WLAN Stick
- HUBPIXED Hub
Technical Specifications
- FT1235 5W transmitter with added Adafruit Micro-USB breakout connected to 2A USB power supply
- FT1236 5W receiver with added USB Host connector
- LiFePo4 2500mA with Charger
- 3V-5V to 5V Step-up DC/DC
- Raspberry PI Zerro with min. 4GB SD Card and Raspberian Lite
- 1TB WD PiDrive connected
- USB WLAN Stick
- HUBPIXED Hub
Hardware Components
- FT1235 5W transmitter
- Adafruit Micro-USB breakout
- FT1236 5W receiver
- USB Host connector
- LiFePo4 2500mA battery
- LiFePo4 charger
- 3V-5V to 5V Step-up DC/DC
- Raspberry PI Zerro
- 4GB SD Card
- 1TB WD PiDrive
- USB WLAN Stick
- HUBPIXED Hub
Software
Software installed:
apt-get update
apt-get -y install samba netatalk hfsplus hfsprogs hfsutils ntfs-3g usbmount exfat-fuse hdparm sdparm build-essential fakeroot debhelper
wget http://sourceforge.net/projects/hd-idle/files/hd-idle-1.05.tgz
tar -xvf hd-idle-1.05.tgz && cd hd-idle
dpkg-buildpackage -rfakeroot
sudo dpkg -i ../hd-idle_*.deb
Enabled hd-idle in /etc/default/hd-idle
START_HD_IDLE=true
Added WLAN SSID in /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid=<your SSID>
psk=<your key>
}
Added new restart services script /etc/usbmount/restart_services.sh
#!/bin/sh
echo waiting 10 seconds…
sleep 10
echo Restarting services…
/etc/init.d/netatalk restart
/etc/init.d/samba restart
/etc/init.d/avahi-daemon restart
/etc/init.d/hd-idle restart
Created new mount script to update network shares /etc/usbmount/mount.d/00_update_shares
#!/bin/bash
logfile=/var/log/share_mount.log
APPLE_VOLUMES_DEFAULT=/etc/netatalk/AppleVolumes.default
SMB_CONF=/etc/samba/smb.conf
UM_LABEL=`lsblk -nio label $UM_DEVICE`
grep -v “/media/usb” $APPLE_VOLUMES_DEFAULT > ${APPLE_VOLUMES_DEFAULT}.tmp && mv ${APPLE_VOLUMES_DEFAULT}.tmp ${APPLE_VOLUMES_DEFAULT}
grep -v “include = /etc/samba/shares” $SMB_CONF > ${SMB_CONF}.tmp && mv ${SMB_CONF}.tmp ${SMB_CONF}
if test -s /etc/samba/shares/dev/*;then
echo Cleaning Samba shares…
rm -r /etc/samba/shares/dev/*
fi
IFS=’
‘
for i in `mount | grep “/media/usb”`
do
DEV=`echo $i | awk ‘{print $1}’`
MOUNT=`echo $i | awk ‘{print $3}’`
LABEL=`lsblk -nio label $DEV`
if [ “$LABEL” == “EFI” ]
then
echo $DEV was not used…
else
chmod 777 $MOUNT
echo $MOUNT “$LABEL” cnidscheme:cdb options:usedots >> $APPLE_VOLUMES_DEFAULT
echo “include = /etc/samba/shares$DEV.conf” >> $SMB_CONF
echo “[$LABEL]” >> /etc/samba/shares$DEV.conf
echo ” comment = Users profiles” >> /etc/samba/shares$DEV.conf
echo ” path = $MOUNT” >> /etc/samba/shares$DEV.conf
echo ” guest ok = no” >> /etc/samba/shares$DEV.conf
echo ” browseable = yes” >> /etc/samba/shares$DEV.conf
echo ” security = user” >> /etc/samba/shares$DEV.conf
echo ” encrypt passwords = yes” >> /etc/samba/shares$DEV.conf
echo ” read only = no” >> /etc/samba/shares$DEV.conf
fi
done
/etc/usbmount/restart_services.sh &
exit 0