If you have been using the iPad app ‘iSailor‘ for navigation (as I have), you may have seen the option to unlock NMEA positioning support. NMEA-0183 is a standard protocol used to communication marine information such as depth, speed, position etc. Most off the shelf GPS modules use this protocol as well. So I investigated how I could get my non-GPS enabled iPad (ie. non-cellular) receiving GPS data from another source.
To get GPS data into iSailor you could buy something like the Bad Elf GPS Receiver for $100, OR you could use a Raspberry Pi and your boat’s exisiting NMEA capable GPS, or a simple USB GPS dongle.
The method I used as a proof of concept used the following:
- Raspberry Pi model B (or the newer Model B+!).
- GPS Module, I had this spare. It works on 3.3V so it can be connected directly to the Pi. (You could also use a USB GPS, see the kplex tutorial).
- Edimax Wi-Fi Adapter works great with the Raspberry Pi!
- An SD Card greater than 4 GB.
- kplex software, available for free. See the kplex site for information on it’s use and configuration.
Here are a quick run down of the steps I took. I assume a basic level of UNIX familiarity.
- Download the Raspbian image. Write the image to the SD card.
- Plug in the Raspberry Pi, and follow the configuration screens. I use the command line for the following steps.
- Get the Pi connected to your WiFi network.
- Download kplex using “wget http://www.stripydog.com/download/kplex_1.1-1_armhf.deb”
- Install kplex: “dpkg -i ./kplex_1.1-1_armhf.deb”
- Allow use of the Pi’s serial port. Edit “/boot/cmdline.txt” and remove reference to ‘ttyAMA0’. Also edit “/etc/inittab” and remove line containing ‘ttyAMA0’. Reboot.
- Physically connect the GPS module to the Raspberry Pi. The minimum connections (in red) are power, ground and GPS Tx to Pi’s RX. Be sure your GPS module is 3.3V!
- Create the kplex configuration file: “/etc/kplex.conf” (see my example file below).
- Test you are revcieving data from the GPS using “sudo kplex file:direction=out”. The NMEA sentences should be spat out in the standard output. If not, try check the baud rate. Also try a reboot.
- Run kplex with “sudo kplex”.
- Purchase the NMEA GPS option in iSailor.
- Setup the connection from iSailor to the Raspberry Pi. Use settings that match the kplex configuration (TCP:10110).
- Hopefully now iSailor will show everything connected!
Here is the kplex config file I used (make sure you check the baud rate!):
[serial] direction=in filename=/dev/ttyAMA0 baud=57600 [tcp] mode=server port=10110 direction=out
Credit must go to stripydog for writing the wonderful kplex software. I plan to develop this project more and put it to use on my boat, perhaps even try send AIS information to iSailor. Stay tuned and please leave a comment if you found this useful!