LOGO

Install Transmission on DD-WRT Router - BitTorrent Client Setup

January 25, 2012
Install Transmission on DD-WRT Router - BitTorrent Client Setup

Elevating Your DD-WRT Router: Installing Transmission

Having already enhanced your DD-WRT router's capabilities with the Opkg package manager, it’s now time to add a powerful BitTorrent client. This guide details the process of installing Transmission on your DD-WRT router.

The following instructions, inspired by How-To Geek, will walk you through the necessary steps.

Image credit: Nathan E and Aviad Raviv.

Prerequisites: Previous Articles in the Series

Before proceeding, ensure you’ve reviewed the preceding articles in this series for a comprehensive understanding. These include:

  • Transforming your home router into a high-performance device using DD-WRT.
  • A guide on installing supplementary software on your DD-WRT router.
  • Instructions for blocking advertisements with Pixelserv on DD-WRT.

It is assumed that you possess a working knowledge of the concepts covered in these earlier guides.

Important Considerations

Please note that this particular guide delves into more advanced configurations. Users with limited experience modifying router settings should exercise caution throughout the installation process.

Modifying your router’s firmware carries inherent risks, so proceed carefully and ensure you understand each step before execution.

Transmission Installation and Remote Control on OpenWRT

Transmission stands out as a leading BiTorrent client available through the OpenWRT OPKG repository. Its widespread adoption across prominent Linux distributions – such as Ubuntu and Mint – underscores its reliability, consistent updates, and adaptability.

A key feature of Transmission is its capacity for remote management, supported by various applications, including Windows programs and a web-based interface.

Guide Overview

This tutorial will detail the process of installing Transmission on your OpenWRT router. We will also configure it to start automatically upon boot and enable remote control via a Windows client and a web interface within your local network.

The following steps will ensure a fully functional and remotely accessible Transmission setup on your OpenWRT device.

Installation Steps

Installing Transmission is straightforward using the OpenWRT package manager. The process involves updating the package list and then installing the Transmission package itself.

Automatic Startup Configuration

To ensure Transmission runs continuously, it needs to be configured to start automatically when the router boots up. This is achieved through a simple system initialization script.

Remote Control Setup

Enabling remote control allows you to manage your downloads from other devices on your network. This can be done using a Windows client or a convenient web interface.

  • Windows Client: A dedicated Windows application provides a graphical interface for managing Transmission.
  • Web Interface: Access Transmission through a web browser for control from any device with network access.

By following these steps, you can effectively utilize Transmission on your OpenWRT router for seamless torrent downloading and management.

Essential Requirements and Initial Considerations

This guide builds upon prior knowledge. It's anticipated that you've already completed the steps detailed in "How To Install Additional Software On Your Home Router (DD-WRT)" and met all the necessary prerequisites outlined there.

Optimal performance is achieved with a HardDrive connected to the router. The following instructions are predicated on this setup.

The HardDrive should already be formatted before proceeding. While partitioning and formatting are not covered in this guide, DD-WRT version 17798 and later natively support widely used file systems.

Supported File Systems

  • FAT32
  • ext2/3
  • NTFS

Consequently, no specialized configuration should be required for common file system types.

Having clarified these foundational elements, we can now move forward.

Initiating Transmission: Network Configuration

Enabling UPnP

UPnP functions as a system enabling applications on your network to automatically request port forwarding from the router. Utilizing this feature eliminates the need for manual port opening or forwarding to the Transmission daemon.

To activate this, access your router’s web interface:

  • Navigate to "NAT/QoS" and then select "UPnP".
  • Choose the "enable" option for the "UPnP Service" setting.
  • Consider enabling the "Clear port forwards at startup" option for added security.
    how-to-install-the-transmission-bitorrent-client-on-your-router-dd-wrt-1.jpg
  • Save and apply the changes.

Hard Drive Mounting

If a hard drive is connected, ensure it is mounted through the router’s web interface. Access the interface as follows:

  • Go to the "Services" tab and then select "USB".
  • Enable "Core USB Support", "USB Storage Support", and "Automatic Drive Mount" by selecting their respective enable radio buttons.
    how-to-install-the-transmission-bitorrent-client-on-your-router-dd-wrt-2.jpg
  • Save and apply the settings.

Software Installation

The Transmission daemon package can be installed via the terminal using the following command:

opkg update; opkg install transmission-daemon

Configuration of the Package

After installation, launch the Transmission daemon once to generate the default settings file. Running it in the foreground ("-f" flag) allows for easy monitoring of its stabilization and subsequent termination. Execute:

transmission-daemon -f

Allow the program approximately ten seconds to initialize before exiting using "Ctrl+C".

Directory Setup

Establish directories to store torrent pointers, partial downloads, configuration files, and completed downloads. For this example, the following structure is used:

mkdir -p /mnt/sda_part1/torrents/parts/mkdir -p /mnt/sda_part1/torrents/config/

It’s important to note that this assumes a single hard drive connected to the router with a filesystem on the first partition. Adjust this path based on your specific hard drive partitioning and formatting.

Copy the configuration file created during the initial daemon run:

cp /tmp/root/.config/transmission-daemon/settings.json /mnt/sda_part1/torrents/config

This command represents a single, continuous line.

The following command modifies the "rpc-whitelist" parameter to include the "192.168.11.*" network. This permits connections from any computer on the local network, using a remote GUI, to the daemon running on the router.

sed -i "s/127.0.0.1/127.0.0.1,192.168.11.\*/g" /mnt/sda_part1/torrents/config/settings.json

Note that this is also a single, continuous line.

Adjust the network subnet if it differs from your configuration.

Restart the daemon, specifying the alternative configuration directory using the "-g" flag:

transmission-daemon -f -g /mnt/sda_part1/torrents/config

Verify that the daemon has started and that the program paths have updated to reflect the new configuration. Keep the daemon running, as it will be required for the GUI configuration phase.

Remote GUI Control of Transmission

Two Windows applications are available for remotely managing the Transmission daemon: Transmission-remote-gui and Transmission-remote-dotnet. Both offer comprehensive functionality and receive consistent updates. Although either can be utilized, this guide will focus on "transmission-remote-dotnet" due to its near-identical features compared to the alternative.

The client will be installed and subsequently employed to modify server settings, a process that proves simpler than direct editing of the configuration file.

Setting Up Local Client Parameters

  • Obtain the newest version of Transmission-remote-dotnet from the project’s official website and proceed with a standard installation.
  • Initiate the program and navigate to "Local settings" via the Options menu or by clicking the wrench icon.
  • Proceed to the "Servers Settings" tab.
  • Select "Add Server" to begin configuring a connection.
  • Click on the newly added "Server 0" name to access and modify its settings.
  • Enter your router’s IP address into the host field.
  • Confirm your entry by clicking "Save".
  • Establish a connection to the daemon operating on your router by selecting "File" -> "Connect" or utilizing the connect icon.

Configuring the Remote Daemon’s Operation

  • Select "Options" and then "Remote Settings".
  • In the "Download to" field, specify the directory: "/mnt/sda_part1/torrents".
  • Ensure the "Incomplete download to" checkbox is selected.
  • Within the incomplete downloads field, input: "/mnt/sda_part1/torrents/parts".
  • Adjust the Encryption dropdown menu to "preferred".
  • Finalize the configuration by clicking "Save".

The setup is now complete. You can now interact with the program as you would with any conventional BitTorrent client installed on your computer.

Enable the Web Interface (Optional)

Although utilizing one of the remote-gui programs previously mentioned would have been adequate, you might desire a method to access the daemon without being tied to a program on a particular device. Given the proliferation of personal devices today, managing what’s available where can be challenging. Accessing the router via a web browser should, for experienced DD-WRT users, be a familiar process. Furthermore, a web interface simplifies adding downloads while mobile.

While making the web GUI publicly accessible falls outside the scope of this guide, we will demonstrate how to install and configure the web interface, allowing you to address public accessibility later.

Install the necessary package using the following command in a terminal:

opkg update; opkg install transmission-web

Transmission will automatically search for the web interface in several default locations. Running transmission in "foreground" mode (using the -f flag) in the previous step allows you to identify these locations if you attempt to access the web interface. Currently, access will fail, but you’ll observe that one location is "/tmp/root/.local/share/transmission/". This location resides on the router’s RAM, which is both readable and writable.

Therefore, we simply need to create a symbolic link between this RAM location and the installation location of the web interface on JFFS. To accomplish this, first create the directory manually:

mkdir -p /tmp/root/.local/share/transmission/

Then, create the symbolic link, also manually:

ln -s /jffs/opt/usr/share/transmission/web/ /tmp/root/.local/share/transmission/web

Note that this is a single, continuous line.

Attempt to access the web interface again at: http://your-router's-ip-or-dns:9091. For example, with an IP address, this would be "http://192.168.11.1:9091" or, using a local DNS name, "http://buffalo.aviad.lan:9091".

If successful, adding a download should produce a result similar to this:

how-to-install-the-transmission-bitorrent-client-on-your-router-dd-wrt-9.jpg

Creating and Using a Swap File (Optional)

A "Swap File" functions similarly to the Windows "Page file," and was, in fact, previously referred to as a "Swap File" by Microsoft. During the drafting of this guide, a situation was encountered where the daemon experienced a memory leak and subsequently crashed (see the remarks section). To address this, Swap was configured, both as a partition and as a file. While this only served to delay the inevitable crash due to the memory leak, the effort resulted in a straightforward procedure that is beneficial to share.

Therefore, this step is optional. The daemon has been running reliably for over a week without interruption while handling at least five different torrents. However, routers with limited RAM (128MB is considered substantial) may require this step. Implementing Swap shouldn't incur a performance penalty, as Linux generally avoids using Swap unless necessary, unlike Windows.

While using a Swap "partition" is common in Linux, it necessitates prior partitioning or altering the existing disk layout. This can be inconvenient if data already resides on the drive. Creating a file on the existing filesystem is simpler. Furthermore, no significant performance difference was observed when comparing the two Swap utilization methods.

We will create a 256MB file for this purpose. Use the following command in a terminal:

dd if=/dev/zero of=/mnt/sda_part1/swap.page bs=1M count=256

WARNING: The "DD" command is powerful and potentially destructive. Exercise caution with the "Output File" (of) directive, as an incorrect parameter could lead to data loss.

Install the package required to enable Swap by issuing:

opkg update; opkg install swap-utils

After installing swap-utils, create the swap file:

mkswap /mnt/sda_part1/swap.page

Now, verify that the system recognizes the swap file by checking memory usage with the "free" command:

free

Initially, the parameters in the "Swap" row will be zero.

Activate the swap file:

swapon /mnt/sda_part1/swap.page

Run the "free" command again:

free

The "Swap" row should now display 256MB of available swap space.

Starting the Daemon Automatically

To ensure the Transmission daemon starts automatically upon router reboot, add it to the "geek-init" script, which is installed with OPKG. Open the geek-init script with your preferred editor:

vi /jffs/geek/etc/geek-init.sh

If you have followed all steps in this guide, including the optional ones, append the following script snippet to the end of the geek-init file:

logger_general "transmission setup-er: setting 'home'"export HOME='/tmp/root'logger_general "transmission setup-er: Creating the directory and symbolic-link for the web interface"mkdir -p /tmp/root/.local/share/transmission/[ ! -L /tmp/root/.local/share/transmission/web/web ] && ln -s /jffs/opt/usr/share/transmission/web/ /tmp/root/.local/share/transmission/weblogger_general "activating swap"swapon /mnt/sda_part1/swap.pagelogger_general "transmission setup-er: Starting the transmission-daemon with the alternate configuration directory."/opt/usr/bin/transmission-daemon -g /mnt/sda_part1/torrents/configlogger_general "transmission executed"

If you skipped optional steps, while the above code should function, you may wish to remove any unnecessary elements. If you skipped both optional steps and the comments, you only need to append:

/opt/usr/bin/transmission-daemon -g /mnt/sda_part1/torrents/config

Final Remarks

  • Although potentially unfounded, it’s prudent to remember that BitTorrent has become a target for legal action, and the network is frequently scrutinized. The website http://www.youhavedownloaded.com/ serves as an example. Therefore, use this torrent client only for legal torrents.
  • During the creation of this guide, a specific torrent caused the transmission daemon process to crash due to a memory leak. The issue was reported on the OpenWRT forum, but no response was received at the time of writing.

Wishing you a seamless transition to Transmission :)

For what is momentary, transient... will turn to ASH.

#transmission#dd-wrt#router#torrent#bittorrent#install