BitTorrent Sync on raspbmc

BitTorrent Sync is an open source tool to create a Dropbox-like file-syncing service. You can share a folder with anyone. Files are stored on the server (which can be your raspberry pi) and on all the other computers that you gave a secret key.

Install

You can install it by following this guide: http://jack.minardi.org/raspberry_pi/replace-dropbox-with-bittorrent-sync-and-a-raspberry-pi/

Auto start

You want BitTorrent Sync to start automatically when your raspberry pi starts. To do so we will create a script to help us. It will contain the logic and have a start and stop parameter.

Create it with:

sudo nano /etc/init.d/btsync

Paste this:

#! /bin/sh
# /etc/init.d/btsync
#

# Carry out specific functions when asked to by the system
case "$1" in
start)
    /home/pi/.btsync/btsync
    ;;
stop)
    pkill btsync
    ;;
*)
    echo "Usage: /etc/init.d/btsync {start|stop}"
    exit 1
    ;;
esac

exit 0

You need to change the permissions:

sudo chmod 755 /etc/init.d/btsync

You can test the script by stopping and starting it, just for fun:

sudo /etc/init.d/btsync stop
sudo /etc/init.d/btsync start

And at last add it to the boot process:

sudo update-rc.d btsync defaults

My raspberry pi

The raspberry pi is an awesome device. It’s affordable, it’s a media center, a web server, very slow and doesn’t use much electricity. It’s also a very good looking piece of hardware. Fits your living room!

pi-1

pi-2

This post is about how mine is configured!

The services

  • Xbmc (installed as raspbmc): a powerful media center, running on Debian.
  • Transmission: A minimalistic torrent client.
  • CouchPotato: Software that searches the movies you want and starts to download them as soon as they come available.
  • BitTorrent Sync: Dropbox like service, easy way to backup folders on multiple computers.
  • Samba: Share a hard disk to the local network.

The place

My pi lives next to my TV. It’s powered by a 5V 2A power supply. It has a 8 gb sd card and their is a 2 TB external usb hard drive attached.

Connected

I use Putty to modify raspbmc via ssh, Yatse android app to control Xbmc. When needed I can connect an external keyboard because I still have 1 usb port over.

Security

As you could possibly open up some ports to the internet, you will want to secure your raspberry pi.

Install

I won’t list the complete process but refer to guides I followed.

0. Static IP

http://choorucode.com/2012/08/14/how-to-assign-a-static-ip-address-to-raspbmc/

1. Raspbmc

First we need to install raspbmc on the pi: http://www.raspbmc.com/wiki/user/windows-installation/.

2. CouchPotato, Transmission

3. BitTorrent Sync

4. Enable samba

You can do this in the xbmc interface.

5. Dynamic Dns

http://www.techjawab.com/2013/06/setup-dynamic-dns-dyndns-for-free-on.html

XBMC tweaks

  1. By default, if there is no hdmi connected on boot, it won’t enable hdmi. That’s ridiculous!