Raspberry pi as network torrent downloader with Transmission

I wrote an article about transforming Raspberry Pi into a NAS to share files on a local network with an external usb storage: see technical details there, for brevity here just suppose you’ve a Raspberry PI  on local network with a USB drive attached.

Since Raspberry PI has limited resources, my choice go to Transmission daemon. It’s a very light version of Transmission running as a service (daemon) in background. There are different client available, but I use the Web interface:

Web client

Using web client, I can start and stop and download torrents within the local network and, if you expose raspberry in the DMZ and use a static IP or a dyndns, from everywhere you are.

Let’s install! On root console, type:

# apt-get install transmission-daemon

Edit the configuration file according to your filesystem:

# nano /var/lib/transmission-daemon/info/settings.json

Change “download-dir” and “incomplete-dir” into different directories on your external usb device, something like /media/MYDRIVE/mydownloaddir and /media/MYDRIVE/myincompletedir.

I also changed:

  • “rpc-url”: “/mysecretpath/”
  • “rpc-username”: “mysecretuser”
  • “rpc-password”: “mypassword” note: this will be hashed at the transmission restart
  • “rpc-whitelist”: “127.0.0.1,192.168.*.*,*.*.*.*” warning: copy the *.*.*.* only if you want to expose your Raspberry PI publicly on the Internet.

I leave unchanged:

  • “rpc-port”: 9091

Before restarting transmission, copy the configuration file somewhere as a backup copy, because sometimes Transmission overwrite it badly.

Restart transmission:

# service transmission-daemon restart

Now you should reach web interface in this way:

http://RASPBERRY_PI_LOCAL_IP:rpc-port/rpc-url/

e.g.

http://192.168.0.5:9091/mysecretpath/

or using the host name, for raspbian “raspberrypi”:

http://raspberrypi:9091/mysecretpath/

Typing username and password you can start to add torrent using the first icon on the left (Open torrent):

upload

Uploading a file from your local filesystem or providing a torrent url from an external service.

Important note: please remember that Raspberry PI has limited resources. Do not start too many torrents at once because hash calculations are cpu intensive.

After you finished download, seed for a while and then clear the completed items (right click to show options) you’ve already downloaded to keep Transmission running smoothly.

See also

Advertisements

Howto merge two torrent files

Update 2017: The only working method is now to use Vuze’s Swarm Merging starting the two torrents at the same time. Vuze will auto-detect the uncompleted torrent files merging the two toghether. Remove .part extension of existing files if you put uncompleted files from another client.

Update October, 2010: before trying this howto, I suggest to try mergetorrent. It’s free software, released under GNU GPL by Eyal (read comments) and it’s simpler than the method described below. Thank you Eyal!

Sometimes you want to download a torrent that you’ve partially downloaded. Many bittorrent client allow partially downloaded files, but what if you’ve downloaded the same torrent twice, with differents parts available?

Use Zeroconf / Local peer

I’ve used two client on the same LAN, ktorrent (on Debian) and utorrent (on Windows XP). I’ve two downloaded files (or folder) from the same .torrent, with different parts downloaded.

  • Enable Zeroconf plugin on ktorrent
  • Check if on utorrent “Enable local peer discovery” is enabled
  • Import existing download #1 on ktorrent
  • On debian system, as root type ifconfig to discover your local IP address, i.e.  inet addr:192.168.0.XX
  • Go to ktorrent preferences and check the used port (e.g. 12345)
  • On utorrent go to Peers tab on #2 download. Right-click > Add peer
  • Type your first machine IP address (e.g. Debian) and the first bittorrent client port (e.g. 12345 on ktorrent),  e.g. 192.168.0.XX:12345 with no protocol prepended.

On both client you’ll notice a new peer, downloading and uploading very fast. Little after, the two downloaded files / folder could be completely merged.

You can now close #2 and continue to download the torrent on a single machine / client from external peers.

Note: I’ve tested this method on the same machine using Virtualbox (Debian as host, XP as guest).

See also: