Getting Started with My Raspberry Pi – Part 1: Blog Post Survey

 

In this blog post, I give a brief survey of some of the articles I have come across during my initial work with the Raspberry Pi (RPi).

WiFi

  • How To : Use The Raspberry Pi As A Wireless Access Point/Router Part 1 – http://sirlagz.net/2012/08/09/how-to-use-the-raspberry-pi-as-a-wireless-access-pointrouter-part-1/
    • A well written multi-part tutorial that describes how to configure your RPi as an access point (AP) and router. The first two parts covers the AP part, including setup of hostapd (user space daemon for WiFi), dnsmasq (DHCP server), and finally the network /etc/network/interfaces config file. The third part covers router setup.
    • Fun fact: the following post appears to be the one where the author (SirLagz) tells about his plan on making this “turn your RPi into an AP”-thing into a blog post (if you, for some reason encounter problems with this, asking your question in the RPi forum might be the way to go as it appears that SirLagz is also helping people getting this to work): http://www.raspberrypi.org/phpBB3/viewtopic.php?f=36&t=14100
    • Please note: that not all WiFi adapters are supported! The tutorial uses a WiFi adapter with the Ralink RT5370 chipset (can be bought for less than $10 on ebay) – in a coming blog post I will list my RPi hardware and peripherals for details on which WiFi adapter(s) I have bought.
    • Pros:
      • Smart if you are planning to connect to the RPi from a mobile device that do not support ad-hoc connections (e.g. Android devices).
    • Cons:
  • [HOW TO] Wireless Hotspot With Realtek RTL8188CUS –  http://www.raspberrypi.org/phpBB3/viewtopic.php?f=36&t=19517
    • A good tutorial describing the steps involved in creating an ad-hoc network on the RPi. I think this tutorial in particular is better than all other similar attempts (like this, this, and this) because it covers encryption, DHCP, and the scenario where the RPi is only supposed to create an ad-hoc network if it cannot connect to a known WiFi on boot.
    • In this tutorial dhcpd is used as DHCP server, so if you are planning to try turning your RPi into an AP using the tutorial above, please note that the used DHCP servers are not the same, and be  aware that this might give some problems in terms of conflicts if both DHCP servers are installed and running at the same time.
    • Pros:
      • Covers the topic in detail with sample code and descriptions.
      • Covers WEP encryption and DHCP.
    • Cons:
      • I have the 2012-09-18-wheezy-raspbian image running right now, and used this tutorial as basis for setting up ad-hoc network on my RPi. I did encounter different issues however, like conflicts with the bundled wpa_supplicant which can be used to manage WPA/WPA2 connections on the RPi.
      • The tutorial covers how to configure the RPi to create an ad-hoc network if it cannot connect to a given WiFi at boot. However, I do not think that the approach used in the tutorial is what people would really like – in the tutorial it is described how the /etc/network/interfaces config should be modified such that the RPi can try to connect to a WiFi on boot without using the wpa_supplicant. The problem with this is when the known WiFi is not in range – in this case, the RPi stalls the boot process sending DHCPDISCOVER packages to the network in attempt to get an IP lease. As this process involves exponential backoff, the boot time is increased by at least 1 to 2 minutes.
      • Please note: In a coming post I will describe how I have have solved both issues described above – changing this approach to use the wpa_supplicant instead in order to keep the boot time low and also support connections to more than one WiFi network.

GPIO

  • RPi Low-level peripherals – http://elinux.org/RPi_Low-level_peripherals
    • This is an entry from the RPi wiki. It is a more or less standard article describing GPIO and I think it gives a good introduction and should be used as reference if you are going to work with GPIO.
  • Simple Guide to the RPi GPIO Header and Pins – http://www.raspberrypi-spy.co.uk/2012/06/simple-guide-to-the-rpi-gpio-header-and-pins/
    • This is a well written blog post about how to get started with GPIO and the Python library RPi.GPIO. Besides being a clear and concise post, it includes illustrations and sample code, which makes it easy to read.
    • One of the things I like about this article is that it deals with a problem that many newcomers might have – the pin numbers. For some reason, this isn’t as simple as one might expect – it turns out that you can refer to the GPIO pins in different ways, e.g., by the pin numbers (1,2,3,4,…) or by the GPIO channel numbers.
    • I used this particular post to get started with GPIO on the RPi and it is highly recommendable if you are new with GPIO and is searching for a good place to start.
    • Please note: as mentioned in the blog post, beware that most of the pins goes directly into the Broadcom chip on the RPi – so remember to double check everything before you turn it on.
    • Pros:
      • Well written. Covers almost everything you need to know in order to get started with GPIO and the RPi.GPIO library.
    • Cons:
      • None.

Web Server

  • Accessing GPIO from a web server – http://markingramuk.wordpress.com/2012/08/12/accessing-gpio-from-a-web-server/
    • A concise tutorial that describes how to set up lighttpd (pron. lighty) with Python CGI in order to communicate with GPIO from a web server.
    • A thing I really like about this tutorial is that everything is thought through. A couple of quotes from the author, Mark Ingram, which I think underlines this, are:
      • “… the obvious choice would normally be Apache, but with the Raspberry Pi being limited in CPU and memory resources, I decided to check out lighty (lighttpd) as it has a small memory footprint”
      • “As it’s a bad idea to run a web server as a root, you need to access the GPIO from a non-root account. In order to do this, I used the “gpio” program from the WiringPi package.”
    • The tutorial seems to be a wrap-up of the following questions (asked by Mark Ingram) on the RPi forum at stackexchange:
    • I have been using this tutorial in a project where I’m controlling a relay from a web-interface, and using the tutorial was really simple. The only difference I noticed during my installation was that I did not need to run the initial commands that adds the www-data group to the system. So, if you are on raspbian wheezy like me, you might also skip those steps and go directly to: sudo apt-get install lighttpd.
    • Pros:
      • The tutorial is easy to follow and within minutes, you will have a web server running that allow you to communicate with GPIO through CGI scripts.
    • Cons:
      • None.

Peripherals

  • RPi VerifiedPeripherals – http://elinux.org/RPi_VerifiedPeripherals
    • If you are planning to buy any kind of peripheral for your Raspberry Pi and want to check if someone else have made it work on the RPi, I suggest that you take a look at this wiki article. The article contains a comprehensive list of verified peripherals grouped by categories like: SD Cards, USB Keyboards, USB Mouse, Power Adapters, etc.
    • Pros:
      • I used this list to decide which hardware to buy for my RPi, and I wasn’t disappointed – everything have just worked out of the box.
    • Cons:
      • None.

Trackbacks/Pingbacks

  1. Raspberry Pi Prank Tutorial – Making Your Co-Worker’s Desk “Magically” Go Up and Down | Lasse Christiansen Development - December 6, 2012

    […] This is covered in great detail by Mark Ingram here: http://markingramuk.wordpress.com/2012/08/12/accessing-gpio-from-a-web-server/ (see my Raspberry Pi blog post survey for my comments on that tutorial: Getting Started with My Raspberry Pi – Part 1: Blog Post Survey) […]

Leave a Reply