Tutorials and Guides

Installing Pinger on Raspberry Pi

Author: Johari Abdullah
Affiliation: FCSIT, UNIMAS, Malaysia.
Email: johari.abdullah@gmail.com
Last updated: 13th-March-2013


Introduction

Apart from installing pinger (for monitoring host) in a normal PC environment, there is an interest in deploying pinger in smaller form factor machine and embedded system. One of the main motivation is to be able to have a small portable monitoring host with subsequent benefit of reducing cost, and maximizing space utilization. Furthermore, such small form factor usually correlate with lower power consumption and enable the utilization of batteries and renewable energy. One such initiative under the PingER project is ePingER project in Zambia which was suggested by Marco Zennaro of ICTP Trieste. Details of the project is available from the SLAC confluence site from this link.

UNIMAS is also interested in developing a portable pinger monitoring host due to the existence of several rural telecentre project such as eBario, eBuayan, eLamai, and eLarapan. There are several other ongoing deployment of telecentres under the ISITI (Institute of Social Informatics and Technological Innovations) in UNIMAS. Since all these telecentres are connected to the Internet, there is an interest to monitor the Internet performance. Thus, such portable machine will enable the monitoring of end-to-end of Internet connection for these centres.

Single Board Computer

Single Board Computer (SBC) is the term given to a complete computer built on a single circuit board, with microprocessor, I/O, and other features of a functional computer. The SBC can be ARM based on x86 based. This page from Wikipedia provide a list of SBC available on the market. A quick glance shows that there are more ARM based SBC as compared to x86 based SBC. An example of currently popular ARM based SBC is the Raspberry Pi and for the x86 based is the PC Engine ALIX system boards.

To kickstart the ePinger project in UNIMAS, two sets of ALIX2D2 have been purchased to experiment with pinger deployment in SBC. OpenWRT has been chosen as the operating system but there are issues with drivers and installation with regards to the pinger software. As of february 2013, we have not successfully configure OpenWRT for the ALIX2D2 SBC and have not managed to install the pinger software on this machine. There are many challenges/drawbacks in using the ALIX2D2 SBC such as:

  • No graphic output, the only way to view output of activities is to connect to the ALIX2D2 SBC using a serial connection.
  • Using CFCard for storage of operating system and data, expensive and not easy to get.
  • Relatively small in form factor but still not one of the smallest.
  • Relatively more expensive compared to ARM based SBC. A complete set (comprises of the ALIX2D2 SBC, CFCard, power supply, wireless chip, and wireless antenna) cost approximately RM800.00 at the time of purchase on October 2012.

  • Figure 1: ALIX2D2 Single Board Computer

    Source of the above picture is from here

Due to the above challenges, x86 based SBC is not a straight forward solution for the deployment of a portable pinger monitoring host. This is where Raspberry Pi ARM based SBC comes into the picture.

Raspberry Pi

Raspberry Pi is a small form factor SBC the size of a credit card (as shown in Figure 2 below) developed in the UK by the Raspberry Pi Foundation with the objective of promoting the teaching of computer science in schools. The Raspberry Pi is manufactured through licensed manufacturing deals with Element 14/Premier Farnell and RS Components. Both of these companies sell the Raspberry Pi online. Fortunately, the Raspberry Pi can be purchased and delivered in Malaysia by Element 14 through this website.

  • Figure 2: Raspberry Pi Rev B Single Board Computer

    Source of the above picture is from Wikipedia

The Raspberry Pi has a Broadcom BCM2835 system on a chip (SoC), which includes an ARM1176JZF-S 700 MHz processor, VideoCore IV GPU, and originally shipped with 256 megabytes of RAM, later upgraded to 512MB. Table 1 below shows the specification for the raspberry Pi Model B 512 MB model. It does not include a built-in hard disk or solid-state drive, but uses an SD card for booting and long-term storage. Another important goal for the foundation is to produce and sell the Raspberry Pi at low cost so that its is affordable by the general public especially in education sectors. he Foundation's goal is to offer two versions, priced at US$25 and US$35. The Foundation started accepting orders for the higher priced model B on 29 February 2012 and the lower cost model A on February 4, 2013. As of January 2013, over one million Raspberry Pi boards have been sold (Source: Techcrunch).

  • ComponentSpec
    SoCSoC Broadcom BCM2835 (CPU, GPU, DSP, and SDRAM)
    CPU700 MHz ARM1176JZF-S core (ARM11 family)
    GPUBroadcom VideoCore IV, OpenGL ES 2.0, 1080p30 h.264/MPEG-4 AVC high-profile decoder
    Memory (SDRAM)512 Megabytes (MiB)
    Video outputsComposite RCA, HDMI
    Audio outputs3.5 mm jack, HDMI
    Onboard storageSD, MMC, SDIO card slot
    Network10/100 Ethernet RJ45 onboard network
    USB2 x USB 2.0 slots

    Table 1: Specification for Raspberry Pi Model B 512MB RAM

As for the operating system, there are several ARM Linux distro options such as Raspbian Wheezy (recommended, Debian port), Fedora ARM, Arch Linux ARM, Debian Squeeze, Raspbmc (as media server) and several others as listed at this link.

What can you use it (Raspberry Pi) for?

It is a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. Apart from that, it is a suitable and low cost platform fo kids all over the world to learn programming. The possibility is endless (kind of...) but there are many projects listed all over the Internet which shows RaspBerry Pi being used for: web server, home automation, Web Cam server, media server, weather station, traffic monitoring, game machine and so on. This page lists many cool ideas for using Raspberry Pi in various projects.

Back to the main story, deploying pinger in Raspberry Pi

The Raspberry Pi unit that has been used for this exercise is purchased from Element 14 through this website. The following Table 2 shows the component purchased and the price (at the point of purchase, Feb 2013). Apart from the Raspberry Pi SBC, all the other components can be purchased separately at your local IT shops or you might have it already. The Raspberry Pi itself only costs RM111.00 and if you already all the other components, the total cost equal to the price of the board itself. The Raspberry Pi itself does not come with any enclosure but different type of enclosure can ber purchased and there are many third party vendors that produce and sell enclosure with different design. On a personal note, the purchase was hassle free and delivery (to Kuching, Sarawak) was fast (within the next day of purchase). At the time of purchase the main board itself (Raspberry Pi) was quoted as having a three weeks lead time due to high demand, but I received the item after 1 week of purchase.

  • ImageComponentPrice
    RASPBERRY-PI Model B 512 MBRM111.00
    EnclosureRM28.70
    SDHC Memory Card 4GB with Raspbian DistroRM43.78
    HDMI CableRM6.59
    POWER SUPPLY, 5V, 5W, USB TO UK/MSIA 3-pinRM28.33
    USB Cable A MALE-MICRO B MALERM6.46
    Total: RM224.86

    Table 2: Raspberry Pi Model B 512MB RAM and other components

  • Figure 2.1: Raspberry Pi and components

Now, the fun part.....

Assembling the parts: Assembling the components is a straight forward task, starts with inserting the Raspberry Pi board into the enclosure, and inserting the SD card into the slot, plugging in the HDMI cable, USB cable to the power supply brick and connecting the HDMI lead to a monitor/TV. The whole process took less than 5 minutes. Since the board does not have a VGA connector, if you do not have a HDMI capable monitor, then you need to find a HDMI-DVI converter. There is no need for permanent connection to a monitor since after the initial setup, connection can be made to the Raspberry Pi unit using ssh, hence the deployment of pinger and subsequent maintenance and administration can be done using the ssh connection. I was using my own TV at home for this exercise (by the way I was conducting this experiment at home...).. You also need a keyboard and mouse as well (any standard wired or wireless keyboard and mouse will do).

Connecting to the Internet Since I was conducting the experiment at home, the Internet connection is based on TM Streamyx 1MB connection as shown in the following figure.

Figure 3: Raspberry Pi Setup with Internet connection

Booting up and initial setup: Since the board does not have an on/off button, the only way to start the device is by connecting the board to the power supply using the USB+power supply brick. The boot up is fast and took lest than 10 seconds to the reach the initial setup page as shown below. A few config the should be set is the expand_rootfs, change_timezone, ssh, and boot_behaviour.

Figure 4: Initial first boot setup page for the Raspbian Wheezy

After setting up those parameters, select the Finish option and the system will reboot once more. The subsequent reboot will bring you to the desktop. The default desktop is the LXDE desktop which is lightweight, the Openbox window manager, the Midori browser, software development tools and example source code for multimedia functions. By deafult, the wired LAN connection works without any needs for configuration and able to get connected to the Internet.

  • Figure 5: Desktop for Raspbian Wheezy

Now, the really really fun part.....

Please refer to this tutorial document on PingER installation, used in the previous workshop in UNIMAS and prepared by Mr. Kashif Sattar from NUST. Since the Raspbian Wheezy distro is a subset of the Debian, please use the Ubuntu steps in the tutorial document. In order to successfully complete the deployment, the Raspberry Pi unit has to be connected to the Internet. In summary the steps involved are:

  1. Step 1: Pinger pre-requisiteDownloading, extracting, configuring, and installing the pinger package. This is probably the trickiest part since you need to ensure several dependencies are fulfilled such as lynx, XML::Simple, XML::Parser, and so on. Once the dependencies are resolved, the installation is straight forward.
  2. Step 2: Pinger installation: This step involves downloading several files from the SLAC repository such as the ping_data.pl, cgi-lib.pl, and the traceroute.pl to the /var/www/cgi-bin/ location.
  3. Step 3: Pinger configuration: This step involves downloading the pinger.xml file either from SLAC or SEECS to the /usr/share/local/pinger location.
  4. Step 4: Pinger execution: This step running the pinger2 perl script from /usr/share/local/pinger location.

Sample Screenshots from the above exercise

  • Figure 6: Running pinger2 PERL script.

  • Figure 7: Result from running pinger2

  • Figure 8: Sample data collected

  • Figure 9: Remote ssh connection to the Raspberry Pi unit.

  • Figure 10: Running traceroute command from the console.


What's Next?

The above exercise has proven the viability of using Raspberry Pi SBC as a monitoring host for the ePinger project. To do:

  • Deploy the Raspberry Pi unit into a real deployment scenario and measures performance indicators such as resources utilization (CPU, memory, network, etc)
  • Powering up the unit using batteries or renewable energy such solar panel.
  • Buy more Raspberry Pi units.....
Any suggestions?


Conclusion

As a conclusion, Raspberry Pi is a small and low cost option to deploy pinger as a monitoring host and also a viable option for ePinger project to be used in remote telecentres. Apart from Raspberry Pi, there are several other ARM based SBC such as the MK802 II, and Mele A1000. In near future, small form factor SBC will be prevalent at low cost and enable different possibilities for pinger deployment.

If you have any comments, suggestions or corrections, please contact me at johari.abdullah@gmail.com

Long live Raspberry Pi....!!!!