1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

[GUIDE] Installing aMule with Entware

Discussion in 'Asuswrt-Merlin' started by noric, Sep 15, 2014.

  1. noric

    noric Senior Member

    Joined:
    Jul 26, 2014
    Messages:
    213
    Ok, after a lot of reading and effort I've finally set up aMule working on my RT-N66U with entware. Probably easy for some of you, but let's help those that aren't very experienced. :eek:
    I found this quite tricky because you need to change quite a lot of the default settings and it's not easy because 1) they are not very documented and 2) you don't have a GUI to play with. In the end I installed aMule in Ubuntu, configured it, grabbed the needed files and pasted them in the router's aMule.
    I also read several guides about aMule on NAS systems, to configure the web interface and the remote GUI.

    Prerequisite: I assume you have entware already installed. Please refer to Merlin's guide about how to install entware.

    1) log in via telnet and type:
    Code:
    opkg install amule
    2) type:
    Code:
    /opt/etc/init.d/S57amuled start
    3) type:
    Code:
    /opt/etc/init.d/S57amuled stop
    4) type:
    Code:
    echo -n yourpasswordhere | md5sum | cut -d ' ' -f 1
    This will create your aMule's password. Just enter your desired password where I wrote "yourpasswordhere". The command will output a long string, which you need to copy.

    5) Download the attachment at the end of my post. Open in notepad++ (not windows notepad) the downloaded amule.conf file. Search "ECPassword=" and paste the string you copied at point 4. Search "Password=" and do the same.
    Now search "TempDir=" and "IncomingDir=". These are the downloads folders, which you may want to change to your likings. Defaults are in /mnt/sda1/Torrent
    You may want to change other settings in amule.conf. Just to mention some of them: MaxUpload (default is 0, i.e. unlimited upload speed; measured in kB), MaxDownload (default is 0, i.e. unlimited download speed; measured in kB), MinFreeDiskSpace (default is 10240, i.e. stop downloading if less than 10GB of free disk space).
    I suggest that you also change the default TCP (Port=) and UDP (UDPPort=) ports, because they are blacklisted by some servers AFAIK.

    7) Open shareddir.dat in notepad++ and enter here the folders you want to share with aMule. In the file I provide I share the folder /mnt/sda1/Media: adjust or delete this to your likings. One folder per line.
    Please note that the Temp and Incoming folders are shared even if they aren't listed here.

    8) Copy addresses.dat, amule.conf, nodes.dat, server.met, shareddir.dat to \\rt-n66u\entware\var\amule (it's /opt/var/amule if you copy via telnet).

    9) Edit the firewall-start script as per Merlin's guide about Transmission: refer to the "Firewall configuration" section of that guide. Just use, instead of 51413, the port numbers you chose for TCP and UDP in amule.conf.

    10) I found that you sometimes are given low id if aMule starts too early when you reboot your router. To workaround the issue, edit the services-start script (refer to Merlin documentation and google if you don't know how to do it) and enter "sleep 60" instead of "sleep 10".

    11) reboot and everything should work! :)
    You can use amule's web interface at the address 192.168.1.1:4711 in your web browser. Or you can download aMuleGUI from www.amule.org. Just download amule from there: open the downloaded archive and grab only the file called aMuleGUI.exe (for windows), that is the remote GUI. Open aMuleGUI.exe and input the router's ip (192.168.1.1) and port number 4712.

    12) If you want to remove aMule from automatic startup at boot, see post #20. Credits to @Martineau.

    Remember, when you want to edit amule.conf, you need to stop the daemon first. In telnet type "/opt/etc/init.d/S57amuled stop", do the changes you want to amule.conf, in telnet type "/opt/etc/init.d/S57amuled start".

    One warning: I haven't enabled ipfilter automatic updates because they make aMule crash. This is a known bug, unfortunately.
    You can manually update ipfilter by manually downloading ipfilter file from http://upd.emule-security.org/ipfilter.zip, extracting guarding.p2p and renaming it ipfilter.dat, stopping amule (in telnet "/opt/etc/init.d/S57amuled stop"), copying ipfilter.dat to \\rt-n66u\entware\var\amule, starting amule (in telnet "/opt/etc/init.d/S57amuled start").
    I suggest doing this every once in a while.

    Final note. You may want to have a look at this great webUI (credits to Matteo Ragni): https://github.com/MatteoRagni/AmuleWebUI-Reloaded
    The installation steps differ from what the author says:
    1) in telnet "/opt/etc/init.d/S57amuled stop"
    2) browse to \\rt-n66u\entware\share\amule\webserver. You will find a folder called "default": rename it to whatever you want. Put the extracted folder here (i.e. in webserver folder) and rename it "default".
    3) in telnet "/opt/etc/init.d/S57amuled start".

    Attachment: View attachment amule.zip
     
    Last edited: Mar 3, 2016
    Alessio and ryzhov_al like this.
  2. Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!
  3. bROTHER

    bROTHER Occasional Visitor

    Joined:
    Aug 28, 2014
    Messages:
    24
    Hi,

    Wrestling with Optware version here. The ipkg version is 2.3.1rc1-2. I can't find a amuleGUI for this one. The protocol for EC (External Connections) is different from 2.2.6 and 2.3.1. In teh repo theres is no amuleGUI.exe compiled for this one.
    Also, amule Android can't keep connection alive; it does connect and then give a "parsing error" message and disconnects.

    Regards.
     
  4. noric

    noric Senior Member

    Joined:
    Jul 26, 2014
    Messages:
    213
    What about aMuleGUI.exe in the amule 2.3.1 zip? Doesn't it work?

    Edit: at first, check that everything is working via the web UI in your browser.
     
  5. bROTHER

    bROTHER Occasional Visitor

    Joined:
    Aug 28, 2014
    Messages:
    24
    Nope, protocol is different.
    The web UI is fine, as long as it lacks functionality, accuracy and stability.
    The WebUI you recommended (AmuleWebUI-Reloaded), does it add any pluses apart form the visual appeareance? Couldn't find the link to download the whole package at once.

    I wish I could have the time to learn how to build ipkg packages and build one for the 2.3.1. Amule seems to be stalled since 2011 :(

    Regards.
     
  6. noric

    noric Senior Member

    Joined:
    Jul 26, 2014
    Messages:
    213
    That web-ui is a bit better, but you definitely need amuleGUI for anything serious.

    Sorry I can't help you more with optware. I've only experimented with entware and its amule 2.3.1 package. :(
     
  7. bROTHER

    bROTHER Occasional Visitor

    Joined:
    Aug 28, 2014
    Messages:
    24
    Got it!! Finally I got everything. I'm gonna test it some more time and add a guide for optware :D:D:D
     
  8. noric

    noric Senior Member

    Joined:
    Jul 26, 2014
    Messages:
    213
    Well done!
     
  9. noric

    noric Senior Member

    Joined:
    Jul 26, 2014
    Messages:
    213
    I found that the custom webUI template doesn't always stick: sometimes it reverts to the default one. I changed the instructions in the first post accordingly: this way it does stick.
     
  10. bROTHER

    bROTHER Occasional Visitor

    Joined:
    Aug 28, 2014
    Messages:
    24
    Yeah, I found the same problem and gave it the same solution, replacing the default one.
     
  11. noric

    noric Senior Member

    Joined:
    Jul 26, 2014
    Messages:
    213
  12. Alessio

    Alessio Occasional Visitor

    Joined:
    Jul 25, 2013
    Messages:
    42
    Hello, thanks for this guide.
    Everything is working as expected, but I have a question: How can I stop amule to start automatically after reboot? I'd like to start amule manually only when I need it.
     
  13. noric

    noric Senior Member

    Joined:
    Jul 26, 2014
    Messages:
    213
    I suggest that you don't delete/edit "S57amuled", because it not only starts aMule at boot, but also properly shuts it down on reboot.
    You could instead put the following lines at the end of "/jffs/scripts/services-start":
    Code:
    sleep 60
    /opt/etc/init.d/S57amuled stop
    This way aMule will start at boot, but it will stop very soon. And you won't have to manually stop aMule when you reboot your router.
     
    Alessio likes this.
  14. Alessio

    Alessio Occasional Visitor

    Joined:
    Jul 25, 2013
    Messages:
    42
    Thanks
     
  15. Martineau

    Martineau Very Senior Member

    Joined:
    Jul 8, 2012
    Messages:
    1,617
    Location:
    UK
    ...or to prevent aMule from even starting @boot.....in init-start

    Code:
    chmod   -x   /opt/etc/init.d/S57amuled
    
    sleep 120
    
    chmod   +x  /opt/etc/init.d/S57amuled
    EDIT: Whoops :oops:...clearly this only works for scripts stored in /jffs or /tmp but I was attempting to show the technique used to selectively alter/delay the execution of a script that exists elsewhere.
     
    Last edited: Mar 3, 2016
    Alessio likes this.
  16. jeff288

    jeff288 Regular Contributor

    Joined:
    Nov 3, 2015
    Messages:
    145
    Location:
    KS, USA
    Ah, the good old days of emule. I tried it a few years ago and even then it seemed dead. I can't imagine it being very alive today.
     
  17. noric

    noric Senior Member

    Joined:
    Jul 26, 2014
    Messages:
    213
    Good idea. Probably the best solution.

    It's slow, indeed. But every now and then I use it for rare songs that I can't find with any torrent. It's slow, but you always find what you search.
     
  18. Alessio

    Alessio Occasional Visitor

    Joined:
    Jul 25, 2013
    Messages:
    42
    Hello, I've tried the second solution to prevent aMule from starting, but after rebooting aMule is still running:
    I've removed from services-start
    Code:
    sleep 60
    /opt/etc/init.d/S57amuled stop
    
    and after I've created /jffs/scripts/init-start and made it executable.
    Here is my /jffs/scripts/init-start

    Code:
    #!/bin/sh
    
    # Prevent aMule to start
    chmod -x /opt/etc/init.d/S57amuled
    sleep 120
    chmod +x /opt/etc/init.d/S57amuled
    
    
    After rebooting amule is still running.
     
  19. noric

    noric Senior Member

    Joined:
    Jul 26, 2014
    Messages:
    213
    Perhaps, your hard disk is not yet mounted, when init-start is executed.

    Try this other route. Delete init-start. And edit services-start in the following way:
    Code:
    #!/bin/sh
    ...
    chmod -x /opt/etc/init.d/S57amuled
    /opt/etc/init.d/rc.unslung start
    chmod +x /opt/etc/init.d/S57amuled
    ...
    Of course the three dots stand for any other code you may have in that file.
     
  20. Alessio

    Alessio Occasional Visitor

    Joined:
    Jul 25, 2013
    Messages:
    42
    Here is my services-start after the mods suggested:
    Code:
    #!/bin/sh
    script="/opt/etc/init.d/rc.unslung"
    
    i=60
    until [ -x "${script}" ]
    do
            i=$(($i-1))
            if [ "$i" -lt 1 ]
            then
                    logger "Could not start Entware"
                    exit
            fi
            sleep 1
    done
    ${script} start
    
    chmod -x /opt/etc/init.d/S57amuled
    /opt/etc/init.d/rc.unslung start
    chmod +x /opt/etc/init.d/S57amuled
    
    I've inserted the new lines at the bottom, but probably I made something wrong.

    Thanks
     
  21. noric

    noric Senior Member

    Joined:
    Jul 26, 2014
    Messages:
    213
    Yes, sorry, my services-start looks different. Probably because I'm on an older firmware.

    This should work:
    Code:
    #!/bin/sh
    script="/opt/etc/init.d/rc.unslung"
    
    i=60
    until [ -x "${script}" ]
    do
            i=$(($i-1))
            if [ "$i" -lt 1 ]
            then
                    logger "Could not start Entware"
                    exit
            fi
            sleep 1
    done
    chmod -x /opt/etc/init.d/S57amuled
    ${script} start
    chmod +x /opt/etc/init.d/S57amuled
    
    If that doesn't work either, post the content of "/opt/etc/init.d/rc.unslung".
     
    Alessio likes this.
Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!