Transmission Download Manager through New Generation Optware

Transmission is a file sharing program.

When you run a torrent, its data will be made available to others by means of upload.

Any content you share is your sole responsibility.

Entware version here

0 - Flash latest version of RMerlin firmware from here
1 - Install New Generation Optware from here
2 - Login to router with putty terminal and install transmission with this commands:

ipkg install transmission nano rtmpdump

3 - Start transmission

/opt/etc/init.d/S95transmission start

4 - Open transmission webpage by accessing default router ip address and port 9091, ex. www.asusrouter.com:9091 (username: admin and password: admin)
The default download folder is on /mnt/sda1/Transmission (will be created automatically with the first downloaded torrent and can be changed editing settings.json file) if your usb disk has a label, change sda1 with the disk label. Be sure transmission-daemon is not running or changes will be overwritten!!!

5 - Stop transmission and with nano you can edit any settings like enable / change username, password:

/opt/etc/init.d/S95transmission stop
nano /opt/etc/transmission-daemon/settings.json

Save settings with CTRL-O, press ENTER and exit nano with CTRL-X

6 - Start transmission again

/opt/etc/init.d/S95transmission start

7 - Create init-start script for some memory tweaks as suggested by ryzhov_al

nano /jffs/scripts/init-start

#!/bin/sh
echo 524288 > /proc/sys/net/core/rmem_max
echo 524288 > /proc/sys/net/core/wmem_max
echo 8192 > /proc/sys/vm/min_free_kbytes

Save with CTRL-O, press ENTER and exit nano with CTRL-X

Make scripts executable

chmod a+rx /jffs/scripts/*


ACCESS FROM WAN
• If you want to access transmission from WAN like work, school, smartphone, tablet or some other device we need to open the port 9091 but the firmware doesn't allow port forwarding to the router himself, for that we will use the scripts on /jffs partition:

Create firewall rules

cat >> /jffs/scripts/firewall-start << 'EOF'
#!/bin/sh
iptables -I INPUT -p tcp --destination-port 9091 -j ACCEPT
iptables -I INPUT -p tcp --destination-port 51413 -j ACCEPT
EOF

Press ENTER 

Make scripts executable and apply rules

chmod a+rx /jffs/scripts/*
sh /jffs/scripts/firewall-start

Go to YourWanIp:9091 on preferred internet browser or install Transmission Remote GUI

TransmissionRemoteGUI


EMAIL NOTIFICATIONS
If you want to be notified when a torrent has finished downloading, place the folowing script whitch I called tmail.sh in /jffs/scripts but first don't forget to fill: SMTP, FROM, TO, USER and PASS with your credentials.

nano /jffs/scripts/tmail.sh

#!/bin/sh

SMTP="your-smtp-server:587 or 25"
FROM="your-email-address"
TO="your-email-address"
USER="email-user-name"
PASS="email-password"
FROMNAME="Asus Router"
torrent_name="$TR_TORRENT_NAME"

echo "Subject: Download notification!" >/tmp/tmail.txt
echo "From: "$FROMNAME"<$FROM>" >>/tmp/tmail.txt
echo "Date: `date -R`" >>/tmp/tmail.txt
echo "" >>/tmp/tmail.txt
echo Transmissionbt has finished downloading "$TR_TORRENT_NAME" on `date +%d/%m/%Y` at `date +%T` >>/tmp/tmail.txt
echo "" >>/tmp/tmail.txt
echo "Your friendly router." >>/tmp/tmail.txt
echo "" >>/tmp/tmail.txt

cat /tmp/tmail.txt | /usr/sbin/sendmail -S"$SMTP" -f"$FROM" $TO -au"$USER" -ap"$PASS"

rm /tmp/tmail.txt

Stop transmission daemon, change this two lines in /opt/etc/transmission-daemon/settings.json and start transmission again

/opt/etc/init.d/S95transmission stop
nano /opt/etc/transmission-daemon/settings.json

"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/jffs/scripts/tmail.sh",

/opt/etc/init.d/S95transmission start

TROUBLESHOOTING

If you have difficulties with installation process or transmissionbt usage, copy paste from terminal the next commands and post here followed by issue details:

uname -a
mount
df
free

Thanks @alllexx for this modern Optware port

This tutorial is dedicated @MelissaJS

REVIEW (CLICK ON THE STARS TO RATE!)
4.5
Sending
User Review
4.89 (18 votes)