Computer Science

Childish Things are Good

Sep. 13, 2013

by Luke Fader

Remember Legos? They are one of the early toys children enjoy in their play. Legos are fun because

  • they are relatively inexpensive.
  • they have infinite reuse and possibilities.
  • they encourage imagination and “outside-of-the-box” thinking.

 

Big Kid Toy

Raspberry Pi (RPi) is the evolution of the “toy,” for children and grownups alike. It is not a toy in the sense we generally think: it is a small computer. However, it shares the same properties of legos:

 

  • It is relatively cheap compared to other computers.

  • It has infinite reuse and possibilities.

  • It encourages imagination and “outside-of-the-box” thinking.

 

Enclosure

The Raspberry Pi comes with no case or enclosure, so equipped with my new “toy,” I couldn’t help but combine it with my favorite childhood toy. The first part of my RPi project, create an enclosure with legos from my childhood. After a few hours of playing and remembering simpler times of my life, here are the results:

legoraspberrypitop

legoraspberrypiback

The panels on the sides flip up, revealing I/O ports on the RPi.

raspberrypi

This is a RPI without Legos.

 

Web Server

Much of my learning outside of class involves web technologies. Testing the performance of these projects is difficult on my own computer because the files are stored locally. The problem is one of cost, money spent for web hosting services. This is not ideal for projects still in the development stage. Because of this, I chose to make my RPi a web server for development purposes. RPi runs a version Linux for ARM processors (that’s what type of CPU is in the RPi). Because of this, many Linux programs can be installed and run on RPi, including the web server Apache, along with php and ftp services.

 

The Process

I followed the guides found on instructables and wikihow. The basic process is to use terminal commands to download and install the aforementioned programs and configure them appropriately. I chose vsftpd for FTP services because I want to have the ability to access the web server remotely and add project files to it. This saves me time and allows me to focus more on the project itself, rather than the time it would take to otherwise transfer the project. Apache took the most time to learn and configure because I have never used it before and was unsure of where in the file system the websites should be stored. It also has several permissions that need to be configured (both Linux and Apache permissions).

 

A little tweaking here and there and my RPi was ready to begin its life as a local web server!

rpiwebserver

To access the website, any computer on the network can enter the RPi’s IP address into a browser and will receive the webpage being hosted by Apache. We can see this is indeed working, but the page is very basic. How would the RPi handle a bigger site which includes javascript and a large css file? I added one of my past web projects to test:

rpiwebserverexample

 

Conclusion

Not only is the RPi a fun “toy” for grown-ups, it also has value as an inexpensive tool for web development, all while being small, portable and entertaining to look at (thanks to Legos). The RPi is also a great tool for other creative uses, and I look forward to tackling other projects with it in the future.