Setting Up Raspberry Pi with Wifi and a Static IP on a Hidden SSID

There are a lot of posts out there on this topic but unfortunately they all contain incorrect information and don’t work. After several hours and much head banging I finally got it. So I’m going to settle this once and for all. Here is my setup. I have a Raspberry Pi model B running Raspbian, a BUFFALO AirStation HighPower N150 Wireless USB Adapter – WLI-UC-GNHP, and a hidden SSID. lsusb reports this as
Bus 001 Device 004: ID 0411:0158 BUFFALO INC. (formerly MelCo., Inc.) WLI-UC-GNHP Wireless LAN Adapter
Before I continue, yes I know the usual lecture about using a hidden SSID so you can save your breath. I’m using one anyway, deal with it.
First, set up the wireless with DHCP to make sure it works with your set up. Then you can change it to static.
Now, on the Pi, open /etc/network/interfaces 
You should see something like 
auto lo
iface lo inet loopback
iface eth0 inet dhcp
iface default inet dhcp
We’re going to make it look like this
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp
I’ve added or modified the parts in bold. I’ve seen some sources say to add a pre-up command here to run wpa_supplicant. This is incorrect. wpa_supplicant will get run automatically, we don’t need to do it. Besides, the command that I’ve seen doesn’t always work with every adaptor. Let the system handle it, it will figure out the correct way to run wpa_supplicant. Adding your own command will also just cause a bunch of ugly errors at bootup.
Now open /etc/wpa_supplicant/wpa_supplicant.conf
You should see a couple lines already there
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

Add the parts in bold to make it look like this

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
# ap_scan can be 0, 1, or 2. Some sources say to use 2 but it did not work for me. 1 did.
ap_scan=1
eapol_version=1
network={
        ssid="YOURSSID"
# This is needed for hidden SSIDs
        scan_ssid=1
        mode=0
        psk=reallylonghexnumber
# RSN for WPA2 or WPA for WPA1
        proto=RSN
# WPA-PSK or WPA-EAP
        key_mgmt=WPA-PSK
# CCMP for AES or TKIP for TKIP.
        pairwise=CCMP
# OPEN for WPA1/2 or SHARED or LEAP
        auth_alg=OPEN
}

Make sure to tab indent the network section

Use a hex version of your passphrase as it will eliminate any messups caused by special characters. To get this use the wpa_passphrase command

wpa_passphrase <SSID> [passphrase]

If you have special characters in your passphrase you can enclose the passphrase with quotes. It will show you what the passphrase was that it used so you can double check it used the correct passphrase.

Note: If you use the actual passphrase it must be inside quotes. The hex number should not be inside quotes

These settings will depend on what you have your network configured with. Adjust them accordinly.

Now cross your fingers and reboot to make sure everything comes up properly

sudo reboot

If everything came up properly and you can connect to your Raspberry Pi over SSH or you can ping google.com congratulations. Continue reading if you want a static IP

Static IP Address

Open /etc/network/interfaces again and we’re going to make some changes

Change 

iface wlan0 inet dhcp

to

iface wlan0 inet static

Now add the following lines. These values will be dependent on your network configuration again. Adjust them accordinly

address 192.168.1.11
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1

When your finished it should look like this

auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.11
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Cross your fingers and reboot again to make sure it all comes up and is working correctly. If you’re able to ping the IP you just configured congratulations.

Enabling HTML5 MP3 Playback in Firefox 30 and Above

The other day I was trying to play a track on Soundcloud and it wasn’t playing. Soundcloud switched to an HTML5 player instead of Flash quite a while ago. This was strange because it had previously worked. I tried Safe mode but it still didn’t work. I tried Chrome and it worked in there so I was somewhat perplexed.  I eventually found that starting with Firefox 30, Firefox started using Gstreamer 1.0 instead of the old 0.10 version. By default not all of the plugins to Gstreamer are installed in (K)Ubuntu. Pretty much all of the open source sound codecs will work (ogg, flac, vorbis, etc) but mp3 will not. The fix to this is simple.

sudo apt-get install gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly

Enjoy your HTML5 mp3 playback!

Why I Switched to KDE

I have always been a Gnome person. I’ve tried KDE every once in a while but I never really liked it. It seemed it was always either features that were missing that Gnome had or things didn’t work right where they worked fine in Gnome.  I could never get used to it and I would always find myself back in Gnome.

Recently though, the timing was just right. I used to be a big fan of Unity, but I was very put off by the version that is in Ubuntu 11.10.  I liked the version in 11.04 much better. Not to mention it was much stabler. The version in 11.10 was very unstable for me and I did not like some of the new functionality. I quickly became very unhappy with Unity.  I realized that I wasn’t as big of a fan of Unity as I thought. I didn’t want to use Unity anymore I got so frustrated with it. So I started looking at my options.

 

I decided I would try KDE yet again. Not only did KDE look absolutely beautiful, but all of the features that were missing for me had been implemented and all of the deal breaking bugs had been fixed after many years. So I tried to give KDE a genuine shot. It was a bit awkward getting used to the way KDE does things. But I fell in love with it after just a few days and haven’t looked back. KDE seems very refreshing and freeing compared to Gnome. I can customize every little bit to my likings. Now I look back and Gnome seems very restrictive to me.

 

tl;dr: Got tired of Unity and tried KDE again. Fell in love with it and never looked back.

2010 in review

The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here’s a high level summary of its overall blog health:

Healthy blog!

The Blog-Health-o-Meter™ reads This blog is on fire!.

Crunchy numbers

Featured image

About 3 million people visit the Taj Mahal every year. This blog was viewed about 33,000 times in 2010. If it were the Taj Mahal, it would take about 4 days for that many people to see it.

In 2010, there were 3 new posts, growing the total archive of this blog to 51 posts. There were 3 pictures uploaded, taking up a total of 128kb.

The busiest day of the year was January 4th with 156 views. The most popular post that day was Getting Intel ICH8 Family (rev 03) Sound Card to Work in Gutsy.

Where did they come from?

The top referring sites in 2010 were ubuntuforums.org, forum.ubuntu-fr.org, linux.org.ru, linuxquestions.org, and forum.ubuntu.pl.

Some visitors came searching, mostly for epic fail, sed replace word, ubuntu scroll lock, gstreamer midi, and qgtkstyle ubuntu.

Attractions in 2010

These are the posts and pages that got the most views in 2010.

1

Getting Intel ICH8 Family (rev 03) Sound Card to Work in Gutsy October 2007
89 comments

2

Making Intel Wireless 3945ABG Work Better on Ubuntu Hardy April 2008
47 comments

3

Using sed to replace words in a file February 2008
7 comments

4

How To: Ubuntu MIDI Playback with Audacious January 2008
16 comments

5

Getting Scroll Lock to Work in Ubuntu April 2008
14 comments

On Unity

With the recent announcement of Ubuntu 11.04 shipping Unity instead of Gnome Shell by default, there has been a lot of backlash.  I’m talking about all the knee-jerk reactions such as “I DON’T LIKE THE DIRECTION UBUNTU IS HEADED TIME TO SWITCH TO GENTOO!!!!!!!!!!!!!11″.  It’s funny how people can react like this over an Ubuntu release that hasn’t even been released yet.  Unity has been made the default interface on the netbook edition, but what needs to be understood is that it is kind of a “1.0 release” sort of thing.   In the same way that the first release of KDE 4 was rough around the edges, Unity is rough around the edges. It is definitely not perfect.  Even I have some complaints about it, but for the love of sanity, try it for more than ten seconds and make your decision based on actual experience and not nonsense.  Also realize that the Unity that will ship with 11.04 will be much different from the current version.  The developers are going to get a lot of feedback during this release cycle and will improve upon it.

Transitions can sometimes be a bit uncomfortable.  We’ve been though this many times before.  As I mentioned before, when KDE 4 was initially released there were many, many complaints. Now all I hear is how nice KDE 4 is.  When PulseAudio was released it caused a lot of problems for people.  Over time though it has greatly improved and I would even dare to say that it now works for most people most of the time. When Ubuntu first released Notify-OSD, there was a lot of outcry about that but died down after a while.  Maybe because people become used to it or *gasp* prefer it to the old notification-daemon.  Unity will follow in a similar fashion.  Transitions can be bumpy but everything turns out OK in the end.

Some other things to consider:

  • Gnome Shell will still be in the repositories and easily installable.
  • Gnome 2.x will still be in the repositories.
  • Unity is not replacing Gnome 3

Give Unity a chance before writing it off and don’t spread FUD.

Irony

With the introduction of the new theme for Ubuntu 10.04 there has been much controversy over the placement of the window management buttons. A lot of people (or perhaps a small but very loud group of people) have complained about how the positioning on the left is bad. The thing is another major OS places its window management buttons on the left; OS X. I’m positive that Apple put a lot of usability research into the placement of those buttons. There’s no way the developers just arbitrarily placed the buttons on the left. But that’s besides the point of this post. What I find kind of ironic amongst all of the complaining is the most downloaded theme on gnome-look.org is this theme. And guess where the buttons are placed. That’s right, on the left. If buttons on the left are so bad, why do so many people want them? Just sayin’.

File Roller is Terribly Inefficient

The Gnome archive manager, File Roller, is terribly inefficient in the way it handles archive extraction and creation. I just happened to have Htop running while I was extracting a large gziped tar archive which was on my external hard drive with File Roller when I saw what File Roller was actually doing. First off, File Roller is pretty simple in the way it works. It’s just a GUI wrapper for the command line tools like tar, gzip, etc. So here is what File Roller does when you extract something. It copies the whole archive to a temporary directory in ~/.cache/.fr-xxxx. Then it extracts it in the temporary directory and then copies the extracted files to the location you’re extracting them to.  ARRRRRGGGHH! :evil: What is this I don’t even

Now if that archive happens to be sitting on an external drive and you’re extracting it to the same directory or to another directory on the same external drive you can see just how terribly inefficient this is. It has to copy the archive to your home directory then extract it, then copy it back to the external drive! This is such a waste of time, it makes it take twice as long since it has to make unnecessary copies to temporary locations. Like I said before, File Roller is simply a GUI wrapper for command line tools which is what makes me even more frustrated with this. Tar supports extracting to alternate locations with the -C option. So why the hell is File Roller making unnecessary, time-wasting copies to temporary locations!? I can accomplish the same thing in less time and more efficiently than File Roller with something like this

tar -xzvf file.tar.gz -C /path/to/destination

Another reason this is so bad is that if you happen to be running low on disk space in your home directory and you try to extract an archive that is on an external drive and the archive is larger than your free space you won’t be able to because it will complain about the lack of disk space even though you may have more than enough free space on the external drive.

Finally, it does something just as pointless when creating archives too. I had a 2.3GB file on my desktop that I wanted to compress with lzma. Guess what File Roller did. Yep, copied the whole 2.3GB file to a temporary directory, compressed it, then copied back to my desktop. :evil:

I see no logical reason File Roller needs to be making these unnecessary copies to temporary locations. If anyone has a good reason why it does this please enlighten me.

Related bug https://bugs.launchpad.net/ubuntu/+source/file-roller/+bug/146206

/rant

A place for my tips and thoughts

Follow

Get every new post delivered to your Inbox.

Join 33 other followers