Coder: Simple Way to Make Web Stuff on Raspberry Pi

Home / Coder: Simple Way to Make Web Stuff on Raspberry Pi

Folks at Google Creative Lab has release a project to develop a web application using Raspberry Pi platform. This project is pure open source project which turn a Raspberry Pi to a simple web server platform. This way, educators and parents can use to teach the basics of building for the web. New coders can craft small projects in HTML, CSS, and Javascript, right from the web browser. Enthusiasts can also experiments on web programming. All come from a single distribution image.

The project itself is revealed as Coder. How do we setup the Coder to run properly and operated from our machine is what we will discussed in this article.

In this article I use

  1. Raspberry Pi model B, 512MB RAM
  2. SD Card 4 GB
  3. Slackware64 14.0 as client station
  4. Windows 8 64-bit as client station
  5. Mac OS X as client station

Note that I mention three machine for experiment. You can choose any (or all) operating system and to work with.

Prologue

[embedplusvideo height=”495″ width=”880″ editlink=”http://bit.ly/18HOj1C” standard=”http://www.youtube.com/v/wH24YwdayFg?fs=1″ vars=”ytid=wH24YwdayFg&width=880&height=495&start=&stop=&rs=w&hd=0&autoplay=0&react=1&chapters=&notes=” id=”ep8669″ /]
Coder is not only designed for people who start web developing. Google also has big idea to make this platform as fun as possible to experiment and to play around.

Obtain the Material

Coder is like other Linux distribution on Raspberry Pi. It comes with SD card image which will be burned to SD card.

The latest version of Coder is 0.4 which can be downloaded here. The compressed image has size 1.04 GB.

Coder is derived from Raspbian, therefore the basic is not much different from Raspbian. The only thing differ is Coder has special codebase and platform. Though you can install the code on existing distro, we won’t cover it in this article.

The distro has several files and directory inside in hierarchical structure. There is an image with filename raspi.img which we will use later.

Preparation

You should prepare the machine well. We will use this machine (a client) to interact with our Coder. Once you choose either Windows, Mac, or Linux you should read what you need to do to prepare your machine.

Windows

A Windows user should install Apple’s Bonjour Print Service. This application will install Bonjour, a Zero-Configuration Networking system on Windows

Mac OS

You can go, Apple has installed Bonjour on their own machine.

Linux

Follow this link to install Zero-Configuration Networking on Linux.

Prepare the Disk (SD Card)

To boot the Raspberry Pi, an installation media and storage media is needed. All we need is a single SD card. The bigger space, the better. You need space for OS and additional space to hold your ROMS. On this article I use my 4GB SD card. You can use any SD card you want, but I recommend to use at least 4GB SD card (recommended by Google too). The image we download on previous section will be stored on this card and later installed. Make sure you have a way to write on SD card.

Windows

For Windows user, you can follow this section to “burn” the image. For this purpose you need additional software for writing to SD card, such as Win32DiskImager utility.

  1. Insert SD card into SD card reader and check what drive letter it assigned to. For example G:\
  2. If it is not new, format it. Or at least make sure there is only one partition (FAT32 is recommended).
  3. Run the Win32DiskImager with administrator privileges.
  4. Select the image we have extracted (raspi.img).
  5. Select the drive letter of the SD card on our machine. Make sure you have the correct drive, or you will destroy data on that drive.
  6. Click Write and wait. The process should be not long.
  7. Exit the imager and eject the SD card

Beside Win32DiskImager, you can also use other tool such as Flashnul.

  1. Follow step 1 to step 2 for Win32DiskImager’s solution
  2. Extract Flashnul from the archive
  3. Open command prompt with elevated privilege (administrator privilege).
  4. Go to your extracted directory and run flashnul with argument “-p”. For example: flashnul -p
  5. You will get list of physical drive attached on your machine, and list of drive. Make sure the drive is correct. At time of writing this article, the SD card is detected as device number 1 with and mounted to drive G:
  6. Load the image to flashnul: flashnul 1 -L raspi.img
  7. If you get an access denied error, try re-plugging the SD card and make sure to close all explorer windows or folders open for the device. If still get denial, try substitute the device number with its drive letter: flashnul G: -L raspi.img

At this point, you have successfully written image to your SD card. And I assume you are. You can proceed to next stage.

Mac OS

Run the provided installer. This should be sufficient.

You should be able to go to next stage.

Linux

Writing image on Linux is easier, in my opinion. The utility we use is “dd” which is already bundled on most distro. Make sure you know the correct device file for your SD card. In my machine I use a built in card reader and detect my SD card as /dev/sdb. It might be different on your system so better check it. For this article I use /dev/sdb to refer to SD card.

  1. Insert SD card into SD card reader .
  2. If it is not new, format it. Or at least make sure there is only one partition (FAT32 is recommended).
  3. Unmount the SD card if it is mounted. We need the whole SD card so if you see partition such as /dev/sdb1, etc its better you unmount them all.
  4. Write the image to SD card. Make sure you replace the input file after if= argument with correct path to .img file and “/dev/sdb” in the output file of= argument with your device. Also make sure to use whole SD drive and not their partition (i.e. not use /dev/sdb1, /dev/sdb1, etc). The command: dd bs=4M if=raspi.img of=/dev/sdb
  5. Run sync as root. This will ensure the write cache is flushed and safe to unmount SD card.
  6. Remove SD card from card reader.

If you hesitate to use terminal and prefer to use GUI method, here is the tutorial. Note that we

  1. Do step 1 to step 3 for previous tutorial. Make sure your directory or image file doesn’t contain any spaces.
  2. Install the ImageWriter tool from https://launchpad.net/usb-imagewriter
  3. Launch the ImageWriter tool (needs administrative privileges)
  4. Select the image file (in this case raspi.img) to be written to the SD card (note: because you started ImageWriter as administrator the starting point when selecting the image file is the administrator’s home folder so you need to change to your own home folder to select the image file)
  5. Select the target device to write the image to. In my case, it’s /dev/sdb
  6. Click the “Write to device” button
  7. Wait for the process to finish and then insert the SD card in the Raspberry Pi

At this point, you have successfully written image to your SD card. And I assume you are. You can proceed to next stage.

Accessing the Coder

Plug the SD card to Raspberry Pi.

Make sure Zero-Configuration Networking service is up (it should be).

Open up your browser and visit following url:

coder.local

Like Raspbian, when you run coder for first time you will be asked to do some configuration for example resize the SD card. Or you can resize the SD card later which you can find the guide on this article.

,

About Author

about author

xathrya

A man who is obsessed to low level technology.

Leave a Reply

Your email address will not be published. Required fields are marked *

Social media & sharing icons powered by UltimatelySocial