iBlue 747 and other MTK GPS devices

by levien on vr 11 april 2008 // Posted in misc // under

Instructions on how to get an i-Blue 747 or similar bluetooth GPS-datalogger (based on an MTK chipset) to work on Ubuntu and on an Intel-based Mac using the Java-based BT747 control software. Interestingly, someone has even made a Japanese version of the MacOS X howto on his/her blog (むぁっく日記)!

On Ubuntu Linux

BT747 works perfectly on Ubuntu Feisty and Gutsy. I have the sun-java6-jre and librxtx-java packages and dependencies installed from the universe and multiverse repositories. The kernel automagically recognises the CP2102 usb-uart-bridge in the i-Blue747 and creates a device (e.g. /dev/ttyUSB0): usbcore: registered new interface driver cp2101 drivers/usb/serial/cp2101.c: Silicon Labs CP2101/CP2102 RS232 serial adaptor driver v0.07 Just download unzip the BT747 distribution file. I use the following script to start the program:

--------

#!/bin/sh

RXTXPATH=/usr/share/java 
RXTXLIBPATH=/usr/lib

export CLASSPATH 
CLASSPATH=${RXTXPATH}/RXTXcomm.jar:webstart/Waba_only.jar:dist/BT747_rxtx.jar:.:$CLASSPATH

java -Djava.library.path=${RXTXLIBPATH} -Dbt747_prefix="/dev/ttyUSB" waba.applet.Applet /w 300 /h 300 /scale 1 /bpp 8 BT747

--------

That’s all. :) Some optional stuff: If you want to install it system-wide, you can move the dist/ and webstart/ dirs somewhere to /usr/local/lib (e.g. /usr/local/lib/bt747 and /usr/local/lib/superwaba), and then put a script in /usr/local/bin with CLASSPATH changed to CLASSPATH=\${RXTXPATH}/RXTXcomm.jar:/usr/local/lib/superwaba/Waba_only.jar:/usr/local/lib/bt747/BT747_rxtx.jar:.:\$CLASSPATH If you have a modified GPS device that can do two-way communication over Bluetooth, you can use /dev/rfcomm instead of /dev/ttyUSB. Just make sure you create an entry for the device in /etc/bluetooth/rfcomm.conf, something like:

rfcomm0 { 
bind yes; 
device 00:0B:0D:89:14:1B; 
channel 1; 
comment "i-Blue747"; 
}

You can find the device address using “hcitool scan”. Its passkey is 0000, the system should ask for it but you can also configure it in /etc/bluetooth/hcid.conf. You will probably have to restart the hci daemon afterwards using “sudo /etc/init.d/bluetooth restart”. UPDATE: For some reason this stopped working for me when I upgraded to Ubuntu 8.04 (Hardy Heron). Apparently there’s a bug in the current hcid that prevents it from seeing any non-hci bluetooth devices (e.g. generic serial devices). To make things worse, also the Gnome bluetooth manager is horribly broken in Hardy. It is currently completely useless for connecting to devices. I managed to get my bluetooth GPS connection working again by removing the above code from /etc/bluetooth/rfcomm.conf, and installing the Blueman bluetooth-manager from their repository. Blueman will enable you to properly connect to the iBlue747 and bind it to a /dev/rfcomm serial device. You also may want to install the package gpsd, which makes the NMEA output from the GPS device available to other applications on a network socket (localhost:2947 by default). If you want it to be started automatically at boot-time, make sure that /etc/default/gpsd contains at least the following lines (modify the device names if needed):

START_DAEMON="true"
DEVICES="/dev/rfcomm0 /dev/ttyUSB0"

However, this may not be a good idea if you connect your GPS-logger after booting. It is better to start gpsd when the device is plugged in. For this, you need to edit the gpsd udev-scripts:

gksu gedit /etc/udev/gpsd.rules

Add the following lines at the bottom:

# Silicon Labs CP2102 USB to UART Bridge Controller (used in some MTK GPS-devices such as the iBlue747)
SUBSYSTEM=="tty", SYSFS{idVendor}=="10c4", SYSFS{idProduct}=="ea60", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"

And optionally:

# GPS through a bluetooth uplink (should probably not be used together with USB)
# Modify the device number below to match the rfcomm device assigned earlier
KERNEL=="rfcomm0", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"

Plug in your GPS device and launch xgps to see if it works. In theory it should, but I haven’t been able to get it to work yet. :-/ So I just start gpsd manually for now:

gpsd /dev/ttyUSB0

Now you can install Google Earth (from Medibuntu), qgis, gpsdrive, gpsbabel, gpscorrelate-gui or whatever packages you may need, and start having fun. ;-)

On Mac OS X

It took quite some trial-and-error to get BT747 to work on a Mac over USB. I used the CP2101 USB serial driver for MacOS X from this site: http://www.silabs.com/tgwWebApp/public/web_content/products/Microcontrollers/USB/en/mcu_vcp.htm Before it works, you need to create a lock-file directory, and make it world-writable. Open a shell, and type:

sudo mkdir /var/lock 
sudo chmod 777 /var/lock

I downloaded the BT747 distribution, and copied BT747_rxtx.jar to /Applications/gps, the RXTX lib and binaries for MacOS to /Applications/gps/rxtx, the superwaba stuff to /Applications/gps/webstart, and created a shell script to launch the program. My folder /Applications/gps now contains these files:

BT747_rxtx.jar 
bt747.command 
rxtx/librxtxSerial.jnilib 
rxtx/README 
rxtx/RXTXcomm.jar 
webstart/comm.jar 
webstart/RXTXcomm.jar 
webstart/Waba_only.jar

The script “bt747.command” can be created using TextEdit, and looks like this:

1
2
3
4
5
#!/bin/bash 
cd /Applications/gps 
CLASSPATH=rxtx/RXTXcomm.jar:webstart/Waba_only.jar:BT747_rxtx.jar:.:$CLASSPATH 
export CLASSPATH 
java -Djava.library.path=rxtx/ -Dbt747_port="/dev/cu.SLAB_USBtoUART" waba.applet.Applet /w 400 /h 400 /scale 1 /bpp 8 BT747

Double-clicking on bt747.command from Finder now starts BT747, and everything seems to work just fine! (with the usual download-quirks etc, but no worse than under Windows or Linux) Now you can install all kinds of nice applications like GPSBabel+, GPSPhotoLinker, GPS2GE, etc.

-Levien

References:
http://sourceforge.net/forum/message.php?msg_id=4528831
http://sourceforge.net/forum/message.php?msg_id=4571837
http://www.bioneural.net/2008/03/05/an-abc-of-geotagging-photos-on-the-mac/