Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 18-08-2018, 04:50   #1
Registered User

Join Date: Jul 2018
Posts: 11
Solved - How to hook up a NASA Clipper GPS repeater to opencpn

NASA GPS Clipper

is a broad and unique product to show current Speed over Ground (SOG), true bearing, distance to waypoint and bearing to waypoint in the cockpit. It does not use much power, is readable also at sunshine(what most colorful displays of PCs don’t) and it provides the most important information where to steer and distance to waypoint. However to set it up is very tricky and many threads in the various blogs tell of desperate user, who failed.
I stumbled into the same. I wanted to use opencpn as a tool to provide me the required information as course to steer, distance to waypoint and current speed at the GPS repeater. Because the GPS repeater was already there and the PC display is in sun not readable and needs a lot of protection against water. My plan is to pack the PC safely under deck also for lousy rains or very windy weather and wire it to the GPS repeater.
After many trials I found out it to be working. Several times I was ready to replace my repeater with another brand, but the NASA clipper GPS repeater is unique and I found no other one. In the end I solved the problem, but it requires
  • Proper setting at the opencpn program (connection properties, filter of sentences and proper set flags
  • Hardware like an Arduino or Rhasperry as a postprocessor converting the data received from opencpn program into correct data(because opencpn has many flaws concerning the NMEA output). Just taking an USB-RS232 converter won’t help.
  • Hardware to convert that signal into RS232 code
  • Hardware (Load resistor) to set up proper RS232 communication between postprocessor and GPS repeater
GPS repeater - connection properties
The NASA GPS repeater is a nice tool. It has 1 cable containing 2 wires and the shielding with:
- red: +12 V
- blue: NMEA input
- Shielding: Ground to overall power supply

Having only 1 NMEA cable means: It can only receive and the NMEA protocol is RS232. NMEA units with 2 cables for receiving have one for + and one for -. !! The minus is NOT Ground, it is - . If you connect it to Ground, you have solved your problem by sending your NMEA devices to the eternal stars, aka killed it. The +/- means more important for us that this unit is requesting the signals in RS485 or RS422 (is the same) format. It has not only different voltages than RS232, also the flanks between 0 and 1 produce a different signal. So when you hook up a RS232 NMEA receiver to a RS485 sender, you’ll get nonsense on your display (what I did).
Summary we need the signal as RS232, what meant that I cannot use my NMEA multiplexer Shipmodul lite, delivering RS422 signals.
If you have a NMEA with adjustabler outputor, set it to RS232. However unless the opencpn programmers have not corrected the flaws described here, it won’t help you either. The hand shake between multiplexer and opencpn does not work. The Multiplexer has to process a lot of data. When it receives data from the PC and the reading-buffer is full, it sends a signal to the PC asking to stop sending further data, until the reading buffer of the Multiplexer is empty and it could receive more data form the PC. Although many Multiplexers can do that, opencpn does not listen nor react. Opencpn in the current version does not care about any buffer and keeps on sending. As a result the multiplexer can not take up all the data sent, leading to corrupt the data in the buffer and garbage sent to the GPS repeater. Who in the end refuses to show anything and display („No GPS SOG“).

The first step at the programmers of opencpn would be to update the handshake (hardware Flow Control) It would be important to do, because it applies not only to GPS repeaters, but to every NMEA receiver (Autopilot etc.)
With the road from opencpn via NMEA multiplexer to GPS repeater closed, I went to direct access i.e. USB from PC out to RS232 to GPS. Bought a standard USB to RS232 adapter, installed it, set up proper settings at opencpn - no result. GPS repeater laughing at me („No GPS signal and No GPS SOG“). Now I dwelled deeper.

Postprocessor (Arduino) to PC connection
I used an Arduino (can be also a Rhasperry or anything else. the only reason, I am accustomed to Arduino) and connected it to the computer’s USB and read out all the signals the PC which opencpn was sending. The Arduino board comes with an USB interface and does all the handshake and reading buffer things, so I had not anymore to fiddle with the tricky reading buffers.
First I had to set the proper communication settings:
At PC: serial communication port of the Arduino at 4 800 ( set at hardware properties of my windows, to be absolutely sure) Yes, 4 800 and not 9 600. With 9 600 the data shown at my PC terminal gets crazy.
At opencpn: set connection for Arduino in the menu to the serial communication port of my Arduino at 4800 baud, enable „writing“ of data, enable checksum calculation, disable Garmin (GRMN) for input, set talker ID to GP.
And of course the settings at the Arduino program for the serial ports also at 4 800.
Do not forget to connect a GPS device to deliver GPS data. Else it won’t work either - nothing out from GPS - nothing in at GPS repeater.
Now after having connected my terminal program showed plenty of NMEA phrases - too many.
And opencpn been veeeeeeeeeeeeeeery slow now.
The GPS repeater expects 3 sentences and nothing more
  • GSA for the fix of the satellites
  • RMC for the SOG and bearing
  • RMB for the waypoint distance, name, and track
in a very specific form
I filtered the output to be sent at opencpn to the Arduino to RMB, RMC and GSA. GSA does not exist in the menu of opencpn drop down filter, but you can add it manually. For me it is completely unclear, why the programmers have omitted that important sentence.
Having applied this filter the terminal showed now mainly
  • GNGSA and
  • GNRMC and
  • GPRMC
Once a waypoint was activated, GNRMB was also shown. And the GPS repeater still laughing („No GPS signal and No GPS SOG“)

Software - Postprocessing data from opencpn into readable GPS repeater data
Now I had to correct the data having got from opencpn into proper data for the GPS clipper. I did not parse and put it back again. The issue is not to slow down the reading at the Arduino, else it may be overloaded to listen to new data coming in. So I had to make sure to process all changes very quickly.

1) Reading loops
Reading of the data at USB: The data transfer from the PC to Arduino via the USB is asynchronous, meaning if there is data, the Arduino reads it, if not, it stays calm. This means that the Arduino needs to wait until it has received the end of the line of the NMEA phrase sent or to stop its loop, once a certain timeout has been reached. All buffers must be reset afdter a successful reading, else short phrases received will be amended by the old stuff from longer sentences. The famous “while (Serial.available()) “ loop does not work properly. Very often pauses in the serial reading buffer appear making an incomplete NMEA string in that loop. So the Arduino has to wait again for next signals coming in at the reading buffer to complete the NMEA string. In the end the Arduino compiles a full senseful NMEA phrase after several reading loops.

2) NMEA Sender ID
The ID should be $GP and not $GN. The GPS device sends GN and the opencpn transfers that through as GN. The GPS clipper in the moment does not care, how the pre-ID is (GN or GP or), but you never know for future releases of NMEA and hardware. So put it right and you won’t get into pronlemas later. First step to convert all GNGSA into GPGSA. Same for RMC and RMB

3) Different baudrates of connected units
My GPS receiver (Kendau) sends with a baudrate of 9600 from its serial interface to the PC and opencpn. The connection at opencpn is set to 9600. Since the NMEA output of opencpn to the Arduino is at half speed (=4800), we get 2 GSA phrases with completely different content. One with many satellites and one with nearly nothing. This causes hick-ups at the GPS repeater, which switches always between the 2 contents. So the Arduino has to delete these GSA phrases, which do not contain at least 2 satellites or send only the good ones over to the GPS repeater.


4) RMC phrase correction
There are 2 RMC phrases having different content:
One with GNRMC and one with GPRMC. This is a an error at opencpn and to me unclear why happening. The 2different RMCs yield a flickering at the GPS clipper’s display, because track and SOG differ.
One is in new NMEA 0183 format with the time ending format in “.000”. The other one is elder with the time still formatted as 6 letter value. The one with “.000” is the correct one, as I found out. Check the picture for the RMC phrase.

Now important: !!
Both RMC phrases lack the figure for magnetic variation and East or West. When the GPS, plotter or plotter programs don’t have it, they send a Null, meaning “,,,” in the string - three commas with nothing between them. But the GPS repeater needs them definitely. If not in the sentence sent to the clipper, the laughing continues („no GPS SOG“).
The figures for magnetic variation are achieved at the opencpn by activating the WMM plugin. Unfortunately this tool is running out at the end of 2019, then we need to enter the data manually. For owners in Europe not a big issue, but for those with significant figures as in the Caribbean the figure is a must. I entered a manual figure of 1.2 going to E, since my boat is in Holland. You need to enter something applying for your area.

5) Checksum of phrase sent
Unfortunately you cannot just replace the letters in the string containing GNGSA or add something in RMC, you need also to calculate the new CRC checksum. It is sent as 2 HEX digits after the * (star) to indicate the GPS repeater („hey, now the checksum comes”). The repeater itself checks the string from behind the „$“ till one before the „*“ with the checksum received. If equal, it processes the string, if not the data is discarded ( and „no GPS signal“)

6) Ending of NMEA phrase sent
The NMEA phrase sent to the GPS repeater must end with CRLN or „\r\n“ or 1310. This can be realized at the Arduino code with the various methods. No further „CRLN“ with nothing ahead of it shall be sent to the GPS clipper, else it hicks up.

7) Finally the Arduino sends out three NMEA phrases, which the GPS clipper repeater understands and can process:
  • GPGSA with „P“ instead of „N“ and at least 2 satellites caught and new CRC
  • GPRMC with „P“ instead of „N“ , magnetic variation, direction and proper CRC
  • GPRMB with „P“ instead of „N“ and proper CRC.
The other sentences like XTE, APL,WPL etc are ignored.

Hardware - Connecting the Arduino to GPS repeater
We can not use the standard pins at the Arduino for sending the data to the repeater. The USB interface at the Arduino is using the standard pins (RX - pin 0, TX pin1) to read the data from the PC. We can not use these pins hence the data would go back to the computer. We have to use another serial pin, what most Arduinos offer (not all). I used AltSoftSerial as serial setup library (do not use Softwareserial !) to allow for another serial port. Not every Arduino and every other pin can be used for AltSoftSerial, only dedicated pins. In my case pin 8 for RX and pin 9 for TX - for details and other boards check the board documentation of the library.

Finally I am able to send the corrected NMEA phrases through pin 9, but this is a TTL signal (between 0 and 5V), not a signal fulfilling the RS232 protocol needs for the GPS repeater. We connect a RS232 shifter to the pins (8,9), get the volts & ground from the Arduino.
I tried several shifters out and funnily not everyone works fine. Some corrupted the output.
How did I find out ? Because I hooked up a further Arduino with its own RS 232 shifter at the output of the first Arduino with its RS232 signal and read what the first one produced. This second Arduino only reads out and sends that to the terminal program at the PC. So I could check, what really goes out to the GPS repeater.

Now hooking up the Arduino to the GPS repeater:
- TX (send) wire from the RS232 shifter behind the Arduino to the blue wire of the GPS repeater
- Ground wire from the Arduino or RS232 shifter Ground to the shielding cable of the GPS repeater

Now we see at least some figures at the display, but still crumble in the jungle. We decipher funnily the NMEA sentences running through the display fields of the GPS repeater, but no data making any sense.

Now comes the secret of success:
RS 232 communication requires the sender to work at a load - what straight sending from the RS232 shifter does not. We have to wire a resistor between the TX cable of the RS232 shifter and its or Arduino’s ground to create that load. Which resiatance. Something between 1 and 10 kOhm. You need to check it out depending on your specific setup and eventual ore or less additional connected listeners. Once done, press the button for POSN at the GPS repeater, wait a little bit and you will shout out „Hurray“. The data is displayed in proper form.

Waypoint activation
We are not yet done. In my case out of a sudden the distance to waypoint and bearing to waypoint disappeared. One day it worked another day not. Although the opencpn display showed that information, it did not appear on my GPS clipper. Responsible for that information is the RMB phrase, which did not show up in the NMEA debugger window. I reset all connections, cleared the routes and did other senseless, non-logical pressing of buttons and flags at the opencpn. After some time it worked again. I have no clue why. I was even close to construct the RMB phrase out of other NMEA phrases ike APL, WPL, but found out, they weren’t sent either. So although having activated the waypoint and been shown on the opencpn’s display, the relevant phrases were not sent out as proper NMEA phrases. Seems to me to be a bug in the software. Additionally the update frequency of the RMB phrase is very low and need more updateing. RMC and GSA are sent 5 times per second, RM only all 5-10 seconds. Makes to me no sense. Less frequency for RMC, GSA and and higher frequency for RMB (2 seconds at least).

Connection of Arduino to other NMEA listeners
Of course the sentences sent by the Arduino may be listened also by other receivers like autopilot or VHF or whatelse. Since I do not know what exactly these devices require, I can not tell much. If they request RS485 you need to add also a RS485/422 shifter at the pins 8/9 of the Arduino. The program will send the same data either as RS232 and RS485 to the devices. Do not mix these signals in one wire !! You will get number crunch salad on all devices.
I do not know if the NMEA data sent from the opencpn is good enough to fulfill the demands of autopilot or whatever, because I have none. I converted 2 years ago the piller of my boat to a wheel with hydraulic steering and would be prepared to add eventual also a hydraulic autopilot. Although I’d be interested to test it out, I dread the costs for an additional oil pump. If somebody is willing to sell me a used and functional electric oilpump with 30 cm³/revision (= 1 fl oz/revision) and 12 V DC at a very reasonable price (<100 $ incl. shipping) , I would start checking that out.
kumado77 is offline   Reply With Quote
Old 18-08-2018, 07:48   #2
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 12,336
Re: Solved - How to hook up a NASA Clipper GPS repeater to opencpn

Very good writeup. Deserves it's own page in Sup Hardware verbatum. Could be edited down, but fine as it is. Thank you.
PS if you would like to edit this, pm me with your email.
rgleason is offline   Reply With Quote
Reply

Tags
asa, enc, gps, opencpn, Solved

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
opencpn3.2.2 to Nasa clipper GPS repeater PenguinPete OpenCPN 1 29-10-2013 08:28
Nasa clipper bm-1 southace Electrical: Batteries, Generators & Solar 7 26-06-2012 05:05
Sending WPT and Routes to Nasa Clipper Repeater Frankiez OpenCPN 5 20-09-2011 10:25
Nasa Clipper Instruments willemvrijhoeve Marine Electronics 3 17-12-2009 13:01
Nasa Clipper NMEA Pin Connector Info? Nimrod Marine Electronics 2 07-07-2009 04:29



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 19:13.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2019, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.