Make a Low-Power Media Server
Install and Configure Transmission
Software for Linux is downloadable as "packages". A package includes both the software files and automated install instruction files. A package manager makes using packages simple. The package manager for the NSLU2 (called ipkg) will be used to directly download and install the transmission application. Within the root Telnet session:
- Update the unslung package manager to know about all the latest packages available (i.e. applications and system enhancements) by typing: ipkg update
This downloads from standard sites a complete list of available packages.
- Download and install latest transmission by typing: ipkg install transmission
After the package is download you will see messages indicating what is happening during the install.
- Create a directory for downloads by typing: mkdir /public/Downloads
Note, the capital "D" on downloads to fit in with Windows conventions.
- Cause transmission to create its default working files and directories.
For the command below, you need to give the IP addresses for the PCs that you want to be able to use the transmission web interface. The simplest solution is to use your PC's IP address, but replace the last number with a "*", to allow for all your PCs. This is shown below for a PC with an IP address 192.168.0.4.
- Manually start the transmission daemon by typing:
/opt/bin/transmission-daemon -g /public/Config \
-w /public/Downloads -a "127.0.0.1,192.168.0.*"
- Manually kill the transmission-daemon by typing:
killall transmission-daemon
Note. When Transmission-daemon starts for the first time it creates its working files and directories, except for the settings.json file that is written every time the transmission-daemon is killed.
Note. Daemon is the traditional Unix name for a background service.
- Use the Window's wordpad editor to open the file settings.json.
- From My Network Places open DISK 2 on the Linksys NSLU2.
As mentioned before, if the top-level shortcut does not work, try and drill-down from "Entire Network".
- Then open Config and right click on settings.json.
- Select "Open With", "Choose Program" and "Browse" to
C:\Program Files\Windows NT\Accessories\wordpad.exe
- Select "Always use the selected program to open this type of file".
- Select OK.
Note, you should only change the settings.json file when transmission-daemon is not running, as transmission-daemon always overwrites this file when it exits.
- In the wordpad editor check the following lines:
- "download-dir": "\/public\/Downloads"
- "rpc-whitelist": "127.0.0.1,192.168.0.*"
The IP address above may be different, but should match your PCs.
If these lines are not correct, then restart transmission-daemon with the correct option values and kill it, as shown previously.
- On your router forward port 51413.
This needs to be forwarded to the NSLU2's IP address. Without this, you will not be able to accept incoming connections and so will not achieve the maximum download speed.
For my Netgear router, I use the Services page to add a service named "Transmission" of type TCP with a start port and end port of 51413.
Then in the Firewall Rules page I add an inbound service of name "Transmission" with action "ALLOW always" and set "Send to LAN Server" address to the NSLU2 IP address. For your router it should be similar, but you may need to web search for the details.
- Automatically start transmission-daemon at NSLU2 start-up.
Strictly this is optional, as you can always start the transmission-daemon manually. However, if you are using the NSLU2 as a dedicated downloader then it is recommended, as it simplifies using the NSLU2.
- Create the directory /opt/etc by typing: mkdir /opt/etc
- Create the directory /opt/etc/init.d by typing: mkdir /opt/etc/init.d
- Create the automatic start file by typing:
cat > /opt/etc/init.d/S88transmission
Now copy and paste the following text into telnet:
#!/bin/sh
export PATH=/opt/bin:$PATH
if [ -n "`pidof transmission-daemon`" ]; then
killall transmission-daemon
fi
transmission-daemon -g /public/Config
If after pasting you are not on a new line, then press the enter key. To finish, press CTRL-D (i.e. hold the Ctrl key down and press the D key).
- Make this executable by typing:
chmod +x /opt/etc/init.d/S88transmission
- Create the automatic stop file by typing:
cat > /opt/etc/init.d/K88transmission
Now copy and paste the following text into telnet:
#!/bin/sh
killall transmission-daemon
If after pasting you are not on a new line, then press the enter key. To finish, press CTRL-D (i.e. hold the Ctrl key down and press the D key).
- Make this executable by typing:
chmod +x /opt/etc/init.d/K88transmission
- Check if transmission-daemon is starting automatically.
- Restart the NSLU2 by typing "DO_Reboot"
- Browse to the NSLU2 Home page and enable telnet.
- In your command window, start a telnet session and login as root.
- Check if the transmission-daemon is running by typing:
pidof transmission-daemon
If three numbers are printed then transmission-daemon started automatically, but if no numbers are returned then it is not running. It is unlikely, but if anything else is printed then restart the NSLU2.
Now you are ready to test if this all works correctly.