Transmission Torrent Download Manager through Debian Wheezy Arm

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.

This version is for Arm routers: RT-AC56U, RT-AC68U, Rt-AC87U...

1 - Setup Debian Wheezy from here (remove transmission if is installed from optware with ipkg remove transmission)

2 - Enter chrooted debian with:

debian enter

3 - Update Debian

apt-get update
apt-get upgrade

4 - Install necessary packages

apt-get install wget libcurl4-openssl-dev libevent-dev

- Download and install updated version of libevent

cd /var/tmp
wget -c -O libevent_2.0.21-1_armel.deb http://goo.gl/6FgVBc
dpkg -i libevent_2.0.21-1_armel.deb

6 - Download and install transmission v2.84

wget -c -O transmission_2.84-1_armel.deb http://goo.gl/jd3IEz
dpkg -i transmission_2.84-1_armel.deb

7 - Download startup script

wget -c -O /etc/init.d/S95transmission-debian http://goo.gl/CTncEk
chmod 755 /etc/init.d/S95transmission-debian

8 - Start and stop transmission to create path

/etc/init.d/S95transmission-debian start
/etc/init.d/S95transmission-debian stop

9 - Backup and replace settings file with optimised one

mv /etc/transmission-daemon/settings.json /etc/transmission-daemon/settings.json.backup
wget -c -O /etc/transmission-daemon/settings.json http://goo.gl/Wti8e9

10 - Start transmission

/etc/init.d/S95transmission-debian start

11 - Go to default router ip address 192.168.1.1:9091 username admin, password admin, you can change this by editing /etc/transmission-daemon/settings.json file but be sure transmission is stopped before making changes.

transmission-2.84

12 - To create startup script we need to stop transmission, and exit debian

/etc/init.d/S95transmission-debian stop
exit

13 - Add transmission to chroted services list

echo "" >>/opt/etc/chroot-services.list
echo "S95transmission-debian" >>/opt/etc/chroot-services.list
chmod 755 /opt/etc/chroot-services.list

14 - Create post-mount script

nano /jffs/scripts/post-mount

Paste this lines

#!/bin/sh
sleep 10
/opt/etc/init.d/S99debian start

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

15 - 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/*

16 - Start transmission from outside debian together with mounted external folder

debian restart

Enjoy...

  • h3lpm4n

    Hello,

    I get the following error at Step 8.

    root@RT-AC68U-4090:/var/tmp# /etc/init.d/S95transmission-debian start

    bash: /etc/init.d/S95transmission-debian: /bin/sh^M: bad interpreter: No such file or directory

    The file and folder are actually present. So what am I missing out on?

    • /bin/sh^M: bad interpreter error is when you edit scripts with windows notepad, you should use notepad++
      Delete edited script and try again from step 7
      rm /etc/init.d/S95transmission-debian

      • h3lpm4n

        That is odd because I haven't edited anything yet. Just following the steps in order for now. Anyway will remove it and try again.

      • h3lpm4n

        Just tried it out. Same result. The file opens fine in nano as well, so I can't understand why it wouldn't work.

      • I will check the file when I get home

      • h3lpm4n

        Just solved it. When I opened the downloaded file in nano, it indicated that the file was in DOS format. So after pressing ^O, I pressed ^D which I presume switched it to Unix format and then saved it. Works fine now. Thanks a lot for the tutorial in general.

      • h3lpm4n

        Just to clear it up, the DOS save mode toggles with Alt+D and not Ctrl+D.

  • Gary

    Chinese name file after download cannot display the name in winscp and cannot del the file in winscp, how can i solve this?

    • Dunno, try to ask on some chinese forum

      • Gary

        okok thx ^^

      • Gary

        i searched in google with this problem in chinese forum, can anyone help me thx a lot!!

  • JCG

    Is it possible to install Transmission directly via Entware for ARM routers, or is Debian required?

  • Gary Chu

    i didn't change the setting with Debian,

    CHROOT_DIR=/tmp/mnt/sda1/entware.arm/debian

    EXT_DIR=/tmp/mnt/sda1/Media

    Transmission download-dir is /mnt

    but after i donwloaded a movie, i can't find it in the folder where the movie saved, i have check in these 3 location.

    tmp/mnt/sda1/asusware.arm/debian/mnt/media

    /tmp/mnt/sda1/opt/debian/mnt/media

    /tmp/mnt/sda1/media

    can u tell me where i saved? thx a lot

    • Don't forget to uncomment EXT_DIR line in S99debian script
      from
      # EXT_DIR=/tmp/mnt/sda1/Media
      to
      EXT_DIR=/tmp/mnt/sda1/Media

      deb restart

      • Gary Chu

        i did deb restart but i can't find the file i downloaded in /tmp/mnt/sda1/asusware.arm/debian/mnt/media, /tmp/mnt/sda1/opt/debian/mnt/media, or /tmp/mnt/sda1/media, can't find the storage location.

      • Send me output from:
        cat /opt/etc/init.d/S99debian grep | EXT_DIR
        cat /opt/debian/etc/transmission-daemon/settings.json | grep dir
        mount
        free
        df

      • Gary Chu

        cat /opt/etc/init.d/S99debian grep | EXT_DIR
        cat /opt/debian/etc/transmission-daemon/settings.json | grep dir

        #!/bin/sh
        PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin
        # Folder with Debian Wheezy
        CHROOT_DIR=/tmp/mnt/sda1/entware.arm/debian
        # Some folder outside of sandbox,
        # will be mounted to /mnt folder in Debian
        # Uncommented next line if needed
        # EXT_DIR=/tmp/mnt/sda1/Media

        Mount:
        gary@RT-AC68U-D270:/tmp/home/root# mount
        rootfs on / type rootfs (rw)
        /dev/root on / type squashfs (ro,relatime)
        devtmpfs on /dev type devtmpfs (rw,relatime,size=127764k,nr_inodes=31941,mode=755)
        proc on /proc type proc (rw,relatime)
        tmpfs on /tmp type tmpfs (rw,relatime)
        sysfs on /sys type sysfs (rw,relatime)
        devpts on /dev/pts type devpts (rw,relatime,mode=600)
        /dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
        usbfs on /proc/bus/usb type usbfs (rw,relatime)
        /dev/sdc5 on /tmp/mnt/sda2 type ext4 (rw,nodev,relatime,user_xattr,barrier=1,data=ordered)
        /dev/sdc1 on /tmp/mnt/sda3 type ext4 (rw,nodev,relatime,user_xattr,barrier=1,data=ordered)
        /dev/sda1 on /tmp/mnt/sda1 type ext4 (rw,nodev,relatime,user_xattr,barrier=1,data=ordered)
        devtmpfs on /tmp/mnt/sda1/entware.arm/debian/dev type devtmpfs (rw,relatime,size=127764k,nr_inodes=31941,mode=755)
        proc on /tmp/mnt/sda1/entware.arm/debian/proc type proc (rw,relatime)
        sysfs on /tmp/mnt/sda1/entware.arm/debian/sys type sysfs (rw,relatime)
        devtmpfs on /tmp/mnt/sda1/entware.arm/debian/dev type devtmpfs (rw,relatime,size=127764k,nr_inodes=31941,mode=755)
        devpts on /tmp/mnt/sda1/entware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
        proc on /tmp/mnt/sda1/entware.arm/debian/proc type proc (rw,relatime)
        sysfs on /tmp/mnt/sda1/entware.arm/debian/sys type sysfs (rw,relatime)
        devtmpfs on /tmp/mnt/sda1/entware.arm/debian/dev type devtmpfs (rw,relatime,size=127764k,nr_inodes=31941,mode=755)
        devpts on /tmp/mnt/sda1/entware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
        proc on /tmp/mnt/sda1/entware.arm/debian/proc type proc (rw,relatime)
        sysfs on /tmp/mnt/sda1/entware.arm/debian/sys type sysfs (rw,relatime)
        devtmpfs on /tmp/mnt/sda1/entware.arm/debian/dev type devtmpfs (rw,relatime,size=127764k,nr_inodes=31941,mode=755)
        devpts on /tmp/mnt/sda1/entware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
        proc on /tmp/mnt/sda1/entware.arm/debian/proc type proc (rw,relatime)
        sysfs on /tmp/mnt/sda1/entware.arm/debian/sys type sysfs (rw,relatime)
        devtmpfs on /tmp/mnt/sda1/entware.arm/debian/dev type devtmpfs (rw,relatime,size=127764k,nr_inodes=31941,mode=755)
        devpts on /tmp/mnt/sda1/entware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
        proc on /tmp/mnt/sda1/entware.arm/debian/proc type proc (rw,relatime)
        sysfs on /tmp/mnt/sda1/entware.arm/debian/sys type sysfs (rw,relatime)

        free:
        gary@RT-AC68U-D270:/tmp/home/root# free
        total used free shared buffers
        Mem: 255744 89580 166164 0 1848
        -/+ buffers: 87732 168012
        Swap: 1016872 0 1016872

        df:
        gary@RT-AC68U-D270:/tmp/home/root# df
        Filesystem 1K-blocks Used Available Use% Mounted on
        /dev/root 22400 22400 0 100% /
        devtmpfs 127764 0 127764 0% /dev
        tmpfs 127872 4776 123096 4% /tmp
        /dev/mtdblock4 64256 1772 62484 3% /jffs
        /dev/sdc5 28790400 32788 27221972 0% /tmp/mnt/sda2
        /dev/sdc1 512572 512564 0 100% /tmp/mnt/sda3
        /dev/sda1 2746855648 2587340 2597758792 0% /tmp/mnt/sda1
        devtmpfs 127764 0 127764 0% /tmp/mnt/sda1/entware.arm/debian/dev
        devtmpfs 127764 0 127764 0% /tmp/mnt/sda1/entware.arm/debian/dev
        devtmpfs 127764 0 127764 0% /tmp/mnt/sda1/entware.arm/debian/dev
        devtmpfs 127764 0 127764 0% /tmp/mnt/sda1/entware.arm/debian/dev
        devtmpfs 127764 0 127764 0% /tmp/mnt/sda1/entware.arm/debian/dev

        Is that what u need to help me ^^ i never use linux and learn c
        thank for the help

      • You didn't uncomment
        # EXT_DIR=/tmp/mnt/sda1/Media
        Should be
        EXT_DIR=/tmp/mnt/sda1/Media
        Restart debian after

      • ???

      • Gary Chu

        The torrent i downloaded (EXT_DIR=/tmp/mnt/sda1/Media) it appear and located in /mnt/sda1/entware.arm/debian/mnt. It work fine now, but after i del the torrent and download it again several time, don't know why the maximum of 48.5kb/s download speed.
        I also want to know it that possible to set a different drive eg. sda2 which is my downloaded file location. thx!

      • Gary Chu

        see below photo 47.85 at max won't change

      • You have to change ext_dir to which one you want.
        About download speed, try another torrent file, see if port is open and if you use my optimized settings.json should be fine.

      • Gary Chu

        ^^ i figure out my problem, i used the web control interface, i press the Alt-speed by accident, everything work fine now thx for your help

  • Ilyukhinr

    Hello! Thank you for a good guide! I have one question. TRANSMISSION download torrents in mnt / Transmission, but this folder is located in the folder Debian (mnt / asusware.arm / debian / mnt), how to make torrent download in sda1/transmission?

    • I'm not sure but could be possible if your external folder in S99debian script is mounted as
      EXT_DIR=/tmp/mnt/sda1/transmission
      and download-dir in /opt/debian/etc/transmission-daemon/settings.json is
      "download-dir": "/mnt",
      Now, if you need extdir for minidlna, you have to put all media files in /tmp/mnt/sda1/transmission

      • Ilyukhinr

        if "download-dir": "/mnt" - transmsission download in mnt / asusware.arm / debian / MNT!!!!, don`t but tmp/mnt

      • /tmp/mnt/sda1/asusware.arm/debian/mnt/transmission
        =
        /tmp/mnt/sda1/opt/debian/mnt/transmission
        =
        /tmp/mnt/sda1/transmission

      • Roman Ilyukhin

        Really? 1 and 2 - i agree, but 3?? In that folder no film, but in 1 - yes. Watch in pc on smb. Sorry, my english very-very bad. :))

  • Rokhsana

    Thanks a lot ,
    "Swap file" and "Access for wan" is the same as before ? If not , How can we do them here ?

    • Yes, are the same, verify with "free" command

      • Rokhsana

        Thanks , in Create post-mount script , the swap line is there too , what should we do ? sth like this:

        #!/bin/sh
        swapon /opt/swap
        sleep 10
        /opt/etc/init.d/S99debian start

      • It's all ok, after reboot should start automatically

      • Rokhsana

        Is it possible to change sittings of transmission within Transmission Remote GUI ? or we should change them with nano?

      • Rokhsana

        another question is that everytime I rebooted the modem , Downloads goes to 0% in transmission , why ?

      • Do you mean the router or you have another modem where ac router is connected?

      • Rokhsana

        the router itself , for example my download is about 17% and when I rebooted the modem without pausing that torrent , the torrent goes to 0% after the reboot.

        why ?

      • Probably you have some bad script, post output from:
        mount
        df
        free
        uname -a
        ls -l /jffs/scripts
        cat /opt/etc/init.d/S99debian
        cat /jffs/scripts/services-start
        cat /jffs/scripts/services-stop
        cat /jffs/scripts/post-mount

      • Rokhsana

        ASUSWRT-Merlin RT-AC56U_3.0.0.4 Sat Nov 8 02:23:13 UTC 2014
        admin@RT-AC56U-8E80:/tmp/home/root# mount
        rootfs on / type rootfs (rw)
        /dev/root on / type squashfs (ro,relatime)
        devtmpfs on /dev type devtmpfs (rw,relatime,size=127780k,nr_inodes=31945,mode=755)
        proc on /proc type proc (rw,relatime)
        tmpfs on /tmp type tmpfs (rw,relatime)
        sysfs on /sys type sysfs (rw,relatime)
        devpts on /dev/pts type devpts (rw,relatime,mode=600)
        /dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
        usbfs on /proc/bus/usb type usbfs (rw,relatime)
        /dev/sda1 on /tmp/mnt/sda1 type ext4 (rw,nodev,relatime,barrier=1,data=ordered)
        admin@RT-AC56U-8E80:/tmp/home/root# df
        Filesystem 1K-blocks Used Available Use% Mounted on
        /dev/root 19712 19712 0 100% /
        devtmpfs 127780 0 127780 0% /dev
        tmpfs 127888 4456 123432 3% /tmp
        /dev/mtdblock4 97024 2476 94548 3% /jffs
        /dev/sda1 60789820 1151356 56550440 2% /tmp/mnt/sda1
        admin@RT-AC56U-8E80:/tmp/home/root# free
        total used free shared buffers
        Mem: 255776 66212 189564 0 2312
        -/+ buffers: 63900 191876
        Swap: 524284 0 524284
        admin@RT-AC56U-8E80:/tmp/home/root# uname -a
        Linux RT-AC56U-8E80 2.6.36.4brcmarm #1 SMP PREEMPT Fri Nov 7 00:21:41 EST 2014 armv7l GNU/Linux
        admin@RT-AC56U-8E80:/tmp/home/root# ls -l /jffs/scripts
        -rwxrwxrwx 1 admin root 206 Dec 1 10:37 firewall-start
        -rwxrwxrwx 1 admin root 68 Dec 1 12:23 post-mount
        -rwxrwxrwx 1 admin root 28 Dec 1 10:40 services-stop
        admin@RT-AC56U-8E80:/tmp/home/root# cat /opt/etc/init.d/S99debian
        #!/bin/sh

        PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin
        # Folder with Debian Squeeze
        CHROOT_DIR=/tmp/mnt/sdc1/asusware.arm/debian
        # Some folder outside of sandbox, will be mounted to /mnt folder in Debian
        # Leave commented if not needed
        EXT_DIR=/tmp/mnt/sdc1

        CHROOT_SERVICES_LIST=/opt/etc/chroot-services.list
        if [ ! -e "$CHROOT_SERVICES_LIST" ]; then
        echo "Please, define Debian services to start in $CHROOT_SERVICES_LIST first!"
        echo "One service per line. Hint: this is a script names from Debian's /etc/init.d/"
        exit 1
        fi
        MountedDirCount="$(mount | grep $CHROOT_DIR | wc -l)"
        start() {
        if [ $MountedDirCount -gt 0 ]; then
        echo "Chroot'ed services seems to be already started, exiting..."
        exit 1
        fi
        echo "Starting chroot'ed Debian services..."
        for dir in dev proc sys; do
        mount -o bind /$dir $CHROOT_DIR/$dir
        done
        [ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt
        for item in $(cat $CHROOT_SERVICES_LIST); do
        chroot $CHROOT_DIR /etc/init.d/$item start
        done
        }

        stop() {
        if [ $MountedDirCount -eq 0 ]; then
        echo "Chroot'ed services seems to be already stopped, exiting..."
        exit 1
        fi
        echo "Stopping chroot'ed Debian services..."
        for item in $(cat $CHROOT_SERVICES_LIST); do
        chroot $CHROOT_DIR /etc/init.d/$item stop
        sleep 2
        done
        mount | grep $CHROOT_DIR | awk "{print $3}" | xargs umount
        }

        status() {
        if [ $MountedDirCount -gt 0 ]; then
        echo "Chroot'ed services is running"
        else
        echo "Chroot'ed services is stopped"
        fi
        }

        case "$1" in
        start)
        start
        ;;
        stop)
        stop
        ;;
        restart)
        stop
        sleep 5
        start
        ;;
        status) status
        ;;
        *)
        echo "Usage: $0 (start|stop|restart|status)"
        exit 1
        ;;
        esac

        echo Done.
        exit 0
        admin@RT-AC56U-8E80:/tmp/home/root# cat /jffs/scripts/services-start
        cat: can't open '/jffs/scripts/services-start': No such file or directory
        admin@RT-AC56U-8E80:/tmp/home/root# cat /jffs/scripts/services-stop
        #!/bin/sh
        swapoff /opt/swap
        admin@RT-AC56U-8E80:/tmp/home/root# cat /jffs/scripts/post-mount
        #!/bin/sh
        swapon /opt/swap
        sleep 10
        /opt/etc/init.d/S99debian start

      • Rokhsana

        it doesn't load transmission at startup now too ,

      • Of corse, your disk is mounted as sda1 but your S99debian script is setup to /sdc1
        Another issue: you have to mount a single folder on /tmp/mnt/sda1 as EXT_DIR not the whole partition, ex. /tmp/mnt/sda1/Media

        In rest all ok

      • Almost all settings may be changed in TRG, username, password and some other only by editing /etc/transmission-daemon/settings.json but transmission has to be stopped

SoftEther VPN Running on AsusWRT Routers
Minidlna UPnP Media Server through Debian Jessie Arm
How to Mount Samba Shares inside Chrooted Debian
Nginx Web Server with PHP Support through Optware-NG
Minidlna UPnP Media Server through Debian Jessie Arm
How to Mount Samba Shares inside Chrooted Debian
Spreed WebRTC server and web client
Asterisk VoIP Server running on AsusWRT Routers
SoftEther VPN Running on AsusWRT Routers
NZBGet through Entware
Minidlna UPnP Media Server through Debian Jessie Arm
NetData System Monitor Entware

SUBSCRIBE

To be notified by email when a new tutorial is posted :)

Thanks for Subscribing! I'll keeping you up-to-date with latest tutorials!

Something went wrong, try again...