Musings of a Software Engineer

The gentle ramblings of a software engineer

Raspberry Pi: Wifi Setup (finally)

Yikes was it really 2 months ago that I performed my raspberry pi reinstall.  Where has the time gone…..

I want to be able to run my raspberry pi as a headless server that I could connect to from other machines within the house and look to do other projects with it in the future.  So the first thing I needed to do was setup the Wifi, I remember the first time I did this it didn’t appear to be as easy I would have expected.  My network is setup to use WPA2-PSK and most of the guides and documentation I could find on the net used wpa_supplicant to setup the wifi.  Thankfully there is a much easier way than that.

To setup the wifi change the file called interfaces at /etc/networks/interfaces it will initially look like:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

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

To change to using dhcp comment out iface wlan0 and the wpa-roam lines and add a wpa-ssid and wpa-psk eg:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
##iface wlan0 inet manual
##wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface wlan0 inet dhcp
wpa-ssid <networkid>
wpa-psk <password>

iface default inet dhcp

Now because I want it to be a headless server rather than using dhcp I need to switch to manually configuring the ipaddress. Change the iface wlan0 line and add a few more:allow-hotplug wlan0

iface wlan0 inet static
address <ipaddress>
netmask <network_mask>
gateway <gateway>
wpa-ssid <networkid>
wpa-psk <password>

The final change is to update the nameserver for the system to ensure that it can lookup address correctly this is help within /etc/resolv.config:

nameserver <dns_server>

The dns_server will either be the gateway server or the dns server that is supported by an isp.

No Comments

Reinstall here we come

After my previous post about attempting to save my Raspberry Pi install, sadly I have to report that I’m having to go down the reinstall route which is a real shame because I’ll have to setup my VPN and Airplay printer again.

The reinstall starts with downloading the latest version of Raspbian (the Raspberry Pi’s custom Debian install), there are other versions I could install but having the option to use the desktop interface is nice to have.

Screen Shot 2013-04-28 at 21.55.10

To setup my SD Card in the past I’ve used the RPI SD-Card Builder, with the graphical interface its really easy to setup.  Firstly you select the image of the operating system and then the connected sd card and thats it (be careful when selecting the sd card because there is no turning back).  The first time I did an install I wondered whether anything was happening because the program uses a number of scripts to set up the card, and there is no progress bar, but it will eventually finish installing and the sd card will appear in finder again.

And thats it…. put the sd card into the Raspberry Pi and you should get a running system.


No Comments

Kernel Panic – not syncing

My Kernel is panicking…. its been a long time since I’ve had a kernel panic error message from a Linux system.  Its probably been about 6 to 7 years since my last kernel panic when setting up a MythTV media centre machine.  We had a power cut about 3 weeks ago and its the first time I’ve had chance to investigate what happened to my Raspberry Pi, and it turns out if you pull the cable out or have a power cut then your file system can be corrupted.  Hopefully by the end of this post we will have a working Raspberry Pi system that I don’t have to reinstall and reconfigure.

Looking at alot of forums it seems like the best way to fix the issue is to use another Linux machine, which thankfully I have to be able to attempt to fix it.  So I connected my corrupt SD card using a card reader to the system and used the mount command to find out where it had been mounted to automatically:


This will produce alot of output but hopefully you will be able to find something that looks like

/dev/sdd1 on /media/RASPBERRYPI type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)

The most important bit is the /dev/sdd1 this shows where linux things the device is located. Most things I’ve read about how to fix this say just run:

sudo fsck.ext4 -y /dev/sdd1

and all will be well with the world. Well as always when I seem to be attempting to fix a linux issue the simple fix never works for me, because this just returns error messages:

fsck.ext4: Superblock invalid, trying to backup blocks...
fsck.ext4: Bad magic number to super-block while trying to open /dev/sdd1

Obviously having an invalid superblock is not a good thing…. but thankfully the file system does back them up so fingers crossed one of these backups will sort us out.

sudo mke2fs -n /dev/sdd1

At the bottom of the output there are a list of superblock backups that we can attempt to use. Make a note of these and

sudo e2fsck -b <block_number> /dev/sdd1

This will hopefully run and attempt to start fixing the disk, my e2fsck is still running at the moment but I have my fingers and toes crossed that everything will be ok and my Raspberry Pi will restart

No Comments

Yikes it’s been a while

Wow where has the time gone…..

After deciding to restart my blog after almost three years I was looking back over some of the previous posts. Its amazing to think that the iPad has been with us for three years now. I’ve had my iPad for two years now and if the worst happened and it decided to blow up or get covered in sticky chocolatey fingers and give up the ghost I’m not sure I could live without it anymore.

I think it’s the one piece of technology that has truly changed how I interact with the online world. Where as before my computer was hidden away in a study, now I have all of the Internet at my finger tips and i don’t have to wait for anything to boot. My iPad cannot replace my laptop there are still a large number of things I need my laptop for but it’s certainly coming close….

No Comments

The iPad has arrived

Just like probably every other computer blog in the UK, the iPad has hit our shores… Its been over a month in waiting since it was launched in the US.  If you watch Formula One racing in the UK you will have already seen the iPad replacing good old pen and paper.  At the last GP I watched they even started showing a video on it.  Here was I thinking that the BBC wasn’t suppose to be doing product placement.

On Friday, I was in town and walking past the Apple Store I couldn’t resist a play with the fattened up iPhone.  As you would expect it looked fantastic as most Apple products do.  Looking at photos was great being able to quickly view what was inside of a folder and the speed between loading of photos was a joy.  The example iPad had a copy of the FT App which is a very well thought out app, fitting nicely to the screen size and turning the pages was great by just moving your hand across the screen.  Sadly it looked like the facebook app did not have an iPad big brother because the screen looked stretched and pixalated.  I loved that the Flight Control App had been updated for the iPad allowing to people to play at once.

So would I want one?  Well I am a geek by trade and they do look shiny and new.  I can certainly see a use for them in meetings across the world, instead of turning up with pen and paper you could use your iPad instead.  Access to email on the move around a workplace would be good as well.  The problem at the moment is they are alittle bit too expensive for what they do.  I will be interested to see if anyone comes up with a stylus and writing app so you can take notes on the iPad easier than using the touch screen keyboard.  The keyboard is good but I suspect its not as good as a nomal computer keyboard over time.  Knowing new gadgets I think waiting a few months while the leading edge people find all the nasty bugs with it and app come out with iPad 2.0 or what every they call it.

I think it might definitely be on my shopping list in the not too distant future.  Plus some of the adds on like the camera card reader are a great idea.  The iPad case that Apple sell as well looks to be well thought out and a decent price as well (£19).

No Comments

Local Radio stations iPhone App

Wow its been a while since I’ve posted here, so much to my good intentions of trying to post at least once a week.  Where does the time go!

This is slightly off topic, one of our local radio stations has created an iPhone app (actually saying that just about every radio station has an app now!).  But the reason that I’m writing about it is because of the way they advertise it on the radio.  If I can remember correct it goes along the lines of “now you can take nnnnnnnnn with you where ever you are, with our new iPhone app”.

Now maybe I’m getting old or something but isnt the whole point of a local radio station (broadcasting on FM) that you can take them anywhere and you dont really need an iphone to do this…..

I will admit the app is pretty good and you can email the presenters and see what is currently playing and if you like it buy it straight from iTunes.  But the tag line of now you can take nnnnnn with you seems abit odd to me.

Anyway I promise that the next post (when ever that is) will actually be a useful one rather than a strange rant about a local radio stations advertising.

No Comments

Microsoft the question is why?

So I’ve been having issues with startup time of my laptop, over the years its been getting slower and slower.  The standard thing that appears to happen with Windows Machines.  So the usual approach is to reduce the number of programs that setup when windows is initially loading, nice and easy using either msconfig or a program like spybot.

This made a difference for a while but it turns out that there is another thing that will really help with windows startup.  Something that I really really cannot believe, it turns out that on startup Windows looks through all your files and folders on your Desktop.  So if you have loads of files and lots of folders (with files within them) then windows spends most of its time looking at them.

So my question is Why?  So far I’ve not come up with an answer that I can think of to why this is a good idea.  So to everyone out there with slow machines at startup, please please check what you have on your desktop!

1 Comment

Beer a day is good for you

Slightly off topic from my usual posts about computer science and technology but I saw this in my BBC Focus Magazine and just had to post about it!  Turns out that having a beer a day is actually good for you.  The study carried out at the University of California found that the amount of Beer in silicon was good for the bones.  An average pint contains 15mg of silicon which helps to build bones and connective tissues.

So cheers to the pint I say 🙂

No Comments

Internet Election Fever

BBC Election 2010 LogoSo the election for the UK was finally announced this week, probably the worse unannounced date!  All the media outlets have been jumping on the bandwagon with some fantastic but probably useless election tools.

The BBC for example has the election calculator where you can spend all of, well lets be honest a minute or so.  Dragging bars around to find out what could happen at the election and how much percentage each party would need to get a majority.

The Guardian has something very similar plus also a daily poll that they report on with great flash graphics

The times also has the daily poll on there site as well as well as an interactive map of what could happen

Then you land on the Suns webpage and what do you get a lovely text written these are the current poll percentages!

Bad form from the The Sun I think!

Finally probably the best of them all, are you sick of the media outlets, borrowed hearing about expenses, cannot make up your mind which one to vote for because they all sound the same.  Well is the way to decide how your votes match with the major parties.

No Comments

What a week for the iPad..

Its been a heck of a week for the iPad, released just under one week ago and what a week its been.  Starting out with the hype of new videos being added to the apple website showing what the new iPad can do.  I have to admit that it does look a really good product from the videos.

Within 24 hours of its release the security had been break and online was pictures of a jail broken iPad!  Which is pretty good going to create a hack that quickly and display the iPad being connected to through telnet / ssh.  Have a look at review of this break and the pictures.

Following the jailbreak a couple of days later came the full information about what was under the hood of the iPad thanks to iFixit and there iPad Teardown.  I would highly recommend reading the article that they have published because its really interesting how apple manage to fit everything inside such a small case.

The CPU was also xray’d after ifixit managed to get it out of the ipad.

Sadly the week ended with alot of complaints coming in from the leading edge users with them having problems connecting to there wireless networks.  Unfortunately that was the end of the complaints, there was rumours that the ipad if left on running would run ok but over time slow down to a complete stop which does not sound good.  The final reported problems were problems sync with iTunes.

As a software tester by day its amazing that some of these faults have got out, but I can certainly understand how it happens.  Fingers crossed Apple will be on the ball and get all these problems sorted out, because the iPad does look like a great product.  Do I want one…. I think the jury is still out yet.  Will have to go to an apple store and have a play with one and see how good it is.  The iPhone has been a great product and just gets better with more apps, however there are still some things that I do not like about the way apple have stopped non-apple auth’d apps onto it.

No Comments