OpenWrt Forum Archive

Topic: Torrent Client package

The content of this topic has been archived on 27 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I tried compiling ctorrent, and failed...

Has anyone created a package for either CTorrent or Libtorrent/rtorrent.  They are both light-weight, written in C++, and I know CTorrent only requires OpenSSL.  Anyway, I figure it would be pretty easy for someone to port (assuming they are familiar with the whole cross compile thing and ipkg system).   If there is an existing build for either, just ignore everything I say below and reply where to get it.

I tried creating a binary for ctorrent, but was getting failures saying I didn't have the library for openssl, so I removed the lines causing the problem, got it compiled, and tried it out.  I got the most active torrent I could find, one for Desperate Housewives, threw the binary for ctorrent on my usb drive, and tried running it.  Got an error saying it was missing libstdc++.so.6 or something.  So I went and found the library in the build environment, copied it to my USB drive, and made sym links to the /lib folder.  It worked!!,  so I let it sit for a while and got a few errors saying could not connect to tracker or something, and then noticed that in the top where ctorrent scrolls things, it had said "error, failed to create desperate_housewives.avi file" during the whole initialization thing.  I tried to track this error down and can't see why it is causing.  A file was created of length 0, and I got sick of waiting to see if it would start downloading.  On my computer, ctorrent allocated the full file length (350MB in this case) before hand, so I figured something was wrong anyway and stopped trying. 

Could this have something to do with the fact that it was trying to create the file on a mounted FAT32 partition or could somehow removing the four lines dealing with SSL/SHA1 caused the problem.  I looked in the code at the source of the problem, and it seems like pretty straight forward stdio.h type of calls to create the files. 

Anyway, I give up.  I am asking if anyone who knows the right way to cross compile and access those libraries could make the binary or package.  I really think for someone with experience it wouldn't take long at all considering that someone who has never even cross-compiled a package or ever used that SDK was able to figure it out this far in a few hours. 

My goal was to integrate a command line torrent client into the web server for friendly access so that me, my g/f, and roommates don't have to leave their computers running 24/7 giving us electricity bills over $140 a month.  Torrents could be run on the router, leaving on all the time, and you could access the status easily, add new torrents easily over the web interface.  I think 200MHz will be plenty, and since the whole purpose is to act as a file server/torrent client, it shouldn't be a big deal anyway. 

Anyway, if someone can get either command line torrent program working, I will write the http scripts to give it a nice graphical frontend for the web server.  I know there is reasonable demand

or you could just buy a mac mini. smile it only uses 12W (for comparison, a wrt54gs uses 4-6W).

Hi RItalMan

ctorrent is working fine indeed, but any real reason why you havent compiled the latest version (1.3.4) ?

Also - there is an enhanced version fixing some bugs, and bringing some stuff up2date according to the BT protocol...:
http://www.rahul.net/dholmes/ctorrent/

It would be nice to see a build of that one.

When I installed ctorrent using

ipkg install http://openwrt.alphacore.net/ctorrent_1.3.2_mipsel.ipk

it installed itself and libpthread fine, but then when I ran it, I got an error indicating that it was missing a libopenssl library.  So, I installed this library, and now I got that it was missing libstdc++.  So, I then went and ran

ipkg install http://openwrt.alphacore.net/libstdc++_5.0.5_mipsel.ipk #Thank you RitalMan

and finally, everything works... or at least it displays the startup messages... I haven't tried downloading torrent yet.

I was just wondering if all this was unique to my setup only or if mascat had to do the same thing as well.  Anyway, if this is the case, should these other two dependencies be included?

To anyone reading this forum, installing libstdc++ requires a few megabytes, so you probably need a USB harddrive as I do, or some other form of extended storage space.

I too would be interested in the "enhanced version" if any developers would be willing to setup the package. 
mascat:  How well does ctorrent work compared to other torrent programs?

At the time I ported ctorrent, the latest version did not compile fine at all, and there was ugly hacks to add in the code for it to cross-compile. Now I would like to recompile ctorrent and link it agains uClibc++, I will do it soon, stay tuned !

I have yet to get it to download anything...

I have an external USB HD connected to my Asus router.  It has an ext3 and a Fat32 partition, and whenever I try to download a file on the fat partition, it gives an error saying it failed to create the file.  Downloading to the ext3 partition, it appears to work fine, but I have yet to get it to successfully download anything, or maybe I just don't know what it should look like when it does.  Again, I tried to download a desperate_housewives episode since it is very active, and after 30 minutes, it didn't appear to be doing anything.  I checked out tcpdump and it wasn't sending much of anything besides a few things to the tracker.  Is there information somewhere as to what all the numbers mean for the display?

Hopefully the new version and patches can fix the FAT problem if it is truly a bug with ctorrent and not the usb-drivers.  I will try to download some different files to see if I can get them working.  Mascat, any tips on getting it transferring?

I look forward to seeing any new versions.  I would still love to make a httpd interface if I can figure out how to get any downloads going.

florian has recently recompiled ctorrent enhanced while statically compiling in the glibc++ libs due to uclibc not being able to be compiled in due to a bug. 

you can grab it from his alphacore library.

The discussion might have continued from here.