Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 16-09-2011, 08:18   #1
Registered User
 
sgschwend's Avatar

Join Date: Sep 2011
Location: Whidbey Island
Boat: Tollycraft 34' Tri-cabin
Posts: 56
Need Help Sending NEMA Code

I am building an autopilot. I am using Open CPN version 2.5.

I have not been active in coding for many years, so I am more than a bit rusty. I have setup some PC based tools to check out how things work.

My PC OS is vista, I have a serial port monitor and a virtual serial port kit.

Thus far I can connect any two serial ports together and monitor the second port. I have assigned one of these to the auto pilot port. When I activate a track the monitor show a constant stream of RMB.

The monitor can also write to serial port. When I send any one of the documented NEMA commands I get noting.

What else do I need to do to send a command to Open CPN?

Thanks for the help.

Steve
sgschwend is offline   Reply With Quote
Old 16-09-2011, 14:56   #2
Registered User

Join Date: Jul 2011
Posts: 104
Re: Need Help Sending NEMA Code

sorry, I dont understand, you mean you get nothing "where"? you are trying to send nmea to an autopilot but then you say "What else do I need to do to send a command to Open CPN?" so it is not clear in what direction you need to send data, can you clarify? regards. alex
alex2035 is offline   Reply With Quote
Old 16-09-2011, 15:48   #3
Registered User
 
sgschwend's Avatar

Join Date: Sep 2011
Location: Whidbey Island
Boat: Tollycraft 34' Tri-cabin
Posts: 56
Re: Need Help Sending NEMA Code

You can see I am a bit confused. In reading the User Manual I found, "OpenCPN Recognized NMEA Sentences:", I assumed the manual meant recognizes NMEA sentences.

So I assumed I could query the OpenCPN application.

Certainly the Autopilot port outputs RMB data set when active.

I will keep looking at the manual but any help would greatly be appreciated.

Steve
sgschwend is offline   Reply With Quote
Old 16-09-2011, 19:20   #4
Registered User

Join Date: Jul 2011
Posts: 104
Re: Need Help Sending NEMA Code

Quote:
Originally Posted by sgschwend View Post
You can see I am a bit confused. In reading the User Manual I found, "OpenCPN Recognized NMEA Sentences:", I assumed the manual meant recognizes NMEA sentences.

So I assumed I could query the OpenCPN application.

Certainly the Autopilot port outputs RMB data set when active.

I will keep looking at the manual but any help would greatly be appreciated.

Steve
Again I am not sure I understand. What exactly are you trying to achieve?
OpenCPN obviously understands a lot of NMEA, it needs that for a GPS position and a lot of things more. It also outputs NMEA to guide an autopilot to an active waypoint.

Raymarine SPX Autopilots for example , receive RMB as well as other NMEA sentences, but it will not transmit RMB, it does output HDG and RSA (heading deviation and variation and rudder reference if one is fitted) regards. alex
alex2035 is offline   Reply With Quote
Old 16-09-2011, 19:59   #5
Registered User
 
sgschwend's Avatar

Join Date: Sep 2011
Location: Whidbey Island
Boat: Tollycraft 34' Tri-cabin
Posts: 56
Re: Need Help Sending NEMA Code

Quote:
Originally Posted by alex2035 View Post
It also outputs NMEA to guide an autopilot to an active waypoint.
Thanks for asking again:
I am trying to get OpenCPN to output NMEA to the autopilot port per the list in the User Manual. Thus far I have received RMB (but that data was sent to the port as a result of the route being activated).

I guess I assumed that the serial port was bidirectional. The auto pilot could send NMEA (NMC) for example and OpenCPN would output the current NMC data.

Thanks again

Steve
sgschwend is offline   Reply With Quote
Old 17-09-2011, 05:56   #6
Registered User

Join Date: Jul 2011
Posts: 104
Re: Need Help Sending NEMA Code

Yes, until you have an active waypoint/route there is nothing to send to the AP.
OpenCPN provides RMB sentence for autopilot, but you could send RMC as well if you modify the settings as per the manual:

[Settings]
AutoPilot NMEA Sentence Out=RMB;RMC
..........
Default is RMB only, and works for most autopilots.
Most users will not need this config entry.

Look here:Toolbox Settings | Official OpenCPN Homepage
-------------------------------------------------

You dont tell which autopilot, but Raymarine does not replicate that on the NMEA out. You would achieve this with an E85001 Raymarine NMEA box that converts data between nmea and seatalk bidirectionally. there are other hardware solutions, this is from Raymarine. regards.alex
alex2035 is offline   Reply With Quote
Old 17-09-2011, 08:44   #7
Registered User
 
sgschwend's Avatar

Join Date: Sep 2011
Location: Whidbey Island
Boat: Tollycraft 34' Tri-cabin
Posts: 56
Re: Need Help Sending NEMA Code

Thanks,
I have looked at the manual and see how to setup for RMC. It is too bad that port is not bidirectional.

About the Autopilot I am working on. I am making one for my boat, which is a converted fishing boat with hydraulic steering (6-7knts, full keel, heavy). The goal for this Autopilot is to minimize the small steering adjustments one makes while traveling.

I have purchased a bidirectional pump and will added a serial port pump driver and rudder angle card. The rest will be an application running along with OpenCPN.

Steve
sgschwend is offline   Reply With Quote
Old 17-09-2011, 13:16   #8
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,401
Re: Need Help Sending NEMA Code

Steve....

Following along here.

Bidirectional port....Not sure what info the A/P might have that OCPN could use....

What is NMEA NMC sentence? Cannot find a reference.

Am I missing something?

Thanks
Dave
bdbcat is offline   Reply With Quote
Old 17-09-2011, 14:22   #9
Registered User
 
sgschwend's Avatar

Join Date: Sep 2011
Location: Whidbey Island
Boat: Tollycraft 34' Tri-cabin
Posts: 56
Re: Need Help Sending NEMA Code

http://opencpn.org/drupal/nmea_sentences
here is the sentence from the manual

The current solutions the Autopilot receives RMB or RMC data from OpenCPN.

Another way to do this would be to send OpenCPN a request for RMB and OpenCPN would then reply with the current data set.

Here is why bidirectional data flow may be an improvement. Let say the Autopilot only needs the current Heading in True. A HDT request is sent and the OpenCPN sends that piece of data back.

The Autopilot application controls when and what data it receives and in some cases their should not need to be a route activated to obtain some of the data; an example might be a simple hold heading Autopilot.

The current solution OpenCPN "free runs" RMB data out to the defined Autopilot port unless a setting is made in the .ini file to switch to a "free run" RMC data set.

Steve
sgschwend is offline   Reply With Quote
Old 17-09-2011, 16:33   #10
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,401
Re: Need Help Sending NEMA Code

Steve....

What you want is not part of NMEA0183. There is no concept of "requesting" a sentence. There are "talkers" (e.g. OCPN) and "listeners" (e.g. your A/P).
Talkers talk continuously if enabled. Listeners listen, and ignore what they don't care about.

One could certainly design a query/response protocol, and could even use NMEA sentence structure to do it. But this is not NMEA0183.

If you need every possible NMEA sentence available to your A/P, I suggest using a virtual port multiplexer setup. Mux all talkers into one stream. Send it to the A/P. Ignore the messages you don't care about. Take advantage of OCPN's RMB/C if a route is active, or use system's idea of HDG, for example....

Good Luck
Dave
bdbcat is offline   Reply With Quote
Old 17-09-2011, 19:12   #11
Registered User
 
sgschwend's Avatar

Join Date: Sep 2011
Location: Whidbey Island
Boat: Tollycraft 34' Tri-cabin
Posts: 56
Re: Need Help Sending NEMA Code

Yep, got it. I could have answer my own question if I had read about the standard.

Thanks for the help.

I will likely take the easy approach and use RMB, but I did have a idea of a application that would only maintaining a heading; therefore not needing a route to activate.
sgschwend is offline   Reply With Quote
Old 18-09-2011, 08:52   #12
Registered User

Join Date: Feb 2010
Location: Solent, UK
Posts: 72
Re: Need Help Sending NEMA Code

sgschwend
I would be interested in your code to implement an autopilot should you be kind enough to publish it. I'm toying with the idea of using an Arduino card to take ocpn's A/P output and drive the windvane input on my ancient Autohelm. Since there will be no helm position feedback as you would normally have for a "proper"servo system I have to deduce the helm position in another way. I am also still considering the logic needed to use the NMEA XTE word to drive the Autohelm. Not a lot of progress so far but an interesting exercise for a retired broadcasting engineer with a sailing cruiser.
Tony
tonyappuk is offline   Reply With Quote
Old 18-09-2011, 22:13   #13
Registered User
 
sgschwend's Avatar

Join Date: Sep 2011
Location: Whidbey Island
Boat: Tollycraft 34' Tri-cabin
Posts: 56
Re: Need Help Sending NEMA Code

You would be welcome to it.
I am toying with the idea of having a rudder angle calibration that can be run at anytime. Real time rudder angle data would not be needed. I have an analog rudder angle meter now. So I could visually compare the two to make sure things are working correctly. Might be an easy way to get around real time feedback.
sgschwend is offline   Reply With Quote
Old 07-06-2012, 08:36   #14
Registered User

Join Date: Nov 2009
Location: Cyprus
Boat: Amel Super Maramu 2000 53'
Posts: 55
Re: Need Help Sending NEMA Code

Quote:
Originally Posted by alex2035 View Post
Again I am not sure I understand. What exactly are you trying to achieve?
OpenCPN obviously understands a lot of NMEA, it needs that for a GPS position and a lot of things more. It also outputs NMEA to guide an autopilot to an active waypoint.

Raymarine SPX Autopilots for example , receive RMB as well as other NMEA sentences, but it will not transmit RMB, it does output HDG and RSA (heading deviation and variation and rudder reference if one is fitted) regards. alex
Alex have you actually tried modifying the .ini file with this syntax:
AutoPilot NMEA Sentence Out=RMB;RMC ? I cannot get it to work, even if I remove the spaces like all of the other commands in the file. In fact when I run OpenCpn after editing the file, my alterations are removed prior to the next prog start. Has anyone had success with this? If so, what exactly did you type and where did you type it? I inserted the line after [Settings/NMEAAutoPilotPort] Ommitting the AutoPilot made no difference.

What I am trying to do is use the NMEA from my Commar AIS to drive my ST-7000+ autopilot. I have successfully done this via OPenCpn using a USB/RS232 converter connecting pins 3 & 5 to the ST-7000+ NMEA In (2) terminals. I also want to send the appropriate data to my DSC radio. By doing this I do not have to also power up my Furuno GP-80.

I see all data on the pilot display except SOG and COG, so I do need OpenCpn to send RMC sentences too. Why this is not the default I don't know? At the helm I want to see SOG and COG and not have to duck down to the Nav desk. If I use an autopilot out connection with Nobeltec or Maxsea then I do get ALL the data, so it is not a hardware problem.

I wonder if the syntax in the manual is correct? Any help would be much appreciated.

Ian (Biggles)
Biggles is offline   Reply With Quote
Old 07-06-2012, 08:50   #15
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,401
Re: Need Help Sending NEMA Code

Ian...

Are you using the new Version 3.0?

Also, do you have any way to monitor the NMEA output from OpenCPN? Maybe a terminal connected to the NMEA port?
It would be good to actually see the output from O in your setup.

Thanks
Dave
bdbcat is offline   Reply With Quote
Reply


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
For Sale: Code Flags denny Classifieds Archive 4 04-09-2011 11:09
Sending 'Go to Here' Active Route to an Autopilot Sail323 OpenCPN 11 01-08-2011 15:44
ABYC Power Feeder Code E-8.11.4.1 vs E-8.11.9.2.1 sdowney717 Electrical: Batteries, Generators & Solar 27 09-07-2011 09:47

Advertise Here


All times are GMT -7. The time now is 06:28.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.