W950i Remote with Feisty

Introduction

I recently had to give a presentation for my fourth year project, and found that using a PDF containing slides created with LaTeX and Beamer is really quite a good way to do it. evince is a pretty nice PDF viewer these days and its presentation mode works fairly well. However, I needed some sort of remote control so that I could move through slides without messing around with the keyboard during the presentation.

Since my W950i has Bluetooth and runs Symbian UIQ 3, I figured there might be some way to use it as a remote instead of having to go and buy something that might not work under Linux. Unfortunately, a lot of the existing solutions for this kind of thing under Linux aren’t really compatible with the W950i. After more than a few hours of searching, there seems to be a large gap in Google when it comes to this; hopefully this should help some people out.

How it works

The theory is quite simple. An existing project, BluRC, enabled me to avoid a large chunk of coding. It comprises of two parts: a server, which sits on your computer, and a Java client which runs on your phone. The server sends the client a menu structure when it connects over Bluetooth, then sits back and waits for the client to send commands. All kudos to the authors for this software, it works very well!

BluRC was originally intended to work with MythTV, but the package here is intended to be used under presentations - i.e. the menu is extremely minimalist. It only has two commands for going backwards and forwards through slides. Since it’s currently unmaintained, I’ve taken the liberty of patching some issues and packaging it up for Ubuntu Feisty.

What you need

  • A computer with a Bluetooth connection, running Ubuntu Feisty (Edgy/Debian should also work but not tested).
  • A phone which runs Java MIDlets, and supports JSR-82 (the Java Bluetooth API).

Installation

I have compiled a useful package which you can download below, built for Feisty i386. Alternatively, grab the BluRC source code from SourceForge and apply my patch, which you can obtain by clicking here (63 downloads).

Download BluRC for Feisty x86 (145 downloads)

If you’re building from source, then you’ll need these packages:

$ sudo apt-get install gcc build-essential
$ sudo apt-get install bluez libbluetooth2 libbluetooth2-dev

Configuration

blurc in its packaged form requires virtually no configuration on your part. The only thing you’ll need to do is find the device ID for your phone. This isn’t hard: make sure your phone is discoverable and Bluetooth is on, then launch a terminal and run hcitool scan:

$ hcitool scan
Scanning ...
	00:11:22:33:44:55	w950i

Find your phone’s name on the right: in this case, 00:11:22:33:44:55 is the device ID. Now edit /etc/blurcd.conf and follow the instructions there.

Usage

Note that the first time you start BluRC, it will search for your phone and try to upload the client to you using obexftp. After this, it records your device ID in the seen devices list (found in /etc/blurcd/blurc.devices). If you reformat your phone and need to recover the applet, simply remove your ID from this file and restart blurcd.

  1. Start the BluRC daemon by issuing the command sudo /etc/init.d/blurcd start.
  2. Find the PDF you want to use for your presentation and open it using evince - obviously use presentation mode for this (F5).
  3. On your phone, find the BluRC application and open it.
  4. Find your computer in the list of clients, and connect to it.
  5. After a brief pause, a connection should be established and you should see a menu called evince. Inside this, there are two options: forwards and backwards.
  6. Use these menu items to go through your slides.
  7. When you’re finished, disconnect and (optionally) stop the BluRC daemon with sudo /etc/init.d/blurcd stop.

Issues

  • If the connection drops it takes a while to get reconnected. Sometimes the client can’t detect the server after a dropped connection.
  • You can only send commands every 0.75 seconds [see below for reasoning] so this is the fastest that you can go through slides.

Changes

As mentioned, this version of BluRC is modified with some custom patches which fix some reasonably fundamental issues, since the code hasn’t been touched for a couple of years:

  • Added a configuration option so that blurcd will only distribute the MIDlet to one device ID [i.e. only your phone, and not everybody else in the room with a Bluetooth enabled phone - not good in a presentation environment].
  • Fixed a typecasting error which prevents compilation with gcc 4.0+.
  • Patched the Makefile so that make install actually works.
  • Fixed init.d script to work with Ubuntu [originally Gentoo-specific].
  • Fixed issue where MIDlet would send a command twice, causing a slide to be skipped over.
    [This is a very dirty hack in the server code - I'm not too hot with Java and didn't have the time to go through the code properly. Note that you can only send commands at 0.75 second intervals now, any faster and it'll be ignored. May be fixed in future]

Originally, BluRC tried to send the MIDlet to any phones which it could identify as being ‘compatible’. I don’t think this is necessarily a good idea - the last thing you need in a presentation is a load of people with Bluetooth phones being sent a file by your laptop that could disrupt the presentation.