Saturday 23 March 2013

Configuring WiFi on Raspberry Pi

Edimax WiFi Dongle

Static IP Address

No Encryption

2013-03-23


My Raspberry Pi, a tiny, ARM-based, single-board computer, has arrived.

Following a test boot and preliminary configuration, I needed to get it running on WiFi.  For this, I had an Edimax EW-7811Un Wireless-b/g/n USB dongle--very common among Pi owners.

Getting it going wasn't easy.  All the references online talk about WPA/WPA2 configuration.  Well, I don't use encryption, due to the menagerie of devices (of various ages and levels of technological sophistication) we use around here.  Instead, I rely on MAC filtering.  Yes--it's not the most-secure setup, as someone can always clone a MAC address and connect.  Personally, I feel that if they want to go to that much trouble, when there are several open access points on this street alone, they're welcome to some of my bandwidth.  So far, it hasn't been an issue.

Anyway.

After digging through man pages and reading others' comments, I got things set up.  When not using WPA, you needn't mess with wpa_supplicant; only the interfaces file must be configured properly.

1.  Don't worry about kernel modules; the appropriate module is pre-loaded.

2.  Login to your Pi and enter the following, leaving out the comments:
cd /etc/network                # Change Directory
sudo nano interfaces           # Edit file with nano text editor

In the nano editor, enter the following lines:

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
wireless-essid your_ssid            # Router's SSID - no quotes
address dotted-IP-address           # IP addr you want for Pi
netmask 255.255.x.x                 # 255.0 or 0.0
network dotted-IP.0                 # i.e. x.x.x.0
broadcast dotted-IP.255             # i.e. x.x.x.255
gateway your-gateway-ip             # Usually your router's IP

If there's a line in there about "wpa", prefix it with '#' to comment it out.

Press Ctrl+O to save, then hit [Enter].
Ctrl+X to exit.

3. Logout.

4. Remove the Ethernet cable (if any) and insert the Edimax dongle.

5. Reboot

It should come up and connect automatically.

Cheers!



Tuesday 19 March 2013

Goodies

2013-03-19

I have new toys on the way:
- A dr.Tech wireless weather station (WA-1070T, very similar to the ubiquitous Fine Offset WH-1080PC, which I had before)--I'll be adding (flawed) wind and precip data to my weather site in the near future; and
- one Raspberry Pi single-board microcomputer.

The Pi runs a version of Debian Linux--my favourite distro.  The weather station, like my first one three years ago, has a wireless receiver with USB computer input.

My plan is to sorta bungie the Pi to the back of the receiver, hook in the USB input, use the pywws scripts to read in the live data, and pipe that to my weather software.  I'll need quickly to write a little conversion program, to change the pywws data to something my system can handle.  I can have that mostly written-up in advance.

The Pi is coming with an AC adapter and WiFi dongle.  This means I can place the receiver in an optimal location, and the Pi will come along for the ride, burdened only by its power cable.  Meh--I can live with that.  I have a portable DVD player, with composite input, that I can use as a sweet little mini-monitor, too.

Heck, as the weather system itself is deployed in Linux, I could move the whole-shootin'-match over to the Pi and let it chug along.

The weather software itself will require some tweaking to handle the live wind and precip data.  I can do that in a few idle hours.

At some point, I'll have to polish- and package-up my software and Open-Source it.

So, to my neighbours:  the instrument mast is coming back!