Sunday, October 14, 2012

Arch Linux News, a Raspberry Pi story and my plans for it!

Now it's official, systemd is now default on new installations. If anyone plans on using the last post as a guide to installing Arch Linux using the lastest install medium, the part "RUNNING A PURE SYSTEMD SYSTEM" can be skipped, as well as inserting (and removing) the line "init=/bin/systemd" in /etc/default/grub. I don't know if syslog-ng, cronie and dhcpcd@eth0 are loaded by default on the new installation. It can be easily checked though: just do a sudo systemctl list-unit-files (then press q to quit).

Unless you have been living under a rock or is not as nerdy as I am, you probably have heard about the Raspberry Pi (from now on I'll just call it RPI). It's a US$ 35 credit card sized LINUX computer with a 700 MHZ ARM CPU, 256 MB of RAM and a GPU capable of decoding H264 video files (also MPEG2 if you buy the license for it). It comes with 2 USB ports, an ethernet port, a HDMI out (full size), a composite video out, a stereo audio out and some GPIOs (general purpose I/Os) . Also, it only consumes around 3.5 watts on idle. Considering the power source efficiency, other peripherals connected, etc. let's round it up to 5 watts. This means that it costs (in Recife, Brazil) US$ 0,94 a month (R$ 1,87, US$ 1 = R$ 2) to keep it turned on. This makes a pretty cheap server!

I was thinking of importing one myself, but I found this page (it's in portuguese though). You see, here in Brazil the taxes are insanely high, so importing a US$ 35 RPI would mean I'd have to pay almost US$ 150 (R$ 300) for it, converting the brazilian currency (Real) to US dollars. The main reason being: not only the taxes are high but I'd have to pay taxes over the RPI AND the shipping service, which is even pricier than the RPI (around US$40).

I looked a Mercado Livre, the brazilian ebay, and found some RPIs being sold for around US$ 125 (R$ 250). That's cheaper and the RPIs were already in Brazil, so I woundn't have to wait so much. I "bought" one. The next day though, as I got to work, I encountered a friend of mine and told him how I "got" the RPI for around US$ 125 (R$ 250). Then he turned to me and said: "Dude, Farnell Newark Brazil is selling it for US$ 87,50 (R$ 175)".

This friend of mine ended up buying one as well, so we got two RPI and shared the shipping service bill. So, I ran to my computer and cancelled my original order. The RPI ended up costing US$ 93,16 (R$ 186,32). Considering my options, not bad right?

The RPI will probably get here in the middle of this next week, but I'll be travelling for the next two weeks. In the mean time, I have already made a list of all the stuff I'll need. Since it's so cheap to keep it turned on (also, using less energy is the green thing to do!) it makes a perfect little server. I'll hook it up on my 32" LCD TV on my living room. I plan on using my RPI as a: (not listed in order of importance):

1) Old console emulator (mainly MAME and SNES);
2) Media center (streaming media from my desktop);
3) Torrent box (saving stuff on the SD card then ssh or ftp the stuff to my desktop);
4) Printer server (my printer is currently connected to my desktop, so if my wife wants to print something from her laptop, she needs to turn on my desktop).

Since it runs Linux, the possibilities are... many. I plan on using Arch Linux ARM (ARM port of Arch Linux!) with Fluxbox as WM. Later, I plan on using Xmonad or Awesome WM.

For the RPI to do those 4 things I listed, I reckon I'll need:

1) Power supply

Power is supplied to the RPI by a mini-USB port. The RPI manufacturers recommend using a supply with 700mA of rated current. I found one on the web that is able to supply 1,5A. I'll also need a full USB to mini-USB cable. I do have two spares here already, so that's taken care of.

2) SD card

The RPI doesn't have any internal memory (aside from RAM). The operating system has to be installed on a SD card for the RPI to boot it. I'll get a 16 GB class 10 Kingston SD card.

3) Keyboard and Mouse

I'll just get a USB cordless keyboard with a touch pad attached.

4) Wifi dongle.

I don't want the ethernet cable running through the living room (the router is far from the living room TV).

5) Joypad and Arcade Control (and a bluetooth dongle for Wiimote support)

I don't have a USB joypad but I have a arcade control I made several years ago (I think it was in 2002, ten years ago!):




It's simply a wooden box with arcade buttons and microswitches soldered to a generic USB joypad. Since it's been some time since I last used it, some solders have gone bad but it can be easily fixed.

Also, cwiid is also available for Arch Linux ARM! I know it's somewhat outdated but it works. I can use my wiimote + classic controller as joypad. For that to work a bluetooth dongle is needed, I do have one but sometimes my wife wants to use it on her laptop, so I'll just get a new one.

6) External HD and External DVD drive.

These are for later. My external HD is being used on my Wii at the moment and at first the 16GB SD card will do the job. A external DVD drive is simply a good addition (and if you buy the MPEG2 license, RPI will turn into a DVD player!)

7) USB Hub with external power source.

To connect all this USB stuff, nothing better than a good quality USB hub with a extrenal power source. The two USB ports of the RPI are limited to 140mA.

8) HDMI cable. Already have one lying round here unused.

What I'll need to get as of right now (prices rounded up):

1) Power supply (R$ 34);
2) 16GB class 10 SD card (R$ 70);
3) Cordless keyboard + touchpad (R$ 132);
4) Wifi dongle (R$ 60)
5) Bluetooth dongle (R$ 20)
6) USB Hub with external power source with 7 ports (R$ 54)

That comes to a total of R$ 370 (US$ 185). With shipping: R$ 428 (US$ 214) (Buying from two different online stores, so I kinda have to pay twice the shipping bill).

Anyway, a RPI + a bunch of stuff needed to get it to do what I want: R$ 186,32 + R$ 428 = R$ 614,32 (US$ 307,16). That's actually pretty expensive. The RPI in Brazil is not a low-budget computer, considering a ASUS netbook with HDMI out here in Brazil costs R$ 900 (US$ 450) and it has everything my RPI will have and more, a R$ 285 (US$ 142,50) difference.

Comparing the two situations:

Advantages of MY future RPI system (emphasis on MY because the RPI cannot be generally compared to a netbook, but considering what I want to use it for, the comparison is valid):

1) The most expensive part are the accessories, which can be used somewhere else, and if my RPI dies, I can just get a new one and hook everything up again, but with the netbook, it's all or nothing;
2) 5 watts of power consumption versus 30 watts for the netbook;
3) Comes with GPIO (not that I'll use it right away, but I'll think of something);
4) How cool is it to have such a tiny computer?!?!?!?

Advantages of the Netbook:

1) It's way faster;
2) Battery "out-of-the-box". You can adapt batteries for the RPI, but you'll need to do it yourself;
3) Comes fully finished and the RPI doesn't even come with a case;
4) Regular x86 architecture, regular Linux distro can be used, and the RPI uses ARM processor, which limits the choice of distros;
5) Has it's own display and the RPI needs a external one;

The hdd and webcam of the netbook are actually not a advantage, because I could buy a good USB hdd and a good webcam for the RPI and it's still gonna be cheaper. Also, I'm not counting the fact that a netbook is a great mobile solution because what I wanna do with the RPI doesn't need mobility. But, in the end, the advantage number 4 for the RPI is what counts!

Anyway, what is missing for my future RPI is the case. I have no idea how I'm gonna solve this yet. I'm aware of this, but I'm terrible with my hands :p. I'll figure something out though.

As soon as I start working on the RPI I'll post my progress here.