What's new

[TUTORIAL] Installing Rtorrent on AsusWrt Merlin routers through Entware

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Update: Whe I change the password in this file /opt/etc/lighttpd/rutorrent_passwd works! My old password is unice that not use to validate. I do not know what happen with that password.
 
Hi,

I just installed rTorrent on my ASUS RT-88U yesterday using the above instructions and it did get install without a lot of problems, I tried it for a bit, but its extremely buggy and unstable, I am going to remove it and try Transmission for now.

Anyone knows how to completely remove rTorrent?

is it "opkg remove rtorrent-easy-install" ?????????

[TUTORIAL] Installing Rtorrent on AsusWrt Merlin routers through Entware, network storage option.

Rtorrent is alternative to Transmission as a torrent client running on routers. It is considered to be “lighter” in terms of CPU usage and RAM. The following tutorial will explain how to install it on Asus routers running Merlin’s firmware. It has been tested on my RT-N66U with 374.41 version of Merlin’s FW.

Note: Torrent applications produce extensive write activity, so it is not recommended to use them on a router without HDD attached or without network storage, as extensive write activity may damage your MicroSD card or USB stick. This tutorial is focused on more difficult option to use network storage for torrent client files and downloaded files, but it could be easily applied for locally attached HDD drive. In that case we don’t need MicroSD card or USB stick and should install Entware and Rtorrent on the HDD and use it as torrent and downloaded files storage.

*** ADDITION, thanks to ryzhov_al ***
Please note that the best solution is to use USB HDD attached. In that case you should focus on steps 3 and 5 below. Torrent clients use memory mapping which is effective only on local drives. The "network solution" is feasible only if you have no USB HDD attached to the router or your network storage itself is unable to run the torrent client.
*** ADDITION ***

Prerequisites

Merlin’s FW with jffs enabled
MicroSD card or USB stick, plugged in the router, formatted as ext2 file system and mounted
Entware installed on the MicroSD card or USB stick
Network storage (PC, NAS, etc.)

Step 1. Preparing network storage.

Create samba share to be used by Rtorrent on your network storage. We can use any existing share, but it is better to create a separate one. Create dedicated user on network storage to be used by Rtorrent and give him a password. These username and password will be used below to mount the network share. We can use any existing user, but because of security reasons it is recommended to create dedicated one. This user should have full access to the share above.

Step 2. Mount the network share.

Ssh to the router as admin

ssh admin@<router IP>

Change dir to the desired folder on the MicroSD card. We assume that it is labeled and mounted by name under /mnt. In this tutorial it is named “Data”. We will create the mount point named “Torrent_Data” there.

cd /mnt/Data

Create a mount point for the network share

mkdir Torrent_Data

Mount the network share using share name, username and password created in Step 1.

mount \\\\<IP address of the network server>\\<share name> /mnt/Data/Torrent_Data -t cifs -o "username=<username>,password=<password>"

Step 3. Installation of Rtorrent.

We are using the easy installation script included in Entware. It will do everything for you. Just answer the questions. You may just press <enter> to accept default proposals as later we will change some settings to allow using of remote share. The script installs rtorrent, rutorrent (front end of rtorrent) and lighttpd. Here you can watch a video of similar installation

opkg install rtorrent-easy-install

Step 4. Configure Rtorrent to use network share

There are 3 directories which are essential for Rtorrent: download dir, watch dir and session dir. The installation script prompts only for download dir. Other two directories are created in /opt/etc/rtorrent where the rtorrent.conf file is created also. Now we should change their location from MicroSD card/USB stick to network share.

cd /mnt/Data/Torrent_Data
mkdir watchdir
mkdir session


Stop rtorrent and lighttpd

/opt/etc/init.d/ S85rtorrent stop
/opt/etc/init.d/ S80lighttpd stop

Edit rtorrent.conf file using vi or nano editors

nano /opt/etc/rtorrent/rtorrent.conf

Edit the relevant lines as follows and save the rtorrent.conf:

session = /mnt/Data/Torrent_Data/session
schedule = watch_directory,5,5,load_start=/mnt/Data/Torrent_Data/watchdir/*.torrent
directory = /mnt/Data/Torrent_Data


Now the rtorrent will download files in network share mount under /mnt/Data/Torrent_Data and will use as session dir and watch dir Torrent_Data/session and Torrent_Data/watchdir

Start the lighttpd and rtorrent

/opt/etc/init.d/ S80lighttpd start
/opt/etc/init.d/ S85rtorrent start


Arrange the network share to be mount after reboot by adding the following lines in the user script named “services-start”, located in /jffs/scripts, BEFORE the line “/opt/etc/init.d/rc.unslung start”

mount \\\\<IP address of the network server>\\<share name> /mnt/Data/Torrent_Data -t cifs -o "username=<username>,password=<password>"
sleep 5



Note 1: If a problem occurs to mount the network share during boot process, the rtorrent will never start!

Note 2: Any changes in rtorrent.conf file should be done only while the rtorrent is stopped. You may start and stop it using the scripts in /opt/etc/init.d as described above.

Step 5. Configure firewall to open ports for rtorrent

Two ports need to be open for better performance of rtorrent - the incoming connections port and the DHT port. The rtorrent may work without opening of these ports but it will work slower and using magnet links will be not possible. In this example we use TCP port 51200 as incoming port and UDP port 51201 as DHT port. You should replace the example ports with the ports listed in rtorrent.conf file - lines "port-range" for incoming port and "dht_port" for DHT port.

Include the following lines in firewall-start user script located in /jffs/scripts:

iptables -I INPUT -p tcp --destination-port 51200 -j ACCEPT
iptables -I INPUT -p udp --destination-port 51201 -j ACCEPT


Note: If the firewall-start user script does not exist, create it.
 
Caught a relevant headline, had to share:

Thanks for the link. Is this relevant only for rTorrent? AFAIK, most of them (all?) work via XML-RPC, so might be affected as well.
I see many choices on torrent-clients in entware repo, maybe there are better choices than rTorrent?
 
2 all who has this problem: just replace "rc.func" in /opt/etc/init.d with this one: https://raw.githubusercontent.com/monosoul/rc.func/master/rc.func . Problem is caused by entware's rc.func not able to differenciate firmware's lighttpd from entware's lighttpd.
No, you still need a USB key/drive. I am using a USB enclosure for a SSD drive on the USB 3.0 port, but I also went ahead and:
1) Change to DISABLE the - Reducing USB 3.0 interference - option in professional wireless settings
2) Turn DOWN the signal from Performance to Good on both 2.4 and 5 wireless signals

since I saw this had an impact on USB drive R/W performance and no problems so far, but I just wanted to put in my last 2 cents on rTorrent. Basically, I am giving up on rTorrent, because it is a mess and half the options do not work properly. I could not get:
1) Move completed files once downloaded - to work correctly and kept leaving meta and hash files behind
2) Hack check kept getting errors and I would have to manually recheck which would throw the router into a fit
a) safe_sync does not work and would crash rtorrent on start, so that suggestion does not work
3) I could not turn off pre-allocation of files which does not help when I want to "scan" and see what files actually completed
4) Files kept going into PAUSING mode when they were completed instead of STOP and stop-close options never seemed to work
and the list goes on...

Basically "garbage" :p and I switched to transmission. HUGE difference and everything working "right out of the box" and I love that you can have files with the .part extension, automatically move completed files, turn off pre-allocation and the list goes on. So I am sticking with transmission now...


Good luck to you guys on rTorrent...

:cool:

Great, it solved the web interface connection problem!
 
Basically "garbage" :p and I switched to transmission. HUGE difference and everything working "right out of the box"

Yep, rTorrent is a total mess. Switched to Transmission again, and it works brilliantly without any mumbo-jumbo with conf-files.
 
This is how you PROPERLY set AUTH for Rtorrent:

  1. Run rtorrent-easy-install , but Don't input any user:password when running rtorrent-easy-install!
  2. Stop both lighttpd & rtorrent services: /opt/etc/init.d/S80lighttpd stop & /opt/etc/init.d/S85rtorrent stop
  3. opkg install apache
  4. Create the file that contains the username and the password:
    Code:
    htdigest -c /opt/etc/lighttpd/.auth 'YOUR_REALM_NAME' root
    You'll be asked for a password.
  5. Edit the file /etc/lighttpd/lighttpd.conf and add the following lines in the end:
    Code:
    # Server Authentication
    server.modules += ( "mod_auth" )
    
    auth.debug = 0
    auth.backend = "htdigest"
    auth.backend.htdigest.userfile = "/opt/etc/lighttpd/.auth"
    
    auth.require = ( "/" => (
    "method" => "digest",
    "realm" => "YOUR_REALM_NAME",
    "require" => "valid-user"
    ))
  6. Now if you open the web browser, you'll be asked for a username (root) and password (the one you just gave).
All info taken from here.
 
Hi!! I have rutorrent issues when install rutorrent plugins. The Web UI show this error: https://pastebin.com/XEh532p7

I cann't found error by console. I have a Asus RT-AC3100 with Asuswrt-Merlin Firmware 384.6. The details of my system: https://pastebin.com/TTcvzGiU

The only way to use the rtorrent is without plugins.
Where I can found some log or how I can fix it?
Thanks in advance!
 
The problem is the "rutorrent-plugin-_task" rutorrend don't work after install that plugin but a lot and more important plugin required it. Samebody can tell me how I can fix?
Thanks
 
The problem is the "rutorrent-plugin-_task" rutorrend don't work after install that plugin but a lot and more important plugin required it. Samebody can tell me how I can fix?
Thanks
Rutorrent has a lot of problems. It took me a while to set it up.
Why not using Transmission client? Works like a charm..
 
Rutorrent has a lot of problems. It took me a while to set it up.
Why not using Transmission client? Works like a charm..

Before Rutorrent I used Transmission. Transmission is more basic than rutorrent. I know it makes it even lighter but rutorrent with it's plugins can run without problem on RT-AC3100.
The plugins I like are create torrents, delete, remote downloads, search in torrent sites, autotools, rss, scheduler, unpack, etc.

In other installations the rtorrent works fine.
 
I got Entware installed
I got DM uninstalled
I got Transmission stopped
But still:

Collected errors:
* pkg_run_script: package "rtorrent-easy-install" postinst script returned status 255.
* opkg_configure: rtorrent-easy-install.postinst returned 255.
 
Install entware from scratch after rebooting router
I did. It worked, I stopped it, started, stopped again and....same issue occured. I did have optware, then I installed entware and it was running smoothly with transmission which runs on entware, so I got entware installed. I dont understand what the issue might be, and there is nothing in the logs either. How do I turn on the debug mode?
 
Just to double check.....you can't have both optware and entware. It's one or the other.
Thanks, but how do I check this, other than having entware symlink and working opkg command? entware version of transmission runs fine, rutorrent doesnt
 
Do you get error when installing rutorrent or after?

Code:
opkg install rtorrent-easy-install
Package rtorrent-easy-install (0.2-3a) installed in root is up to date.
Configuring rtorrent-easy-install.

#### Welcome to rtorrent easy installation script!
 We assuming no lighttpd/rtorrent/rutorrent was installed before!
 Please, answer a few question to configure torrent client.
 Default aswers given in [brackets], just hit Enter to accept it.

Type "username:password" if you want to protect Web UI or hit Enter to leave password protection disabled []:
Which port should be used by web interface? [81]:
Enter (maximal) download speed in KB/s [2048]:
Enter (maximal) upload speed in KB/s [2048]:
Enter folder name on USB drive where torrent content should be stored [/opt/torrents]:

 Done! You may open 51411-51412 TCP/UDP ports on your router to
 facilitate uploading/donwloading. It's not necessary but recommended.
 rutorrent web UI will be available at following URL:

 http://<ip_address_of_router>:<port>/rutorrent

 Do you wish to start torrent client? [y]: y
 Starting lighttpd...              already running.
 Starting rtorrent...              failed.
Collected errors:
 * pkg_run_script: package "rtorrent-easy-install" postinst script returned status 255.
 * opkg_configure: rtorrent-easy-install.postinst returned 255.


And after:

Code:
 /opt/etc/init.d/S85rtorrent start
 Starting rtorrent...              failed.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top