Contemplation

Sunday, January 03, 2010

My Torrent downloading setup using beagle board





Prologue : dont get upset by the large maze of wires in the picture. I have included some additional componets like USB to Serial adapter and USB hard disk, which are not mandatory for the mission outlined here. I have included them for the sake of completeness. Please click on the image for a better quality one.
For the sake of dummies who has never thought a world beyond intel/x86 PCs- Beagle Board is a low-cost, fan-less single board embedded board with a heart made of 600 MHz TI's Arm Cortex A8 based OMAP 3530 processor. The board is said to consume less than 2 watts of power while running and is just a 2 inch square in size.

I bought beagle board mainly to have an arm board at my disposal at home for hobby purposes like learning arm assembly and arm/architecture dependent and ofcourse arch independent portions of linux kernel. Though i have access to a wide variety of high end arm boards at my workplace, at times i miss them at home. Despite these noble intentions while buying i have to confess that in the most part of the last 4 months while I was in possession of my beagle i have done no more kernel hacking than recompiling kernel and u-boot for beagle with some prints. I have to accept that i was practically spoilt by the amazing support provided by the community in terms of software support for this board, and i could get it running with practically zero effort.

After beagle board was lying practically idle in its small box for a little over 4 months, couple of weeks before, i got stricken by an idea to put it to real use. How about using it as a headless [monitor less] system which will keep downloading your torrents 24/7 ie you can leave it home and go for a week long vacation and it will download all the torrents you have queued, which means when the power goes off and comes back beagle will again start up and continue the download. You can also add more torrents if you wish to while you are away , via ssh , provided you have a static IP as is my case.

The main problem, in achieving this was that beagle board didnt have an ethernet port, but it has USB port. So I have bought one usb to ethernet adapter [believe me finding this adapter these days can be quite a challenge i was able to find one at computer ware house for around RS 200/ mg road / barton centre in bangalore] . You should also buy one self powered USB hub. I couldnt find it here in bangalore so i ordered one from eBay [Belkin 4 port for Rs 850] . The purpose of USB hub is two fold in case of beagle board.
1. The USB ethernet adapter is a Full Speed [USB 1.1] device and the USB host controller port on the beagle will support only High Speed [USB 2.0] devices. Since the hub is a USB 2.0 device, if you plug the adapter on the hubs port it will be detected - see the image for details

2. My 160GB USB ethernet drive was also not working [though it is USB 2.0] while connecting directly to the board[ though thumb drives were working while connected directly], but worked while connected under the hub. I guess this was because the beagle is unable to power the hard disk, but as the Hub is self powered it isable to power the hard disk.

3. I didnt order a power adapter for the beagle board while ordering from digikey since i had to shell out an extra 1000 bucks for that. Ideally you should be able to find it from some neighbourhood electrical shops - but i couldnt . As a work around i was powering the board from my laptop using a mini B cable to the USB OTG port on the board.
So if you are using a self powered usb hub, you can power the beagle board by taking power from one of its port. This explains the 3rd downstream connection to the usb hub in the picture.

That completes the hardware setup, now u have burn the Xloader and u-boot into the Beagle board flash as explained here. Then i got an SD card and partitioned and formatted it into two, the first a 50 MB FAT partition and the remaining as an ext3 partition. I used GParted utility available in desktop Linux. So put the SD card in a usb card reader and plug it onto a native linux machine. Since i dont have a native Linux machine i used my ubutnu VMWare virtual machine running inside my vista for this purpose. For more detailed instructions on this, please see this video. Now download one angstrom Linux kernel build [uImage file] from this link. Put that file in the FAT partition of the SD card. Though you can burn the kernel image into the FLASH, it is better to keep it on the SD card as you can easily replace it with another kernel, by plugging the SD card onto another system.

Now that we have the XLoader, u-boot and Kernel, in place, all that is remaining is the root file system. Here i used anstrom Linux online image builder. For our purposes please include the following packages rtorrent, samba, ntp - network time, dropbear -ssh server, screen - session manager and Busybox replacements. Other interesting packages you can select are powertop, mplayer, Alsa utils and Cheeroke - web server. That will give you a tar ball which you can extract into your ext3 partition in the sd card. That is about it you can put the SD card and boot power on the beagle board and you should get linux shell. If you are seeing kernel panic - unable to mount root fs, check kernel command line during linux boot up - it should have something like this
Kernel command line: console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait

Otherwise go and edit u-boots bootargs environment variable and modify it to
bootargs=console=ttyS2,115200n8 console=tty0 root=/dev/mmcblk0p2 rootdelay=2 rootfstype=ext3 rw single

Now configure the network, and ntp client and then get hold of a torrent file and launch rtorrent and you can start downloading torrents like the son of Bram Cohen. Please check this article on how to configure rtorrent . Have a look at this article also while configuring rtorrent. From my experince i have found that rtorrent is a very robust ncurses based bit torrent client. You can launch it with screen so that every time you ssh you can get the same console. Dont forget to read starting rtorrent at startup in the above mentioned link which can be quite handy.




I have ran this set up close to two weeks[including one week where i travelled to my native place for new year and returned and found that rtorrent was still running in spite of the numerous power outages, i even added a few torrents from my home over ssh] and found the setup to be quite reliable, except for a few cases where in i have founf USB ethernet driver has crashed ie when i tried to copy large file via samba into my windows system, but those can be easily worked around.



Though not related i am just adding one powertop screen shot also, just in case for your reference


Finally a word of thanks to my friend Manu Thayyil who carried the beagle all the way from US.

Please feel free to post your queries and comments.









17 Comments:

  • At 3:01 AM , Anonymous bimal said...

    Very very cool setup!! really love it. This reminds me of a very recent paper(http://research.microsoft.com/pubs/79419/agarwal-NSDI09-Somniloquy.pdf) in NSDI'09 (a top conference in systems research) which proposes a similar setup to reduce PC energy usage by having a secondary networked device handling background stuff (like torrents etc).

     
  • At 4:30 PM , Anonymous akshayts said...

    Great Job!!. Tell me how much u spent on the whole setup.

     
  • At 7:49 PM , Blogger charly said...

    great job..Kool and innovative solution..May be I shall try your product...

     
  • At 9:35 PM , Blogger jithu said...

    @ bimal - Somniloqy seemed to have got undue credit - it is pretty simple thing, they are using one gumstix board which is always alive on the network to wake up a hibernated system when specific network traffic comes.

     
  • At 12:26 AM , Anonymous Anonymous said...

    Thanks for posting this, runs great---I am very interested in the power outage failover. How did you set it to come back up on its own?

    Also, how can you do more work if your Beagle is tied up downloading torrents? I guess you have to get another one now. :)

    Keep up the good work

     
  • At 6:38 PM , Blogger jithu said...

    @ Jefro
    -> have u also tried this ?
    -> power outage is nothing spectacular, it works like this
    + beagle board starts whenever power comes (ie unlike your PC you dont have have to press any button explicitly)
    + the rtorrent saves session info [which should be specified in ~/.rtorrentin] a file which it continually updates the download status
    + Now u should configure ur linux startup such that it always starts rtorrent at startup by adding /etc/init.d/rtorrent and doing update-rc.d rtorrent defaults - chk here
    http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks
    + rtorrent will load the session info from where it left
    + that's it

     
  • At 10:30 AM , Anonymous Anonymous said...

    Cool project jithu :)

     
  • At 6:29 AM , Anonymous Anonymous said...

    Nice post and this mail helped me alot in my college assignement. Thank you seeking your information.

     
  • At 7:05 PM , Anonymous Anonymous said...

    Good job nice if u can connect a LCD

     
  • At 10:53 PM , Blogger Unknown said...

    wonderful Jiths! anoop told me about this.

     
  • At 9:32 PM , Anonymous Amil said...

    This looks great, much better than running on a phone. After I tried rtorrent I found that Transmission has a CLI as well, which I found to be slightly better than rtorrent.

     
  • At 4:48 PM , Anonymous Anonymous said...

    good one

     
  • At 10:26 PM , Anonymous Anonymous said...

    Hey !!
    Great stuff. I have a beagleboard too (rev C3) but my belkin USB hub does not seem to work on it. I have a model that is different from yours (4 port one). Please let me know if you have any ideas on the problem.
    Thanks for the great post.
    Akshat

     
  • At 11:04 PM , Anonymous Anonymous said...

    Infatuation casinos? study this progeny [url=http://www.realcazinoz.com]free casino[/url] games. advisor and fake online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
    you can also into our blooming [url=http://freecasinogames2010.webs.com]casino[/url] direct at http://freecasinogames2010.webs.com and conquer actual laborious cash !
    another voguish [url=http://www.ttittancasino.com]casino[/url] spiele in the region of is www.ttittancasino.com , in lieu of of german gamblers, submit c be communicated during loose online casino bonus.

     
  • At 4:34 PM , Anonymous Anonymous said...

    "Hi. this is type of an -unconventional- query , but have other website visitors asked you how get the menu bar to search like you've acquired it? I also possess a blog and am genuinely searching to alter close to the theme, nevertheless am terrified to death to mess with it for worry with the research engines punishing me. I am extremely new to all of this !..so i am just not beneficial exactly the best way to attempt to to it all nevertheless. I will just preserve working on it one particular day at a time."


    my website is Flying V Guitar .Also welcome you!

     
  • At 10:13 AM , Anonymous Anonymous said...

    There are numerous things with the potential to affect us, and [url=http://muachungdeal.com/thoi-trang.html]Thoi trang nam[/url] has lived-up to that potential. If you stop and think about it, you will probably notice a lot of the different ways it can wiggle its way into your life. Nonetheless, there is much more to consider and certainly weigh in your mind.

    There is adequate awareness surrounding this so people know what to expect. However, you and many others still would like to be more educated on this matter. We hope to expand your knowledge base of this specific subject, and in so doing make it possible for you to be much more informed.

    The general complexities of men's and women's style

    Both women and men could have the demands of keeping their wardrobe up-to-date and in season, yet men's style often seems a lot easier. Of course, for both sexes, garments and fashion choices can be quite as intricate, and there are numerous'trendy'items that can rapidly become fashion faux pas - who is able to say they frequently see people running around in 70s flares? On the other side, men's style has a few choice goods that will exist eternally - which man is going to keep an eye out of position with a good-quality, tailored suit, for example? Pick classic cuts, colors and fabrics and you'll never seem out-of-place.

    Why traditional men's style is timeless

    The common man's suit has scarcely changed for over a hundred years. True, there are several types for various situations, nevertheless they are all common in their pursuit of a smart, sharp search for the person. The great thing about common fashion for men is that it is efficiently trendy effortlessly cool. A well-groomed man can almost always look his sharpest in a well-tailored suit, and this is a testament to the design of such apparel. A suit will be used to work in several jobs due to the professional search it affords to the wearer, instilling a feeling of respect and confidence. Equally a match will undoubtedly be used to many social functions, like a tuxedo to a black-tie event. This incredible flexibility which allows matches to be worn in almost all events is what gives it its amazing edge and a permanent devote men's fashion.

    Contemporary developments in classic men's style

    Although basic men's styles can never be changed, it is interesting to observe that changes in men's fashion trends have produced particular basic clothes back into fashion. The reputation of vintage clothing, specially, has had back a wide-variety of basic models into men's wardrobes, such as that of the dandy man. 'Dandy'is a term used to reference men who clothe themselves in a classic yet elegant way, placing importance on appearance and operating in a refined approach. This pattern for nearly'over-the-top'classic fashion for men is evident from events such as the'Tweed Run', wherever men and girls of all ages dress in notably Victorian-style clothing and take to the roads on vintage cycles - with many of the men sporting remarkable mustaches! This is just one single of many types of research presenting the resurgence of such designs. Additionally, there are numerous sites on the web which give attention to gentlemanly type - such as'The Dandy Project'and'Dandyism'- as well as entire web sites such as'The Art of Manliness'focused on giving articles on common men's fashion and grooming.

    In summary, although certain facets of common men's style could be brought back as new developments, the fundamental clothes which they are based on will never fall out of fashion.

    "All it takes are a few simple clothes. And there's one secret - the simpler the better." - Cary Grant

    StyleGun is an online men's fashion store with a complex angle.
    Read More: [url=http://cuahangkaki7510.soup.io/post/297695064/Goi-cam-nhung-ma-van-rat-kin]thoi trang nam 3s[/url]

     
  • At 11:42 PM , Anonymous Anonymous said...

    rTorrent Free Torrent Downloader is an easy-to-use, powerful, and free application that includes all the standard functions of a Bittorrent client. Here are some of.

     

Post a Comment

Subscribe to Post Comments [Atom]

<< Home