Thursday, January 16, 2014

Raspberry Pi - Part 1

PiStories Part 1

Getting up and running

I finally succumbed and bought a raspberry pi. I went for the Maplin kit n34qg. On unboxing I realised I had probably spent more than I had to in order to get started. The box contains:

  • Pi Model B
  • Case
  • Wireless keyboard
  • Wifi dongle
  • 4port powered USB hub
In fact in my odds and ends drawer I had a wifi dongle that I used to use on an old laptop and an 8 port hub which would work better because the footprint is pretty well the same size and the pi itself and it sits on top of it with a bit of bluetack.

The keyboard's ok, if a bit small and I wouldn't want to use it for any serious typing. It will come into it's own if I ever get the Pi linked to the TV and want a remote.

In terms of booting up everything worked pretty well out of the box.

I am running on a Toshiba TV and a Benq monitor. The monitor only has a DVI port but a cheap adaptor from Amazon sorted that out.

The sound didn't work on the TV immediately I had to add the line hdmi_drive=2 to the /boot/config.txt and things started working.

The wifi utility is on the desktop and it connected to the home wifi no problem.

During the setup I realised that the keyboard wasn't really working for me so I plugged in an old usb keyboard I had. It detected it straight away. I had to remove the wireless kb dongle because it was causing some strange behaviour with missed keys and key repeats.

One of the first things you should do is fire up raspi-config. Before you use it the first time go to the last menu item and get the update. The other thing you might want to do set the gui to start automatically.


I decided early on that the footprint of yet another keyboard on the desk was not practical so I decided that remote desktop was the way to go.

The recommended remote server for Raspian is TightVNCServer. The command line to get it is

sudo apt-get install tightvncserver

and the instruction to start it is just


The first time you use the password file is not present so it prompts you for a password for read/write access and an optional one for read access only.

When it starts it tells you it has started but not which port it is listening on or the ip the pi is sitting on. The best way to find out the port is to have a look at the log file like this:

I haven't quite got to the bottom of the last two errors but it works ok anyway.

So from that you can see that we are running on port 5901. You can try and connect using the machine name and DNS. That was not working for me so I needed to get the ip address of the Pi like this:

You will see from that that the wired Ethernet (eth0) is not connected. The bit we are interested in is the wlan0 connector and there you can see the internet address that has been assigned by the router. I have a long lease on the addresses so I usually don't bother setting up a fixed IP on the local network.

Now I have all the information I need to connect. On the laptop I have to run windows for work. I am using the TightVNC client for windows. When you start it up it looks like this:

Not the double colon before the port number...that had me guessing for a while.

When you have a good connection you can enter your password:

And bingo you should be connected.

...Coming soon

  • Connecting with the remmina remote desktop in Linux
  • ssh remoting
  • My appraisal of Python
  • tkinter GUI programming

No comments:

Post a Comment