This guide will walk you through the entire process required to setup Transmission on the Omega. We'll show you how to download directly onto the Omega's USB storage, and wirelessly share the Omega's downloads on your local network.
OverviewTutorial Difficulty: Intermediate
Time Required: 30 minutes
Required Materials:
- The Omega
- Any Dock
- A USB Storage Device
Useful Experience:
- Installing packages with opkg
- Using BitTorrent
- Using Transmission
- Using the Console
Because of the Omega's limited storage, we'll need an external drive in which to place our downloads. Follow these commands on your Omega Console to mount the drive.
Plug in the USB Storage. Usually, it will get mapped to the sda1 device. Double check the mapping:
ls /dev/sda*
It should output your mount point, something like: /dev/sda1
Create a mount point directory:
mkdir /mnt/sda1
Mount the drive, using 'mount <device> <mount point>'
. For example:
mount /dev/sda1 /mnt/sda1/
The storage can now be accessed at /mnt/sda1. T
o safely remove the drive, use 'umount <mount point>'
. For example:
umount /mnt/sda1/
For the purposes of this guide, let's assume the USB device was mounted to /mnt/sda1.
For more on using USB storage (including automated mounting) : https://wiki.onion.io/Tutorials/Using-USB-Storage
Because of the Omega's limited memory, we need to setup a swap file on the USB storage to extend the available memory. Follow these commands on your Omega Console to setup the swap file.
Install the required packages:
opkg update
opkg install swap-utils
Use the dd
utility to create the file that will become the swap file. The dd
utility can be dangerous if used incorrectly:
dd if=/dev/zero of=/mnt/sda1/swap.page bs=1M count=256
Setup the swap file as a swap area:
mkswap /mnt/sda1/swap.page
Running the free
command will show that nothing has changed yet. Activate the swap file:
swapon /mnt/sda1/swap.page
Running the free command again will show that the swap row is populated. For more on using swap files (including automated swapping): https://wiki.onion.io/Tutorials/Extending-RAM-with-a-swap-file
Install TransmissionWe'll need a client to download files via BitTorrent; Transmission works well on OpenWRT so let's install the daemon as well as the web interface packages:
opkg update
opkg install transmission-daemon transmission-web
Setup TransmissionWe'll now configure Transmission to best suit our purposes. Transmission's configuration file can be found at /etc/config/transmission
, so we can use UCI
to easily change the configuration options. If you're unfamiliar with UCI, check out the UCI tutorial:
Make sure that Transmission is enabled and set a logical location for Transmission's own configuration directory:
uci set transmission.@transmission[0].enabled='1'
uci set transmission.@transmission[0].config_dir='/etc/transmission'
Set the download and incomplete download locations to directories on the mounted USB drive:
uci set transmission.@transmission[0].download_dir='/mnt/sda1/download'
uci set transmission.@transmission[0].incomplete_dir='/mnt/sda1/download/incomplete'
Create these directories with the mkdir
command.
mkdir /mnt/sda1/download
mkdir /mnt/sda1/download/incomplete
Commit the changes to the configuration file:
uci commit transmission
Enable the Transmission DaemonNow that Transmission has been configured, let's enable the daemon so that it starts automatically when the Omega boots:
/etc/init.d/transmission enable
And let's actually launch the daemon:
/etc/init.d/transmission start
The Transmission web interface will be running on port 9091 of your Omega, but wouldn't it be nice if this were accessible from the Console?
Luckily, it can be! Simply install it with the following commands:
opkg update
opkg install transmission-console-app
Configure Access to the Web InterfaceThe Transmission Web Interface needs to be told which IP addresses are allowed access via a whitelist.
First check the current entries in the whitelist. Make sure to note the current entries, we'll want to preserve them:
root@Omega-267F:~# uci show transmission.@transmission[0].rpc_whitelist
transmission.cfg025f8f.rpc_whitelist='127.0.0.1,192.168.1.*'
Allow Access to users Connected to the Omega's AP. Any users connected to the Omega's AP should be able to access the Transmission App, so lets add that now.
By default, the Omega's AP network will assign addresses in the 192.168.3.*
space, but that's configurable so let's check:
root@Omega-267F:~# uci show network.wlan.ipaddr
network.wlan.ipaddr='192.168.8.1'
In this case, the address range was changed to 192.168.8.*
. Let's add this address range to the whitelist:
uci set transmission.@transmission[0].rpc_whitelist='127.0.0.1,192.168.1.*,192.168.8.*'
uci commit transmission
Restart the Transmission daemon for the changes to take effect:
/etc/init.d/transmission restart
Find your Omega's IP address. Run the ifconfig
command:
ifconfig
The IP address is printed in the inet addr
field, under the wlan0
section. Allow Access to Users on an Existing WiFi Network. For the purposes of this tutorial, let's say your Omega's IP address is 192.168.23.99
so we will be whitelisting addresses in the 192.168.23.*
range:
uci set transmission.@transmission[0].rpc_whitelist='127.0.0.1,192.168.1.*,192.168.8.*., 192.168.23.*'
uci commit transmission
Restart the Transmission daemon for the changes to take effect.
/etc/init.d/transmission restart
Install SambaFirst, we need to install the Samba Server on our Omega, to implement file sharing over our network:
opkg update
opkg install samba36-server
If this does not work, type:
opkg list | grep samba
The output will be something like:
samba36-client - 3.6.25-5 - ...
samba36-server - 3.6.25-5 - ...
Then in your opkg install
command, enter the listed sambaXY-server
. Configuring our Shared Directories Use vi
to modify the configuration file:
vi /etc/config/samba.
By default it will have the following:
config samba
option 'name' 'OpenWrt'
option 'workgroup' 'WORKGROUP'
option 'description' 'OpenWrt'
option 'homes' '0'
To add a Read-Only Share, add the following lines to /etc/config/samba: Notice the 'path' uses your mount point from before.
config 'sambashare'
option 'name' 'usb-share'
option 'path' '/mnt/sda1'
option 'guest_ok' 'yes'
option 'create_mask' '0700'
option 'dir_mask' '0700'
option 'read_only' 'yes'
For the change to take effect, restart Samba:
/etc/init.d/samba restart
Voila, your usb storage is now shared.
Connecting to a Samba Share (OSX)Open a Finder window and hit Command+K to open the "Connect to Server" window. In the Server Address, type:
smb://omega-ABCD.local
Where ABCD
is the unique identifier of your Omega and click Connect. After a little while, it will connect and prompt you for credentials. Since we've setup our Samba shares with guest_ok
enabled, select Guest and click Connect:
If you have multiple Samba shares configured, you will then be prompted to select the share that you would like to connect to. Select usb-share. After that, it will just be like another directory on your computer. When you want to disconnect, find the shared directory under the Shared header in your sidebar, click the Eject icon to disconnect.
Connecting to a Samba Share (Windows)Click the Start button and select Computer, then click Map a network drive on the top toolbar: In the window that opens, in the Folder form you'll need to enter the path to the Samba share. This includes the Omega's IP and the share name.
The syntax is: \\<Omega's IP>\<Share Name>
, for example:
\\192.168.1.226\usb-share.
Deselect Reconnect at Login and select Connect using different credentials and then click Finish:
The next window will prompt you for a username and password. Since we've setup our Samba shares with guest_ok
enabled, type Guest as the username and leave the password field blank. After a little while, it will connect and the share will be another drive on your computer. When you want to disconnect, find the mapped network drive on the sidebar, right-click it and select Disconnect.
After everything is installed and configured, you're all set to download using BitTorrent! You can point to the URL of the Torrent file which you wish to use, or you can upload a Torrent file.
Onion does not condone illegal downloading, only download content that is legally distributable! We recommend checking out this list of legal and free Torrent sources:
This guide was taken from the onion wiki: https://wiki.onion.io/Projects/Bit-Torrent-Client
Comments
Please log in or sign up to comment.