Sunday, January 6, 2013

Remote accessing the Pi with Synergy

If, like me you have a Raspberry Pi on your computer desk, and want to connect to it and hack around, it's a pain to have two keyboards / mice on your desk, and keep typing on the wrong one, etc.

There is a solution to this!  A simple app called 'Synergy' which is available on Windows, Mac and Linux, which basically makes one/many 'client' machines an extension of the 'server' screen real-estate.

It's trivial to install, download it, run it, and add the pi (or other machine) to the right, left, top or bottom of the screen in the server settings box.  Click start, make a note of the IP address that it's configured to run on, and you're ready to accept connections.

On the Pi, install the software:

sudo apt-get update  # get the latest version of software catalogue
sudo apt-get install synergy

And run it:

synergyc {IP of server}

Move the mouse to the chosen side of the screen and it appears on the Pi.  When you have done so, the keyboard is also attached virtually to the Pi - magic!

Saturday, October 20, 2012

Building the Gertboard

I got my hands on a Gertboard the other day, and decided I would document the creation of it.

The first thing I saw when I opened the bags of kit were the SMD components - which scared me somewhat - having done a lot of soldering before but never with surface mount.  Still, the assembly manual included some good advice, and I wasn't too nervous about soldering them.

Elastic band around pliers to make life easier
Look! No Hands!
I went through the parts list, and realised that none of the SMD resistors or capacitors had their values on them, so had to look up all of the part codes on the Farnell website.  Not a big deal, but a bit of a pain, and beginners may get confused by having to do this...

Then I set off.  The advice on soldering SMD in the manual is very well written, and I had no issues when I followed it pretty much to the letter, despite not having decent tweezers, and having to find a couple of errant resistors which had pinged across the desk on a few occasions!

Firstly, a couple of tips.  As you can see in the picture to the right, I tightened an elastic band around my pliers to hold them together - this makes holding things in them a hands free operation, and make life a lot easier!  I also pre-soldered one of the two pads for all of the SMD devices, which meant I could easily identify them and could spend more time concentrating on the fiddly bits.

Using the IDC connector to keep header pins straight
Using the IDC connector to keep pins aligned
Secondly, the tip in the assembly manual which recommends using a sponge to keep the components flush with the board is a really good idea for the components, but it doesn't help keep the headers aligned.  I did this by using the ribbon cable IDC connector - also pictured, to ensure that the headers had the right spacing.  I could even use it for the long headers by using it at 90 degrees to the normal direction - between the joins between the sections of header.

All in all, the assembly went pretty smoothly, and (as I didn't have my multimeter to hand) I decided to risk it and went ahead and powered the board up straight away - without testing voltages, etc - I wouldn't recommend this, but I got lucky and it worked first time - I only checked with the button demo, I'll be playing with it more over the next few weeks / months.
Completed, connected gertboard with jumpers ready for the button.c test program
The completed board, wired for the button test
Running the buttons test on screen with the output shown
The button test running on the pi (sorry for the quality of this one!)
Finally, if you've held on for this long, here's a 1 minute rendition of me building the thing in stop motion...






Monday, October 15, 2012

Long time no blog!

Sorry for the long silence; I've been mentally busy at work, etc.

There's been a lot that has changed since I've been quiet; The Raspberry Pi is available at other stores (Maplin, CPC), has twice as much RAMRaspian is the new recommended image (and it's great, I love the automatic configurator that starts on first boot!), and Eben's released books 'Beginning Raspberry Pi' and 'Raspberry Pi User Guide'.  There's certainly some amazing stuff going on!

Anyway, my media centre project is going well.  I opted for Raspbmc for my RasPi media centre over OpenElec in the end (I'll post in more detail about this later), and it's working great!  I'll post soon about that, as well.  On the downside, I've had issues with my chosen USB Satellite decoder, it seems to be much more susceptible to slightly poor satellite signals compared with the PCI one I have in my Linux desktop, so I've switched back to that for now running TVHeadend.  When I get around to it I'll try the USB decoder/RasPi combo in a different place with a known good satellite signal.  If that works, I'll get a man in to repoint my dish! - I'm still hopeful that I can make something work with this.

In the meantime, I've consolidated my files, and got the Pi working as an Apple Time Machine server, which works really well - I'll be blogging about that shortly.  My intention is to take a Pi and an external HDD to a friend's house, when I'm there (on their Wi-Fi) my Mac will automatically back up to the Pi, and for only £ 25 more than the cost of the drive.

Also, my Gertboard arrives soon.  Hopefully I'll be able to work out how IO works properly then and put some more blog posts up.  Given time!

Monday, June 4, 2012

Building kernel modules

The Raspberry Pi is a very capable little machine, and there is support for common hardware devices provided out-of-the-box. However, you may come across a device that isn't supported, and need to build kernel modules to support it. This is remarkably simple once you get the right bits and pieces on your pi's filesystem, and quite a few people have produced how tos. Perhaps the most useful, and the one I've used to produce this guide is the one writte by Mchr3k on his blog in the article: 'Raspberry Pi Progress'. I've put my own steps below, but it is mainly based on his guide - thanks Mchr3k!

These instructions are tested on a clean install of debian straight from the Raspberry Pi website (I used version debian6-19-04-2012.zip), but you do need more than the default partition size, so resize the partition first (there's a useful guide here until I get around to writing one!).

We already have the build-essential package provided with the Pi which takes care of most of the compilation, but we need git to get the repository, libncurses5-dev to run the configuration menu and the command bc for the kernel build (not in build-essential).

sudo apt-get install git libncurses5-dev bc

Download the kernel sources from the Raspberry Pi source control repository, then link them to the kernel directory - I use a symlink here as means I can store the files on a larger filesystem (I have a USB attached drive)

git clone --depth 1 https://github.com/raspberrypi/linux.git
sudo ln -s `pwd`/linux /lib/modules/3.1.9+/build

Then, we get ready to do the kernel build. The Pi stores the current kernel configuration in the /proc/ filesystem, so we can use that to provide an initial setup - all these commands need to be done from the ~/linux directory.

gzip -dc /proc/config.gz > .config

Set up your new kernel, setting what you need to [M] in the configuration.

make menuconfig

Set up the building process, and start the build - NOTE you have to build the entire kernel the first time to ensure that the symbols are synchronised - the kernel doesn't need to be used for the modules to work (and if you want to add more modules in future, you can just do make modules) - does anyone know how to avoid having to do this?

make

Go and have a lot of coffee - this step takes a significant amount of time - like, about 6 hours!

Once this is done, and if you have any build errors, let me know, I may be able to point you in the right direction, we can now go ahead and install the modules:

sudo make modules_install

If the drivers you require also have firmware, then install that, too:

sudo make firmware_install

All done - congratulations!

What do you use your Pi for?

So I posted a poll a while ago, and although I didn't get many results, it seems people are quite interested in media using the RasPi...  I'm going to re-open the poll and post the results here.  I'm going to keep posting on a few topics, but will certainly be looking at the media use for the 'Pi.  I've got an OpenElec build running as my primary media source at home now, so will comment on this quite a bit over the coming weeks.

Education / teaching
  1 (7%)
Media
  6 (46%)
Something server (storage, etc)
  3 (23%)
Something hardware (measurements, automation)
  3 (23%)

Tuesday, May 22, 2012

Unconventional case

So I decided to make a really simple case...

It involves 83mm heat shrink, which you can buy here, and a hot air gun.

  • Cut to size, about 10mm or so outside the edges of the board
  • Cut a slot out for the HDMI connectors (or audio / composite if you're so inclined)
  • Apply hot air carefully so as to not distort the tubing around the HDMI cable
The result: A fairly well protected Pi that can work on a metal surface without shorting things...  It's not pretty, I grant you.

Pictures here (I failed to cut the tubing long enough so ended up layering a second one on:



Sunday, May 13, 2012

SD Card reviews

So I can't stress enough the requirement to read the Wiki in terms of supported SD card devices - ignore this advice at your peril!

I have tried two different cards at the moment - going to buy some more working ones soon...

16 Gb Class 10 KomputerBay - dd from /dev/zero = 1.2 MB/s
- hangs regularly with large IO operations (Debian) - DON'T USE THIS ONE!

4 Gb Class 4 Transcend - dd from /dev/zero = 3.8 MB/s
- Initial problem with read only device (sdb) on Ubuntu - fixed by GParted (Fedora & Debian) - otherwise works well.

4 Gb Class 4 SanDisk - dd from /dev/zero = 2.7 MB/s
- This is an older card, but works solidly - no problems.