Static fixed and wifi IPs on Raspberry Pi

When coding to and configuring ones Raspberry Pi, it is convenient to have it on a wired connection, but when it is being deployed in the field, it is much easier to have it on wifi.

Still, it can be immensely useful to have it’s IPs always be fixed, making surveillance etc a breeze (or more breezely, to be exact) and thus here’s a quick guide to making that happen. There are other tutorials on this, but most are about fixed IP for either eth0 or wlan0.

Without further ado, on to /etc/network/interfaces:

iface eth0 inet static

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static

The “trick” is to set a static IP for eth0, configure wlan0 and set a default overall static IP, which will apply to wlan0 since there already is an explicit static IP for eth0It should be possible to reference the wlan0 blurb via using id_str=”wlan0″ in wpa_supplicant.conf, but alas, that doesn’t work for me.

Add the necessary network={… blurb to /etc/wpa_supplicant/wpa_supplicant.conf and you’re good to go:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

  ssid="your SSID"

  # Protocol type can be: RSN (for WP2) and WPA (for WPA1)

  # Key management type can be: WPA-PSK or 
  # WPA-EAP (Pre-Shared or Enterprise)

  # Pairwise can be CCMP or TKIP (for WPA2 or WPA1)

  # Authorization option should be OPEN for both WPA1/WPA2 (in less 
  # commonly used are SHARED and LEAP)

Issue a quick

pi@raspberrypi ~ $ sudo ifup wlan0

And verify with

pi@raspberrypi ~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:95:ca:9e
          inet addr:  Bcast:  Mask:

wlan0     Link encap:Ethernet  HWaddr 4c:60:de:5d:7e:6a
          inet addr:  Bcast:  Mask:


Posted in Linux, Networking, Raspberry Pi | Leave a comment

A selection of handy unix/linux one-liners

Over the years I’ve found myself repeatedly using (variations of) the same one-liners to achieve certain tasks in unix/linux environments. Task such as finding files containing strings, finding sizes of directories etc.
Continue reading

Posted in Linux, Unix | Leave a comment

HOWTO: Get IPv6 in your home

Since IPv6 Day when I registered for a SixXS handle, I’ve wanted to jump on the IPv6 wagon at home. My setup is a DSL line with Telenor as my ISP. Almost needless to say, Telenor does not do native IPv6, so another route had to be taken – as noted above, SixXS seems a good choice, since they have made arrangements with several transit providers/colo’s/ISPs to provide PoP’s (point of presence) whereto mortal users, such as myself, can tunnel IPv6 traffic. Continue reading

Posted in IPv6, Networking | Tagged , , , , | Leave a comment

HOWTO: Time lapse with Contour HD GPS

(NOTE: This is a work in progress and mostly to remind myself of the process…)

When I started out experimenting with time lapse movies, I found there were surprisingly few ready-made open source or even commercial software packages that were simple to use, effective or even relevant for my relatively modest needs.

Of course there is QuickTime Pro and all the full blown movie editing packages, but being a geek I figured I could do better. Or at least cheaper :-)
Continue reading

Posted in Photo | Tagged , , , , , , | 1 Comment

GWTP, Guice and Spring non-trivial beans

Having struggled a bit with the somewhat terse documentation and JavaDoc I finally figured out the tricks of using Guice and GWTP along with Spring. As much for my own future reference and for others that may have the same issues, here’s what I did.

Continue reading

Posted in Coding | Tagged , , , , | Leave a comment