RPi as Torrent client with Transmission daemon

Transmission is a tool to download files using torrent service. Transmission-daemon is basically the same, but without user interface. We install it in always-on server (like Raspberry Pi), then access it from different computers. This guide assumes you already have Raspbian OS installed in your Raspberry Pi with LAN setting properly established. My Raspbian image file is dated 9 Feb 2013. Different version of Raspbian might produce different behavior.


transmissionTaken from http://www.robertsetiadi.net/  Also read http://www.howtogeek.com/76801/how-to-anonymize-and-encrypt-your-bittorrent-traffic/ just in case

Before installing new application or service in Raspbian, make sure to always type this into terminal :
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

If you’re installation is not the latest version, it might take a while as Raspbian will download the latest files from Internet.

Now, open terminal again and install Transmission-daemon:
sudo apt-get install transmission-daemon

Ideally, we need two folders to contain Transmission files:
mkdir /home/pi/progress (for incomplete downloads)
mkdir /home/pi/completed (for completed downloads)

We need to take care about some permission stuff:
sudo usermod -a -G debian-transmission pi (change “pi” with your Raspberry Pi username if necessary)
chgrp debian-transmission /home/pi/progress
chgrp debian-transmission /home/pi/completed
chmod 770 /home/pi/progress
chmod 770 /home/pi/completed

If you wish to combine Raspberry Pi with an existing NAS server for downloading torrents, there’s a chance you will get error message related to permission. There are various ways to solve it, but I shall go with the easiest one: adding your Raspbian username into debian-transmission group (in my case “pi”) then change ownership of your mounted folders using the following commands:
sudo service transmission-daemon stop (stopping Transmisssion)
sudo adduser pi debian-transmission (add pi or your username to debian-transmission group)
sudo nano /etc/init.d/transmission-daemon (change startup user for transmission, change user name to your username: USER=pi)
sudo chown pi -R /var/lib/transmission-daemon/info/ (change owner rights to transmission configuration files to you)
sudo chown pi -R /home/pi/progress (change owner right of download folder to your user)
sudo chown pi -R /home/pi/completed (change owner right of download folder to your user)
sudo chown pi -R /etc/transmission-daemon/settings.json (change owner right of configuration file to your user)
sudo service transmission-daemon start (start Transmission again)

Next, we need to take care of some settings:
sudo nano /etc/transmission-daemon/settings.json

You shall see many setting lines. Feel free to explore those settings one by one, but for now let’s focus only on few important settings to get started.

1. Find rpc-username and rpc-password, change the values. This is supposed to be different from your Raspbian username.
2. Find rpc-whitelist and add the IP addresses of your other computers there (computers you plan to access Transmission from). For my case, I simply add 192.168.1.*
3. Find download-dir and change it into /home/pi/completed or whatever the name of the folder you have prepared before.
4. Find incomplete-dir and change it into /home/pi/progress or whatever the name of the folder you have prepared before.
5. Find watch-dir and change it into /home/pi/torrentwatch or whatever the name of the folder you have prepared before.

Save the settings.json file and force transmission-daemon to load it:
sudo service transmission-daemon reload

Transmission-daemon saves configuration file when it closes. So using restart parameter instead ofreload will get the previous settings revert back.
If you change the password, then type sudo service transmission-daemon reload followed bysudo service transmission-daemon restart.

Now you need to know the IP address of your Raspberry Pi.
ifconfig eth0 (if you’re using network cable)
ifconfig wlan0 (if you’re using WiFi)

You might also want to make your Raspberry Pi having a static IP address:
sudo nano /etc/network/interfaces

Then change this line:
iface eth0 inet dhcp
into:
iface eth0 inet static
and add the following lines below the iface line:
address 192.168.1.8 (change this with your desired address for the Pi)
netmask 255.255.255.0
network 192.168.1.1
broadcast 192.168.1.255
gateway 192.168.1.254
Of course, you should adjust the lines according to your network settings.

All done. You might want to restart your Raspberry Pi, then try the connection from another machine.

In the other machine, open web browser and type:
http://your_server_ip_address:your_port_from_rpc-port/your_setting_from_rpc-url/

For example:
http://192.168.1.8:9091/transmission/

You will be asked username and password, which you need to answer with the value of rpc-username andrpc-password.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>