Torrenting is always life saver and hoping a headless connected Raspberry Pi doing that for you can really be amazing. With is tutorial I will help you all to build a Torrent Machine with Pi that can run headless and you can use our Android phone to control and monitor. This thing can be pretty useful if you have to leave you download over night or when you are not home. This thing will be really helpful.
As I said this is a minimum Tutorial and I have included only those steps essentially to setup the thing and set it running. I have kept the reference links I tried while experimenting in case you wanted to do all the thing.
We will be using FTP to move files between RPi and your phone and we will control your Torrrent machine over SSH. Hope you are familiar with the terms. If not please refer to any RPi beginner tutorial. Feeling lazy for that, don't worry I have all essential thing noted down and you will pretty understand most if you understand the language of computers. Happy making.
First of all am assuming that you have
- SSH enabled in your RPi
- Your Phone and RPi are connected over the same local network (ie to the same router)
- You know your RPi's IP address. - If you don't please go thorough your routers manual as it will have info on how to find it. Check for something like DHCP or LAN statics.
We will be doing things in the following manner. if you have completed any of these steps already feel free to skip forward.
- Connect your phone and RPi via SSH
- Enable FTP in RPi, and try transferring some files through it.
- Installing Deluge Daemon on your RPi and configuring it.
- start Torrenting
Reminder : Downloading with the help of Torrent is not crime, but using it to download copyrighted material is a huge crime both in eyes of laws and society. its THEFT man.
Step 1: Connecting Android Phone to RPi Via SSH
Since SSH is enabled, it provides us a great window to handle things. and with this things. You can Literally do anything through you phone to your RPi via SSH
First we have to install a good SSH client on your phone.
I prefer Connect Bot. A it has a pretty clean interface and is good to work with.
Just install it from Google Play
if you wish to use you Computer instead you can use PUTTY to establish the SSH connection.
PUTTY : http://www.putty.org/
After you have installed Connect Bot. You will be welcomed by an open screen. Add a new connection with your details like host address ( IP address of your RPi); user name etc. You only need to enter the following. all rest can go with the default values it comes with.
- Username, which is "pi" by default
- Host, which is the IP address your Pi.
That's it. You will be prompted to continue the connection after confirming your credentials. and now you will be prompted for the password. the default password is "raspberry"
Congrats you are now connected. you can use bash codes to control your Pi.
I have put the screens that appear through this process so you can see what it looks like.
Step 2: Setting Up FTP
Pi comes with its own sfotware for FTP, but still we need to install PURE-FTPd, to harness the communication completely.
open Connect Bot and connect to your Pi.
sudo apt-get install pure-ftpd
This will install PURE-FTPd to your Pi. Installing alone will help you open the ftp portal. And your whole files will be available to everyone in the sasme network. if you are a security consious user or something pleasae refer tto the bello link, wgere i found these info.
Once you are done with configuring FTP, lets transfer some files.
ES file explorer would be a great option to transfer files for all type of links as they let you acess files from a variety of sources and that includes FTP.
Just access the options and choose FTP. add a new connection by clicking the button to the bottom Right. Choose FTP from there. Provide the following data
- Server : IP address of ur PI
- Mode : Passive
- Username : your username for PI, its "PI" by default.
- Password : ur password. its "raspberry" by default
Leave the rest to default values and click OK. It will take a while for the connection to be established.
Now you can transfer files between Pi and Phone as you change files internally to your phone. Just copy from one place and Paste it at the other Place.
Please see the screenshots in order to get more idea.
Step 3: Settting Up Deluge
Deluge is a Torrent client for Linus. Its actually a -a computer program that runs as a background process- completely headless. Only way to communicate to him is through terminal. we will be Installing 4 programs in this step.
- Deluge-Console : used to communicate to Deluge via terminal
- Deluge-Web : used to connect to Deluge through the web UI
- Mako : a template gallery for Python that the Deluge-web needs
Connect to your Pi through Connect Bot / SSH. I will be using terminal instead of Connect Bot as its compact and you can also type these to your Pi terminal also.
deluge is the main component. to get his to your Pi, enter in you SSH terminal,
sudo apt-get install deluged
This will download and install Deluge. You may be promoted to confirm your installation in between. once the thing is installed. we are done. Just we have to run the program for the first time so that all necessary configuration files are created by itself. If you are a really conscious about how to do the configuration, please refer to my reference link at the end o this page.
deluged sudo pkill deluged
This might show us some error. Just ignore them for the time being.
Console will help us connect to Deluge and control it through terminal / SSH. To install enter this to terminal / SSH console.
sudo apt-get install deluge-console
thaths it. wait for the instalation to be completed.
Installing Mako and Deluge-web
Enter the following commands in the terminal. that will install Mako and Deluge-web
sudo apt-get install python-mako sudo apt-get install deluge-web
Now we have completely installed all necessary files. we need to restart Deluge-web to take this thing into action. enter the following.
sudo pkill deluge-web
Staring on Boot
We have to set all of these to start on boot so that all services will be available from the moment system kicks into life. for that we have to list the directory of Deluge and Deluge-web into the startup file
we have to open it in nano editor, co as to edit it in terminal. to open the file in nano enter
sudo nano /etc/rc.local
once the file opens in nano, enter this to the bottom -just before "exit 0" of the file.
# Start Deluge on boot:
sudo -u pi /usr/bin/python /usr/bin/deluged
sudo -u pi /usr/bin/python /usr/bin/deluge-web
press Ctrl+X to save and exit from file. Connect Bot has a control button above the normal keyboard for this purpose.
Save the Changes. Press ENTER to exit nano after saving.
so we are done with setting our system up. now we have to restart our Pi for changes to take effect.
to restart enter the following
thus we are done with the configuration part.
Step 4: Adding Torrent to Download
Download the torrent file on your phone and copy it to your PI. preferably to either
Enter the Deluge console by entering
now the console opens up. you can add your torrentby entering
please ensure to enter the path and file name correctly ans they are Case sensitive. avoid space in file names as they can lead to confusion.
This will show up the present status of listed torrents. their download speed, ETA and all such information.
please refer to this video where in i have explained how to add a torrent file from your android phone and monitor it with webUI.
That's it, We have completed the tutorial. Have fun Happy Torrenting.