Setup transmission on b3

From BubbaWiki
Revision as of 21:20, 28 August 2012 by Cilyan Olowen (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

intro.

In this short tutorial we'll check out how to easily setup the stable and famous Transmission bittorrent program on the B3. Transmision is a piece of software that manages your bittorrent downloads, like for example Deluge, µTorrent, rTorrent, KTorrent, Vuze to mention a few. You can read more about it on it's site if you're not familiar with it.

The reasons to install it on a B3 are many, pick one that suits you:

  • Replacement: First and foremost one would probably want to have something better suited for torrent downloads than B3:s default and basic torrent functionality.
  • Control: Get better and total control over your torrent downloads.  For example, move finished torrents, get them to pause, set priorities, schedule bandwitdh usage, throttle, exclude files and so on.
  • Info: Get more info about what's actually going on with your downloads.
  • Resources: Transmission is light weight compared with many other programs that offer the same feature set.

Please notice: If you never or very seldom use your B3 for bittorrent downloads or don't know what bittorrent is you should really not bother with the installation of Transmission and the info given in here. If you on the other hand use your B3 a lot for torrent downloads it is of huge importance that you find an alternative bittorrent client so you can replace the one that comes with the B3. There are also plenty of others you could easily install on the B3 instead of Transmission if you would prefer them instead.


prerequisites

You must have the following before you begin to be able to use this tutorial easily:

  • A working B3 or something equivalent in terms of it running something Debian based as it's OS.
  • An internet connection: Something will be downloaded, but it's not much though, just a couple of MB:s.
  • A webbrowser on your desktop/laptop.
  • A desktop/laptop with a decent system on it, meaning Linux, would ease your life in several ways. As long as you find a way to shell into the B3 from any other OS like Windows/OS X etc. you will be fine though and the steps in this tutorial are the same. Please comsult the internet on how you can get shell access to your B3 from any other operating system other than Linux.

step-by-step

There are many ways to do this and each person has his/her own preferences. The following is how I choose to do it, with success and no headache.


1. get shell access to your B3.

On Debian based Linux you would do something like this in your terminal on your desktop/laptop:

ssh yourB3username@yourB3ip


Example:

ssh snowdrop@192.168.0.5

In the example my username is snowdropand the IP I use to my B3 is an internal one, given to the B3 by my router. You would most likley have a different username and different IP. For some users specifying just "b3" or "b3.local" might work instead of giving it the IP.

If you have your B3 behind a router it's advised that you use the interanl IP though. You can find out which that is by logging into your router. The username given here is the same as the one you use to login to your B3 using the B3:s nice looking webinteface, and you also have the same password.

If properly connected to your B3 you will now be asked for your password. When entering the password you will in most cases not see any text. Don't be alarmed. Just type it correctly and press Enter.

Once you have successfully entered the B3 after the shell password you will see a "greeting" message by it and it will look something like this:

Linux b3 2.6.38 #1 Tue Mar 22 16:27:55 CET 2011 armv5tel

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Jul 10 14:41:31 2011 from 192.168.0.2

Translated all that means that we can now continue and that you have properly logged into your B3.


2. change to root user

Now you are inside the B3. Be advided: This means that every command you execute in your terminal is ran on the B3'!Don't give it any commands you don't understand or can't find any proper info about - you could potentially destroy all data on your B3 and make it unresponsive.

For us to roam around freely on the B3 and be able to execute all kinds of cool commands we may need to be in root user mode. Enter it by typing:

su -

It will ask you for a password. The password is "excito". Write it and press Enter.

If done correctly your terminal will indicate that you have switched user. In Debian/Ubuntu it could look something like this:

root@b3:/home/yourusername#


3. install transmission-daemon

Transmission is a program that comes as a number of different alternatives depending on what we intend to use it for and our specific needs. Transmission has a so-called daemon, as would any good bittorrent program. A dameon is just a piece of software that runs in the background, often all the time, unseen by the user. On the B3 you have no need of a fancy graphical GUI since you can't hook up a monitor to it (although there are solutions to that as well but none we're interested in), hence we will install the dameon version of Transmission. That's the only thing you need really, and it will also enable you access and operate it on the B3 via a fancy webinterface, so it kind of is graphical in that sense.

Issue the following command (and yeah, this supposes you are connected to the internet):

apt-get install transmission-daemon

Read all info. You'd probably want to answer  Yes to all questions it asks you. The B3 will then fetch the transmission-daemon from the internet and automatically install it. If the install went well Transmission will from now on always be automatically running on your B3, even after rebooting it.


4. configure transmission-daemon

When configuring Transmission it is for the time being important that you are not running Transmission. So let's start with us shutting it down in case it's running. Issue the command:

/etc/init.d/transmission-daemon stop


It should take a second, and while it is trying to stop it  you'dsee the confirmation from the B3 that's saying:

Stopping bittorrent daemon: transmission-daemon.


Now that Transmission is stopped you are freet to edit its settings. Transmission has plenty of powerfull ones that give you great control. You must consult the info about them on the Transmission site since the program is always in development and the ones you will use will correspond with your speciifc version of Transmission. Don't fiddle with the settings unless you at the very least have a clue about what you're doing.


To edit the settings you can issue the follwing command:

nano /etc/transmission-daemon/settings.json

nano is text editor on your B3. You have now opened the configuration file for Transmission. Modify it according to your wishes. Hit Ctrl+O to save the changes you made. Then hit Ctrl+X to exit the text editor.

Here's a reference copy of my own config file. Please don't use it as it is: It won't work for you! There are several entries in it you would have to edit so it suits your own B3 setup and needs. Configuring it is easier than it looks if you read the documentation that was recommended above.

{
"alt-speed-down": 300,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"dht-enabled": true,
"download-dir": "/home/storage/transmission",
"download-limit": 100,
"download-limit-enabled": 0,
"encryption": 1,
"incomplete-dir": "/home/storage/.incomplete",
"incomplete-dir-enabled": true,
"lazy-bitfield-enabled": true,
"lpd-enabled": false,
"max-peers-global": 300,
"message-level": 2,
"open-file-limit": 32,
"peer-limit-global": 300,
"peer-limit-per-torrent": 60,
"peer-port": 54477,
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": true,
"peer-socket-tos": 0,
"pex-enabled": true,
"port-forwarding-enabled": false,
"preallocation": 1,
"proxy": "",
"proxy-auth-enabled": false,
"proxy-auth-password": "",
"proxy-auth-username": "",
"proxy-enabled": false,
"proxy-port": 80,
"proxy-type": 0,
"ratio-limit": 1.0000,
"ratio-limit-enabled": true,
"rename-partial-files": true,
"rpc-authentication-required": true,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "{0b7a2716072616f024bd6cd0943e00149547463cueInqUDD",
"rpc-port": 9091,
"rpc-username": "snowdrop",
"rpc-whitelist": "127.0.0.*,192.168.*.*",
"rpc-whitelist-enabled": true,
"script-torrent-done-enabled": false,
"script-torrent-done-filename": "",
"speed-limit-down": 100,
"speed-limit-down-enabled": false,
"speed-limit-up": 500,
"speed-limit-up-enabled": true,
"start-added-torrents": true,
"umask": 0,
"trash-original-torrent-files": true,
"upload-limit": 200,
"upload-limit-enabled": 1,
"upload-slots-per-torrent": 10
}


Please notice:

  • There are some Transmission legacy settings above.
  • I prefer to use  one dir for "incomplete-dir" and another as a "download-dir". You may or may not have good reasons to do so.
  • Pay special attention to the RPC settings if you want to remotley access your Transmission, and be sure to activate RPC.
  • You can pick any rpc-username and password: They are not in any way related to your already existing user accounts on the B3. Write the password in plain text - Transmission will hash it latet for you, hence you get the strange looking string in "rpc-password" even though you wrote something else.
  • By letting Transmission download only to dirs in "/home/storage" on your B3 coupled with umask 0 you will avoid read/write/access issues. (There are of course other ways to handle it as well, like running transmission-dameon under another user, chmod stuff etc etc, but I found this to be the easies and it suited my needs.)


After you're done with the configuration file and saved it you must start up Transmission so we can see it with the new settings in action:

/etc/init.d/transmission-daemon start

Don't worry - in the future Transmission will always start up itself whenever the B3 is running and no commands will be necessary by you. This was only needed since we did a manual shutdown of it previousley.  Close your terminal after Transmission was launched.


4. try it out

That's it! Given you have properly executed the above steps you should now have a great bittorrent program on your B3 that is always ready to download the fruits of the internet. Let's check out how you actually use it.

  1. Fire up your favourite browser on your desktop/laptop.
  2. Visit the following url: 
http://iptoyourB3:portnumber

The portnumber should be the same as you gave in "rpc-port" in the config file (deafult is 9091). If all is well you will see the webinterface of Transmission, from where you can handle all your bittorrent downloads. Depending on your rpc settings you will be asked for a username/password.

If you have issues connecting to the Transmission web interface make sure your rpc settings are ok, that Transmission is really running on your B3 and that your IP is on the rpc whitelist in case you have it enabled. For further debugging please consult the Transmission community. 


5. help others

Found this usefull? Edit this wiki with more Transmission related info and how it can be used on the B3. Contribute so we can get the most of our hardware.