Tutorial to compile and install Transmission on FFP 0.7-arm

Marvell Kirkwood based
Post Reply
barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Tutorial to compile and install Transmission on FFP 0.7-arm

Post by barmalej2 » Tue Aug 14, 2012 6:58 am

This tutorial contains step by step instructions how to setup Transmission on NSA-310 (firmware 4.50) with FFP 0.7-arm (version 2012.05.28).
All steps below I did logged as root in ssh session.

Before start, update /ffp/funpkg/cache/sites file to have access via slacker tool to five repositories of packages for FFP 0.7/arm-Kylek, Memiks, Fonz, Mijzelf and Uli:

Code: Select all

wget http://wolf-u.li/u/441 -O /ffp/bin/uwsiteloader.sh

Code: Select all

chmod a+x /ffp/bin/uwsiteloader.sh

Code: Select all

uwsiteloader.sh
In menu select all five repositories and update them.
Note 1:you can use "slacker -Ua", then installing from repositories.This will update the list of packages available on these five repositories.

Code: Select all

slacker -Ua
Note 2:sometimes then one of repositories is down, it can cause "slacker -Ua" to fail, so use again "uwsiteloader.sh" and unselect not working repository from the list of available.

Let's start.
1.Install compile and dependencies (some of them comes already pre-installed with ffp):
• autoconf
• automake
• bash (default installed with ffp)
• binutils
• bison
• coreutils (default installed with ffp)
• flex
• gcc
• gettext (default installed with ffp)
• grep (default installed with ffp)
• linux-headers
• libtool
• make
• m4
• mpfr
• patch
• pkg-config
• uClibc

Code: Select all

slacker -UaA s:automake s:autoconf s:binutils  s:bison s:flex  s:gcc s:linux-headers s:libtool s:make  s:mpfr s:m4 s:patch s:pkg-config s:uClibc

2. Install additional packages needed for Transmission:
• openssl (default installed with ffp)
• curl
• libevent
• intltool

Code: Select all

slacker -aA  s:curl mz:libevent s:intltool
3. Create temporary directory structure for compiling and making FFP package:

Code: Select all

mkdir -p /mnt/HD_a2/build/tmp
and go to build directory:

Code: Select all

cd /mnt/HD_a2/build
4. Get Transmission source files:

Code: Select all

wget http://download.transmissionbt.com/files/transmission-2.61.tar.xz
and untar them

Code: Select all

tar Jxvf  transmission-2.61.tar.xz
5. Enter Transmission source files directory:

Code: Select all

cd transmission-2.61
6. Configure source files for FFP:

Code: Select all

./configure --prefix=/ffp --enable-lightweight
7. Compile Transmission:

Code: Select all

make
8. Install to temporary directory:

Code: Select all

make install DESTDIR=/mnt/HD_a2/build/tmp
9. Create additional "start" directory in /mnt/HD_a2/build/tmp/ffp for transmission startup-shutdown script file:

Code: Select all

mkdir -p /mnt/HD_a2/build/tmp/ffp/start
and create startup-shutdown script file:

Code: Select all

touch /mnt/HD_a2/build/tmp/ffp/start/transmission.sh
10. Activate file for startup:

Code: Select all

chmod a+x /mnt/HD_a2/build/tmp/ffp/start/transmission.sh
11. Go to:

Code: Select all

cd /mnt/HD_a2/build/tmp/ffp/start
and edit transmission.sh (paste the following text to file):

Code: Select all

#!/ffp/bin/sh

# PROVIDE: Transmission

. /ffp/etc/ffp.subr

TRANSMISSION_HOME=/mnt/HD_a2/transmission

name="transmission-daemon"
command="/ffp/bin/$name"
start_cmd="transmission_start"
stop_cmd="transmission_stop"
status_cmd="transmission_status"
user=root
su_cmd="/ffp/bin/su"

transmission_start()
{
	if [ ! -d ${TRANSMISSION_HOME} ]; then
		$su_cmd $user -c "mkdir ${TRANSMISSION_HOME}"
	fi
	echo "Starting $name"
		$su_cmd $user -c "$command -g ${TRANSMISSION_HOME} -e ${TRANSMISSION_HOME}/$name.log"
}

transmission_stop()
{
	echo "Stopping $name"
		/ffp/bin/killall -SIGINT $name
}

transmission_status()
{
	_pids=$(pidof $name)
	if test -n "$_pids"; then
		echo "$name is running, pid:"
		pidof $name
	else
		echo "$name not running"
	fi
}

run_rc_command "$1"
12. Enter tmp directory:

Code: Select all

cd /mnt/HD_a2/build/tmp
13. Make FFP package:

Code: Select all

makepkg transmission 2.61 0
This will create redistributable FFP 0.7 arm package transmission-2.61-arm-0.txz in /tmp directory (not in /mnt/HD_a2/build/tmp!)

14. Go to

Code: Select all

cd /tmp
and delete temporary "build" directory:

Code: Select all

rm -rf /mnt/HD_a2/build
(you can leave it or move it to another location if you will need later. It is not necessary step)

15. Create new directory in /ffp/funpkg/ :

Code: Select all

mkdir -p /ffp/funpkg/additional
16. Move new package transmission-2.61-arm-0.txz to /ffp/funpkg/additional

Code: Select all

mv /tmp/transmission-2.61-arm-0.txz /ffp/funpkg/additional
17. Install Transmission package:

Code: Select all

funpkg -i /ffp/funpkg/additional/transmission-2.61-arm-0.txz
18. Run start up file to create Transmission home directory (/mnt/HD_a2/transmission) and settings file settings.json in it:

Code: Select all

/ffp/start/transmission.sh start
And stop transmission:

Code: Select all

/ffp/start/transmission.sh stop
19. Go to Transmission home directory:

Code: Select all

cd /mnt/HD_a2/transmission
and edit transmission settings file-settings.json with text editor:
"download-dir": "/mnt/HD_a2/video", -points to HDD root directory video (built-in sharing directory on Zyxel NSA 310)
"incomplete-dir": "/mnt/HD_a2/video", -just in case, but I suggest do not enable it
"lpd-enabled": true, -local peers discovery
"rpc-whitelist": "127.0.0.1,192.168.0.*", -add local-LAN (not wan ip in any case) ip address of your computer from which you are connecting to NSA or specify local subnet as I did.
"trash-original-torrent-files": true, -why to collect garbages?
"umask": 0, -will give you access to downloaded files via LAN
"watch-dir": "/mnt/HD_a2/video", -directory to put *.torent files for download
"watch-dir-enabled": true

20.Start transmission daemon again:

Code: Select all

/ffp/start/transmission.sh start
That is all. The end. At last :mrgreen:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

Other useful info:

View status of Transmission daemon:

Code: Select all

/ffp/start/transmission.sh status
Stop the daemon:

Code: Select all

/ffp/start/transmission.sh stop
or

Code: Select all

killall transmission-daemon
Deactivate startup on NAS boot:

Code: Select all

chmod a-x /ffp/start/transmission.sh
Configure transmission, upload torrent files (*.torrent) and view status of downloads via browser:

Code: Select all

http://nsa310:9091
or

Code: Select all

http://YourNasIP:9091
You can mount as network disk the following path \\nsa310\video (\\YourNasIP\video) and download *.torrent files to it. Transmission will monitor this folder for *.torrent files and will begin to download almost immediately. There is a possibility to use for downloads third party transmission remote clients like transmission-remote-dotnet or transmission-remote-GUI also.
------------------------------------------------------------------------------------------------------------------------------

How to uninstall Transmission
1. Stop daemon:

Code: Select all

/ffp/start/transmission.sh stop
2. Uninstall the package:

Code: Select all

funpkg -r transmission-2.61-arm-0.txz
or you can remove via slacker:

Code: Select all

slacker -rA transmission
3. Remove unnecessary left startup file:

Code: Select all

rm /ffp/start/transmission.sh
Last edited by barmalej2 on Thu Jan 10, 2013 9:37 am, edited 34 times in total.

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: Tutorial to compile, install and configure Transmission

Post by barmalej2 » Tue Aug 14, 2012 7:32 am

Transmission 2.61 version has known bugs in Web GUI.
https://forum.transmissionbt.com/viewto ... =8&t=13662
https://forum.transmissionbt.com/viewto ... =8&t=13652
https://forum.transmissionbt.com/viewto ... =8&t=13664
2.60 version didn't have them. So, if you have a computer with windows xp and IE8, I suggest to compile and install version 2.60 or to use another browser (Chrome, firefox, IE9) for connecting with 2.61 web GUI. 2.70 is planned to resolve these bugs.

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by barmalej2 » Thu Sep 27, 2012 11:05 am

New version of transmission is available-2.71 for FFP 0.7-arm

If you updating previous version compiled using this tutorial:

Code: Select all

/ffp/start/transmission.sh stop; slacker -UaA mz:transmission-2.71-arm-0.txz; /ffp/start/transmission.sh start
If you installing first time:

Code: Select all

slacker -UaA mz:transmission-2.71-arm-0.txz; /ffp/start/transmission.sh start; /ffp/start/transmission.sh stop
Then follow instructions from the step 19 in first post.

asch75
Posts: 8
Joined: Wed Sep 26, 2012 4:07 pm

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by asch75 » Mon Oct 08, 2012 7:07 pm

Hi, I'm having a high cpu usage when using transmission in my NSA-310. Usally CPU is about 100%.
Do you have the same behaviour?

Thanks.

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by barmalej2 » Tue Oct 09, 2012 4:44 am

asch75 wrote:Hi, I'm having a high cpu usage when using transmission in my NSA-310. Usally CPU is about 100%.
Do you have the same behaviour?
Thanks.
Yes, indeed. Mine download speed can reach up to 12 MB/s (fibre optic internet connection) and transmission eats CPU almost at 100 %, when downloading. If you have high internet speed, transmission can cause such behaviour. Returns to normal when downloads are finished. On lower speed internet connection, CPU usage is around 15-20%, when downloading (tested myself on different internet connection-DSL). If you are downloading a lot or having CPU overheat problems, try to limit your download speed in transmission settings and see what happens.

asch75
Posts: 8
Joined: Wed Sep 26, 2012 4:07 pm

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by asch75 » Tue Oct 09, 2012 11:08 am

Do you have a NSA310? What firmware version do you have installed?

My CPU is jumping up and down, and also my download speed, from 13 to 337 kbps, every few seconds.

Can you post your settings.json?

Thanks.

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by barmalej2 » Tue Oct 09, 2012 11:25 am

asch75 wrote:Do you have a NSA310? What firmware version do you have installed?

My CPU is jumping up and down, and also my download speed, from 13 to 337 kbps, every few seconds.

Can you post your settings.json?

Thanks.
With such speed, CPU 100% usage is abnormal. On DSL connection up to 300 kbps, my CPU usage never climbs over 20 % with transmission. And yes I have NSA310 firmware 4.50. Are you sure, that transmission causes such high CPU usage? I can post settings.json in evening, but I am not sure, will that help you.

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by barmalej2 » Tue Oct 09, 2012 4:11 pm

Here are my transmission settings:

Code: Select all

{
    "alt-speed-down": 50, 
    "alt-speed-enabled": false, 
    "alt-speed-time-begin": 540, 
    "alt-speed-time-day": 127, 
    "alt-speed-time-enabled": false, 
    "alt-speed-time-end": 1020, 
    "alt-speed-up": 50, 
    "bind-address-ipv4": "0.0.0.0", 
    "bind-address-ipv6": "::", 
    "blocklist-enabled": false, 
    "blocklist-url": "http://www.example.com/blocklist", 
    "cache-size-mb": 8, 
    "dht-enabled": true, 
    "download-dir": "/mnt/HD_a2/video", 
    "download-queue-enabled": true, 
    "download-queue-size": 5, 
    "encryption": 0, 
    "idle-seeding-limit": 15, 
    "idle-seeding-limit-enabled": false, 
    "incomplete-dir": "/mnt/HD_a2/video", 
    "incomplete-dir-enabled": false, 
    "lpd-enabled": true, 
    "message-level": 2, 
    "peer-congestion-algorithm": "", 
    "peer-limit-global": 300, 
    "peer-limit-per-torrent": 60, 
    "peer-port": 51413, 
    "peer-port-random-high": 65535, 
    "peer-port-random-low": 49152, 
    "peer-port-random-on-start": false, 
    "peer-socket-tos": "default", 
    "pex-enabled": true, 
    "port-forwarding-enabled": true, 
    "preallocation": 1, 
    "prefetch-enabled": 0, 
    "queue-stalled-enabled": true, 
    "queue-stalled-minutes": 30, 
    "ratio-limit": 2, 
    "ratio-limit-enabled": false, 
    "rename-partial-files": true, 
    "rpc-authentication-required": false, 
    "rpc-bind-address": "0.0.0.0", 
    "rpc-enabled": true, 
    "rpc-password": "{98951170b2c4932036abc14829a6fd5dc8ac2e151N4TsJ8T", 
    "rpc-port": 9091, 
    "rpc-url": "/transmission/", 
    "rpc-username": "", 
    "rpc-whitelist": "127.0.0.1,192.168.0.*", 
    "rpc-whitelist-enabled": true, 
    "scrape-paused-torrents-enabled": true, 
    "script-torrent-done-enabled": false, 
    "script-torrent-done-filename": "", 
    "seed-queue-enabled": false, 
    "seed-queue-size": 10, 
    "speed-limit-down": 100, 
    "speed-limit-down-enabled": false, 
    "speed-limit-up": 100, 
    "speed-limit-up-enabled": false, 
    "start-added-torrents": true, 
    "trash-original-torrent-files": true, 
    "umask": 0, 
    "upload-slots-per-torrent": 100, 
    "utp-enabled": true, 
    "watch-dir": "/mnt/HD_a2/video", 
    "watch-dir-enabled": true
}

asch75
Posts: 8
Joined: Wed Sep 26, 2012 4:07 pm

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by asch75 » Tue Oct 09, 2012 4:19 pm

Hi. Thanks. Seems that one of my torrents is causing this problem. When I enable it the CPU usage hits 100% and down to 10% in a infinite loop. It's a big torrent, about 64GB (3x20GB files aprox).
After enabling somo other torrents and disabling the BIG ONE torrent I found that the hard drive sounds a lot quieter, and the CPU usage is ok.

Maybe it's a problem with big files?

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by barmalej2 » Tue Oct 09, 2012 6:30 pm

Maybe. There is no program without vice. Transmission is a not an exception.

Mijzelf
Posts: 6226
Joined: Mon Jun 16, 2008 10:45 am

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by Mijzelf » Tue Oct 09, 2012 6:53 pm

64GB!

Torrent cuts the files in many small pieces, normally 64~128kB, but for a 64GB file I suppose it will be bigger, and these pieces are distributed. Randomly, not in some particular sequence. In your case this means that the OS can hardly get any benefit from the disk cache, because the range of the file is *much* bigger than any cache, so the disk will be constantly searching for the right position for pieces.
I suppose that when you look at the CPU load using top, you'll see it's most of the time in 'wa' state, which means is't waiting for io completion. It could do some other task in this time, assuming that this task doesn't need disk access.

mp8
Posts: 2
Joined: Wed Nov 28, 2012 4:10 pm

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by mp8 » Wed Nov 28, 2012 4:12 pm

How edit setting.json? When i try to open/edit In file zilla i got this 550 Can't open settings.json: Permission denied

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by barmalej2 » Thu Nov 29, 2012 3:22 pm

Via FTP-don't know. Via ssh with FFP you can use nano, vim or Midnight Commander's editor. I prefer Midnight Commander's editor. It's only possible if you have FFP on your NAS.

Connect via ssh to NAS as root.
Midnight Commander is available on Mijzelf repository-(mz):

Code: Select all

slacker -aA mz:glib2 mz:mc
Shortly to edit file:
type mc in command line
move cursor on file you want to edit
press F4
edit
press F10 -exit from editor and press YES to save changes.
press F10 again-exit from Midnight Commander and return to command line.

mp8
Posts: 2
Joined: Wed Nov 28, 2012 4:10 pm

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by mp8 » Sat Dec 01, 2012 11:31 am

barmalej2 Thnak you. Transmission working now.

daavidfischer7
Posts: 3
Joined: Tue Dec 04, 2012 6:20 am

Re: Tutorial to compile and install Transmission on FFP 0.7-

Post by daavidfischer7 » Tue Dec 11, 2012 12:16 pm

This is a great tutorial. I am sure it will help a lot of users of this forum who are new to all this and have pretty much less knowledge regarding the topic. I personally found it to be very easy to understand. Thanks.



_________
David Fischer
fixedassetturnovers.com

Post Reply