This is a short howto that covers the installation of the Hamlet(TM) bluetooth gps device equipped with solar cells on Ubuntu 12.04 LTS. It is an extremely inexpensive device useful to non-professional users, easely found on webstores for about 20 Euros. Surprisingly, I did not find a similar guide in the web. So here is the guide.
To complete the configuration, you need to know how to couple a Bluetooth device, how to install packages, how to use the terminal, and how to edit a text file; your computer must have a built-in bluetooth device, or you can attach a bluetooth dongle to a USB port of your PC. Read the GPS device manual to understand the meaning of led signals and the usage of the button.
The first step consists in associating the GPS device with your computer.
Coupling the device
Coupling (aka associating) is done the usual way: start by pushing the button on the GPS device until the blue led starts flashing rapidly, next select the bluetooth symbol in the upper band on the PC screen, and add a new device. Select the pin 0000 in the "Pin options" menu in the device discovery window.
Setting up communication
The next step consists of discovering how to access the GPS device. First find the bluetooth address:
Annotate the number you read instead of 00:11:22:33:44:55, that corresponds to the GPS device address, and replace it in the following command:
# gksudo hcitool scan
You need to interrupt the command with a ctrl-C. The important info here is the channel number, which should be 1.
# sudo sdptool record 00:11:22:33:44:55
Service Name: SPP slave
Service RecHandle: 0x10000
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
Now edit the file /etc/bluetooth/rfcomm.conf adding the following lines:
In case you have another rfcomm0 defined, use rfcomm1.
comment "Hamlet GPS receiver";
Install GPS software
Now you need to install some software: in a terminal type:
and properly configure gpsd
#sudo apt-get install gpsd gpsd-clients marble
Reply to the dialog as follows:
#sudo dpkg-reconfigure gpsd
- Start gps automatically at boot
- Automatically connection to the device
- set /dev/rfcomm0 (or the rfcomm in the rfcomm.conf) as theGPS device
- no options
- leave the socket to its default value
Type and check:
This means that the connection with the GPS device is operational. Now place the GPS receiver close to a window and wait for the red led to blink slowly. Type:
# sudo rfcomm -a
rfcomm0: 00:11:22:33:44:55 channel 1 ...
The output after the command is a full screen showing longitude, latitude etc. Success!!!
When your PC is correctly configured, to use your GPS device you simply need to switch it on and place it in a suitable position. Start a GPS application on your pc (like marble) and configure it for reading the current position from gpsd.