Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

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 20-02-2011, 19:10   #1
Registered User

Join Date: Jan 2011
Posts: 670
How to Transmit to Autopilot on COM40 ?

I just installed a Standard Horizon GX2150 AIS/VHF receiver, in a really nice little setup that feeds AIS and GPS through two Bluetooth transceivers to a Netbook running OpenCPN under Windows XP. The Netbook's Bluetooth stack insists on mapping the Bluetooth connections to COM40 (at 38400 baud) and COM41 (at 4800 baud). Both signals are getting to the Netbook perfectly, and all the targets display nicely on OpenCPN. In both cases the needed COM ports did not display in the drop-down boxes, but I was able to type them in.

Next I would like to transmit the appropriate NMEA sentences from OpenCPN to my Autopilot by Bluetooth through COM41. Once again the COM port does not show up in the drop-down box, so I typed it in and clicked "OK". The dialog box closed with no error message. But when I reopen the dialog box, the Autopilot output still shows "None". It refuses to accept COM41 (or any other typed-in value) for the Autopilot field.

I have a serial port emulator, but so far as I can tell it only works for incoming values. I can map incoming sentences to COM5 (for instance), but that does not appear to work for sentences going out COM5.

I also tried manually editing the .ini file, but that setting did not "stick."

Is this problem a bug that needs to be fixed, or is there some reason that OpenCPN limits the COM ports that it will transmit (but doesn't limit the incoming ports)?

FWIW, I am working with the manfacturer of my Bluetooth transmitters on re-mapping the COM ports to a range that OpenCPN will accept, but there are some software issues that are making that difficult.
RhythmDoctor is offline   Reply With Quote
Old 21-02-2011, 05:41   #2
Registered User

Join Date: Jun 2009
Boat: Elan 37,Racing version
Posts: 42
Re: How to Transmit to Autopilot on COM40 ?

Good morning,
I would be surprised if your Netbook can handle (on its internal -? is it - BT radio that you name if I did understand correctly BT stack...) 2 port com communicating at different bds rate at the same time.
This might be the first step to check.
Best regards.
ON3CHD
ON3CHD is offline   Reply With Quote
Old 21-02-2011, 06:02   #3
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: How to Transmit to Autopilot on COM40 ?

When I understand correctly you have two Bluetooth devices sending data to your Netbook via COM40 and COM41? (Obviously you use the Toshiba Bluetooth stack which has comport numbers in the 40th range by default).

Now you want to send data from the Netbook to your autopilot?
Which way you want to send the data to the autopilot? What is the autopilot connection you have? If the autopilot has only a serial input and your Netbook has no serial connector I guess you will need another RS232/Bluetooth Transceiver. Right?

Gerhard
CarCode is offline   Reply With Quote
Old 21-02-2011, 06:29   #4
Registered User

Join Date: Jan 2011
Posts: 670
Re: How to Transmit to Autopilot on COM40 ?

Quote:
Originally Posted by ON3CHD View Post
Good morning,
I would be surprised if your Netbook can handle (on its internal -? is it - BT radio that you name if I did understand correctly BT stack...) 2 port com communicating at different bds rate at the same time.
This might be the first step to check.
That part works fine. Bluetooth allows you to connect up to 7 devices simultaneously. I'm getting GPS coordinates in at 4800 baud on COM41, and AIS targets in at 38400 baud on COM40. For more information see the stuff I pasted below.
Quote:
Originally Posted by CarCode View Post
When I understand correctly you have two Bluetooth devices sending data to your Netbook via COM40 and COM41? (Obviously you use the Toshiba Bluetooth stack which has comport numbers in the 40th range by default).

Now you want to send data from the Netbook to your autopilot?
Which way you want to send the data to the autopilot? What is the autopilot connection you have? If the autopilot has only a serial input and your Netbook has no serial connector I guess you will need another RS232/Bluetooth Transceiver. Right?
Gerhard
Autopilot is NMEA 0183 @ 4800 baud. Each Bluetooth dongle is full duplex, and GPS and AIS are inbound (to OpenCPN) only. I can send data out on COM40 at 38400, or COM41 at 4800. In fact, I have already tested this using terminal emulation software by sending commands to my GPS. Sending chartplotter sentences out to the autopilot is very strightforward using OpenCPN, but I need to use COM41 to make it happen.

Since you both seem to want more information, here is a complete description that I posted on another forum (perhaps more than you want to know):

Over the weekend I finished installing my newly arrived Standard Horizon GX2150 VHF/DSC/AIS radio. Because of the large amount of commercial traffic where I sail, I was very interested in getting the AIS output integrated on a chartplotter display. I had originally purchased a Garmin 640 for this, but decided I could actually do better for much less cost with a PC-based system. My MSI Wind netbook has an extremely bright display that is viewable in full daylight, so I bought a RAM Mount to put it on my pedestal guard. OpenCPN's features and stability have improved greatly in the past several months, and it uses NOAA raster and vector charts which can be downloaded for free. OpenCPN also supports AIS input and autopilot output. I wanted complete freedom to put the netbook in the cockpit or move it into the cabin, so I made everything transmit wirelessly to/from the netbook via Bluetooth.

In order to make for a tidy installation (and to allow me to wire everything up in the comfort of my home), I picked up a small surface-mount network box to serve as the central interface module for the system. I daisy-chained some RJ45 receptacles to make an 8-wire bus, and terminated all the instrument wires with crimp-on RJ45 connectors. I also mounted a couple of DB9 ports in the box to attach the Bluetooth transmitters without any cumbersome cables. The whole thing runs off a 5v supply from a USB power adapter, and draws under 270 mA @ 5v. Here's the schematic and wiring plan:


The admiral thought the flashing lights on the interface module were "real purty". [] It kind of reminds me of a miniature model of the International Space Station [] :




After crimping the RJ45 plugs onto the various components, I took it all down to the boat, hooked it up and fired up OpenCPN on the Netbook. After configuring all the COM ports it worked perfectly, receiving all the data wirelessly through Bluetooth. Here are some screen shots showing my boat on the hard at West End Boat Club. With a temporary antenna (since my mast is down) I was able to pick up over 20 AIS targets in my vicinity, pull up preliminary info by mouse-over and detailed info by right-clicking on a target. Many of the boats were anchored. Those that were moving showed a vector that represented their estimated location in 5 minutes (user adjustable). The yellow boat(s) are ones the meet some user-adjustable criterion for collision threat. (Still need to get familiar with the particulars.) When my boat is underway it will estimate distance and time of closest point of approach:






In addition to achieving a new height in geek factor, this will be a very useful safety feature in staying out of the way of shipping traffic in our busy river.
RhythmDoctor is offline   Reply With Quote
Old 21-02-2011, 13:05   #5
Registered User

Join Date: Jun 2009
Boat: Elan 37,Racing version
Posts: 42
Re: How to Transmit to Autopilot on COM40 ?

Hi,
I probably won·t be able to help much further as when I try to connect my PC with only one BT radio (dongle - as the BT function is not integrated to my laptop)
to 2 different BT transponders working also at 2 different speed (for the same reason as you) on 2 different port com Windows (xp pro) tells me via hyperterminal
that it can·t open the second com port as it is already in use.
To go around this problem I have a second BT radio dongle (a few euros) and it works fine.
Now my setup is a little bit different than yours as I use a MUX to send BT one combined flow of data (coming in at different speed from 3
different talkers connected to 3 separate channels) to my laptop at 38400 bds. Open CPN (OC - which I am just testing since a week as my main navigation software is the racing version of Seapro 3000) can well display the info received even if very slowly and incomplete and/or wrong on the AIS side having setup the com port possibilities (3 if I don·t mistaken myself) of OC on the same com port used by the BT transponder connected to the MUX for data transmission at 38400 bds.
On the other hand, up to now, the RS422 connector on the MUX (that is transforming the data it receives from the PC/Navigation software to ouput them at 4800 bds for amongst others an Autopilot connection) could only read the GPS data which in my case ( not entering into the details of the MUX time out settings) means that OC doesn·t send any data even having a road activated.
Conclusion:I am not able yet with OC to steer my boat using my autpilot and for ... sure not able to use its wind vane mode.
Good luck and let us continue to share experince.
ON3CHD
ON3CHD is offline   Reply With Quote
Old 06-03-2011, 16:42   #6
Registered User

Join Date: Jan 2011
Posts: 670
Re: How to Transmit to Autopilot on COM40 ?

I am still looking for help on this issue. Since my original post, I have poked around the source code a bit, specifically the nmea.cpp file. I can see that for both GPS (NMEA) and AIS inputs there were specific sections of code that are marked as "Required for access to Serial Ports greater than COM9." But that code is not present in the section where the Autopilot output is initialized.

Is it possible to modify the code to allow Autopilot output to access the same COM port as GPS/NMEA input? I would think that this might be a commonly requested feature, since RS232 ports (even ones that are just emulated by USB or Bluetooth adaptors) are full duplex.
RhythmDoctor is offline   Reply With Quote
Old 07-03-2011, 12:42   #7
Registered User

Join Date: Jun 2009
Boat: Elan 37,Racing version
Posts: 42
Re: How to Transmit to Autopilot on COM40 ?

Hi,
have made a point of this in the TO DO list of the CPN developpers as i do face the same problem (even on port 5) but no answer yet...
Cheers,
ON3CHD is offline   Reply With Quote
Old 08-03-2011, 12:19   #8
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,404
Re: How to Transmit to Autopilot on COM40 ?

RythmDoctor....

Yet another undocumented "feature"

To access COM ports greater than COM32, add the following line to the opencpn.ini file

[Settings]
WindowsComPortMax=42

The default is 32. Why do we do this? Windows algorithm for discovery of available COM ports is very slow legacy code, and MS has never provided any improved API for simply getting an array of COM ports. So, we have to search tediously.... We run this code often to catch PlugAndPlay events, so performance is important.

Anyway, I hope this works for you. Let me know how it goes...

Dave
bdbcat is offline   Reply With Quote
Old 08-03-2011, 12:22   #9
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,404
Re: How to Transmit to Autopilot on COM40 ?

ON3CHD....

We presently support autopilot output on the primary GPS input port, of course at the same baud rate. This is my everyday setup onboard, and it works fine under linux. I have not tested under Windows in real life.

Does it not work for you? Any other amplifying information would be useful. Anything unusual in the logfiles about ports?

Thanks
Dave
bdbcat is offline   Reply With Quote
Old 09-03-2011, 06:54   #10
Registered User

Join Date: Jun 2009
Boat: Elan 37,Racing version
Posts: 42
Re: How to Transmit to Autopilot on COM40 ?

Quote:
Originally Posted by bdbcat View Post
ON3CHD....

We presently support autopilot output on the primary GPS input port, of course at the same baud rate. This is my everyday setup onboard, and it works fine under linux. I have not tested under Windows in real life.

Does it not work for you? Any other amplifying information would be useful. Anything unusual in the logfiles about ports?

Thanks
Dave
Hi Dave,
Thanks fyr.
I am using Brookhouse Mux which is sending all info via a BT transponder to my PC at 38400 bds as AIS is one of the 3 talkers.
Port Com for BT transponder In and Out is 5.
Have used/choosen this number 5 as Port Com for AIS, GPS and Pilot in Open CPN.
Have then created and activated one road for test.
Open CPN receive AIS and GPS data.(even if not as I would like yet but...).
To answer your question NO Open CPN does not send back the road info to the MUX.
In other words the Autopilot doesn·t receive the road info Open CPN should have sent back to steer the boat.
Have not checked logfiles and will do on an other occasion.

As I have said I was only testing Open CPN and as my cruising season has started I have uninstalled any software under trial I had on my PC in order to make sure I won·t have conflict with my usual navigation/racing software.

As you have taken the time to kindly answer my question I just want to know when I will try again if I am correct in assuming that:
- road info like XTE, DTW,BTW ...
- gps info like COG, SOG...
should be received by Autopilot from Open CPN?

While you read this I would also aprreciate if you could tell me how is Open CPN dealing with the Wind (force and direction true and apparent )and Depth and SOW it also receive from the MUX ? Any way it can also be sent back by OPen CPN to the Autopilot for Wind Steering which is the option I used the most when single handed?
Thanks in advance.
Cheers.
ON3CHD
ON3CHD is offline   Reply With Quote
Old 09-03-2011, 18:05   #11
Registered User

Join Date: Jan 2011
Posts: 670
Re: How to Transmit to Autopilot on COM40 ?

Quote:
Originally Posted by ON3CHD View Post
Hi Dave,
To answer your question NO Open CPN does not send back the road info to the MUX.
In other words the Autopilot doesn·t receive the road info Open CPN should have sent back to steer the boat.
Have not checked logfiles and will do on an other occasion...
Does OpenCPN keep log files of NMEA communications? Where?

I went to the boat this evening for a quick test. It does appear that the Autopilot is not getting the NMEA sentences. OpenCPN is receiving AIS@38400 on COM40 and GPS@4800 on COM41. It's set to send to Autopilot on COM41 but not working. I need to go back and hardwire the connection to determine whether it's a Bluetooth problem or an OpenCPN problem.

ON3CHD - Does your Autopilot accept NMEA @ 38400? Mine only takes 4800, and from your description it sounds like you might be sending to the Autopilot at 38400.
RhythmDoctor is offline   Reply With Quote
Old 08-03-2011, 13:24   #12
Registered User

Join Date: Jan 2011
Posts: 670
Re: How to Transmit to Autopilot on COM40 ?

Quote:
Originally Posted by bdbcat View Post
RythmDoctor....

Yet another undocumented "feature"

To access COM ports greater than COM32, add the following line to the opencpn.ini file

[Settings]
WindowsComPortMax=42

The default is 32. Why do we do this? Windows algorithm for discovery of available COM ports is very slow legacy code, and MS has never provided any improved API for simply getting an array of COM ports. So, we have to search tediously.... We run this code often to catch PlugAndPlay events, so performance is important.

Anyway, I hope this works for you. Let me know how it goes...

Dave
Thanks for the tip, but unfortunately it does not work.

I closed OpenCPN, edited the .ini file, and launched again. However, the AutoPilot setting will still not maintain any COM port that is manually typed in. This problem is not unique to COM41. If the dropdown list shows COM1-COM7 and I type in COM8, it will not accept it. (By "accept", I mean that when I click OK to exit the dialog then reopen the dialog, the entry still says "None".) So the problem even exists within the default range of 32 - it seems to happen the anything that is outside the options shown in the pulldown menu.

Any other suggestions?
RhythmDoctor is offline   Reply With Quote
Old 08-03-2011, 15:30   #13
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,404
Re: How to Transmit to Autopilot on COM40 ?

RythmDoctor....

Does COM40/41 show up in DeviceManager before OCPN is started?

Dave
bdbcat is offline   Reply With Quote
Old 08-03-2011, 20:15   #14
Registered User

Join Date: Jan 2011
Posts: 670
Re: How to Transmit to Autopilot on COM40 ?

Quote:
Originally Posted by bdbcat View Post
RythmDoctor....

Does COM40/41 show up in DeviceManager before OCPN is started?

Dave
Oops, I take back what I said (and I would edit my prior message if the forum would allow edits a few hours afterwards ). I got home and tried your suggestion on a different computer (the actual computer that I will use as my portable chartplotter), and it worked! The COM41 port showed up on the drop-down list (along with ~10 other ports created by my Toshiba Bluetooth Stack), so I was able to select it without manually typing it in.

This is terrific! Thanks for the tip!

I will have to take the computer down to the boat in order to actually test it with the autopilot, but for right now it appears that I am able to communicate bidirectionally with my Bluetooth dongles.
RhythmDoctor is offline   Reply With Quote
Old 15-03-2011, 10:43   #15
֍֎֍֎֍֎֍֎֍֎

Join Date: Apr 2006
Posts: 15,136
Re: How to Transmit to Autopilot on COM40 ?

Quote:
Originally Posted by bdbcat View Post
Windows algorithm for discovery of available COM ports is very slow legacy code, and MS has never provided any improved API for simply getting an array of COM ports.
That's surprising. Windows3.x and Windows9.x have their own limits, but all the versions of NT since...NT4 I think? have supported 255 COM ports, and all the NT OSes (which include 2000, XP, Vista and Win7) are very quick to use additional COM ports.

If it goes beyond COM8 (the old MS-DOS limit)...the code should support all 255 of them these days.
hellosailor is offline   Reply With Quote
Reply

Tags
autopilot


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
Autopilot bill brown Construction, Maintenance & Refit 26 24-09-2017 09:00
Autopilot danamatic OpenCPN 23 04-09-2010 06:18
Command Mic Transmit Audio newbie123 Marine Electronics 13 03-08-2010 09:49
VHF Radio Transmit Issue claddaghcan Marine Electronics 4 23-04-2010 10:46
Autopilot irwinsailor Seamanship & Boat Handling 11 21-05-2003 02:05

Advertise Here


All times are GMT -7. The time now is 22:54.


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.