Here is another success story. Before buying
some suitable hardware
I wanted to try OpenCPN
under LinuxDeploy on existing hardware
first. I have an old Advent Vega compatible tablet running the VegaBean ROM (Android 4.1). I feel fairly comfortable with Linux and have a desktop
computer running Linux Mint at home. Essentially I followed armido's instructions “Building on Motorola Xoom“ at opencpn.org. Since I had to partition my sdcard anyhow (my ROM needs a fat32 and an ext4 partition) I just made a third 8 GB large ext4 partition for LinuxDeploy using gparted. In Android Terminal Emulator I found that that partition was /dev/block/mmcblk0p3 (su ; mount ; ls -l /dev/block). So I told LinuxDeploy to do a partition install giving it that name and to use an ext4 file system. I installed Ubuntu Precise because I feel more comfortable with it than with Debian. All went well. After LinuxDeploy was started I could connect from my desktop
computer to the tablet via ssh (Windows users may use Putty). So I could comfortably copy paste armido's instructions to build OpenCPN. Dependencies and commands are identical for Ubuntu Precise. OpenCPN is running.
What about charts? Since I had chosen a partition to install which my Linux desktop computer could read/write I could insert the sdcard into the desktop and copy the charts over.
Next step GPS
: My tablet does not have GPS
but I have a cheap
bluetooth GPS dongle which transmits NMEA
. First I tried sevanopula's method in post 163 of this thread. I somehow failed. Then I tried to follow OpenCPN's official instructions Setting Up GPS | Official OpenCPN Homepage
, Ubuntu 12.04. Since information of external Bluetooth GPS
is a bit sparse in this thread and seems not to be tailored for our chrooted install I try to remember how I succeeded last night.
First I made sure that the GPS was not paired with Android, then
apt-get install bluez nano
That was all what I needed to install. nano is a command line text editor.
The mac address of my dongle is 00:1C:88:01:08:09
sdptool records 00:1C:88:01:08:09
Yes the channel number is 1. So I made the following file using nano
Registered that file for later usage:
rfcomm bind 0
“bind” is enough. It generates a device node, in my case /dev/rfcomm0. The connection to the dongle will be established when one reads from that node. Try it
At least some NMEA
sentences should become visible in the terminal, stop it
The /dev/rfcomm0 had still wrong permissions, only root had access. Apparently the chrooted Linux does not obey udev rules. My user which runs OpenCPN is android and in the group android. That is the default for a LinuxDeploy installation
. He has to be allowed to read the NMEA data. I wanted to setup everything when Linux is started. So I made the next file using nano:
/usr/bin/rfcomm bind 0
/bin/chgrp android /dev/rfcomm0
/bin/chmod g+rw /dev/rfcomm0
Made that file executable:
chmod a+x /etc/init.d/myscript
I told LinuxDeploy to run that script during startup by tagging “Custom startup”. In OpenCPN > Options > Connections > Add Connection, scroll down > DataPort I entered /dev/rfcomm0 and pressed apply. And there they were, green NMEA sentences in the debug window and three green bars in the top right corner.
Linux bluetooth seems to change constantly and one never knows which instructions are up to date for which distribution. This was for Ubuntu Precise (12.04), Debian Wheezy may be similar.