I have repeated my procedure of using bluetooth GPS
in a completely fresh install. This time I took care to understand what I was doing. The principle is very simple. I was using Linux tools in the chrooted environment to communicate with the bluetooth stack which had been started by Android. Up to Android 4.1.2 this is possible as both operating systems use the Bluez stack. Here are some instructions for Android <= 4.1.2 and a dongle which transmits NMEA data via bluetooth.
In Android pair the dongle and make sure you have no app running which uses its data.
In Linux install the bluez package:
apt-get install bluez<enter>
Find out the mac ADDRESS of your dongle. It has six hexadecimal numbers arranged like xx:xx:xx:xx:xx:xx .
that ADDRESS and use it to find out the channel NUMBER:
sdptool records ADDRESS<enter>
In the output look for a line starting with Channel followed by a NUMBER. Record
that. Now make a script, that is a text file, with the following contents supplying the recorded ADDRESS and NUMBER
/usr/bin/rfcomm bind 0 ADDRESS NUMBER
/bin/chgrp android /dev/rfcomm0
/bin/chmod g+rw /dev/rfcomm0
and store it as /etc/init.d/myscript . To make that text file from the command line type
cat > /etc/init.d/myscript<enter>
then paste/type above lines terminating each with<enter>. On the last, empty line press ctrl-d. Make that file executable:
chmod a+x /etc/init.d/myscript<enter>
Run the script:
Now everything should be set up to receive the NMEA data from the dongle. You can test that by typing
There should be some output which you can stop it by pressing ctrl-c .
Now in OpenCPN's settings, make a new serial
connection with /dev/rfcomm0 as DataPort. Press apply and NMEA sentences should appear in the debug window.
To run above script every time LinuxDeploy starts Linux tag “Custom startup” in the startup options.
Unfortunately I doubt that above instructions work with Android versions >= 4.2 as Google has switched to the Bluedroid stack.