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.


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

    Very very cool setup!! really love it. This reminds me of a very recent paper( 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
    + 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 nkz1984 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.

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

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

  • At 3:16 AM , Anonymous Anonymous said...

    Playing bingo needs more than luck or skills and techniques, contrary to what most believe. Bingo, just like any game of chance, comes with rules and regulations that players should observe. Being a player comes with responsibilities and etiquette.

    Winning the Game

    The moment you figured out you won, you must immediately yell BINGO, and it should be loud enough for the floor walker to hear. The pot money shall be given to the winner once their winning card is confirmed. Well, in winning or once you know you just won, the most important thing is that you shout the winning word BEFORE the time elapses. If the game proceeds and the next number is mentioned and you failed to shout "Bingo", your winning card is disqualified. Therefore, this is the rule you must know.

    There may be cases when there are two winners, and in this case the pot money shall be divided equally among the winners. Supposing there are two winning cards, the two winners will share half the prize money.

    Bingo Game Rules

    Bingo rules are basically the same no matter in which Online Bingo hall you play. But still it's good if you know these rules by heart. If it is your first try, then ask for handouts and inquire from pros regarding the game rules. Nonetheless, the ideal thing to do if you have questions is to ask the floor walker and not the person seated beside you. You should clarify things and doubts before the game starts because asking too many questions as the game proceeds could well distract you. This guideline also applies to those who are newcomers at casinos, those who play roulette for the first time.

    Bingo halls demand an age limit of 18 years old. If you are below this age, you are prohibited to play. Some bingo houses ban alcohol inside, so players aren't supposed to take liquor nor drink it inside the venue. Smoking may also be restricted inside the venue, as there are designated smoking sections.

    Take note that some Bingo houses don't allow food but some do, so it basically depends on the venue. Policies vary among different venues. For instance, some bingo halls allow reservation of cards, while others don't allow it. Some allow people to leave the venue in the middle of the game, others forbid it. But there are general policies observed in all bingo houses, such as disqualification of tampered bingo cards. There is no way you can get away with a tampered card because the walkers are adept at identifying authentic cards from tampered ones. You could be banned from a bingo establishment if proven liable of tampering a card. Hence, you should play honestly.

    Interestingly, some venues offer special bingo games for kids although some halls don't allow players to have companions while playing. Suppose you bring kids with you, don't let them run around the venue and bother other gamers. They should behave well whilst you play and the game proceeds. Play quietly and don't recite the numbers you desperately want to come off because you'll be much of a disturbance if you do. Decorous playing is expectant of all players, even those who play roulette at casinos. Also, having a valid identification is important because you don't know you might win and need to present credentials.

    More Online Bingo Info at Bingo Snooper Visit Now

  • 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 ! 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=]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=]thoi trang nam 3s[/url]

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

    My name is Sheila. I live in Chicago. I have 2 dogs that are my life. I enjoy running, hanging out with friends, and dancing.
    “If you truly are half as beautiful and interesting as your profile indicates, I’m ready to say “I do”! Okay, maybe I’m getting ahead of myself here,
    but I wanted to let you know we definitely need to sit down and chat sometime.”

    You van visit me here:[url=]Sheila Beth Anderson[/url]

  • At 8:56 PM , Anonymous Anonymous said...

    Take a simple survey and Win Prizes worth up to £2500
    [url=]Click Here[/url]

  • At 11:42 PM , Blogger Corel Draw 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