Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 20-02-2011, 20:10   #1
Registered User

Join Date: Jan 2011
Posts: 571
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, 06: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, 07:02   #3
Registered User

Join Date: Jul 2010
Location: Monastir, Tunisia
Boat: Amel Sharki
Posts: 1,777
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 online now   Reply With Quote
Old 21-02-2011, 07:29   #4
Registered User

Join Date: Jan 2011
Posts: 571
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, 14: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, 17:42   #6
Registered User

Join Date: Jan 2011
Posts: 571
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, 13: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, 13:19   #8
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,884
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, 13:22   #9
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,884
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 08-03-2011, 14:24   #10
Registered User

Join Date: Jan 2011
Posts: 571
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, 16:30   #11
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,884
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, 21:15   #12
Registered User

Join Date: Jan 2011
Posts: 571
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 09-03-2011, 06:44   #13
Registered User

Join Date: Jul 2010
Location: Monastir, Tunisia
Boat: Amel Sharki
Posts: 1,777
Re: How to Transmit to Autopilot on COM40 ?

RhythmDoctor,
sometimes the Toshiba Bluetooth stack gets stuck although the ports are still visible. I guess it is an interference with the Windows Bluetooth stack.
The only way for me to get it run again was to delete the Toshiba Bluetooth stack in software list and install it again.
You may use the Microsoft Bluetooth stack as well, but it will be hard to activate it once it has been deactivated by another Bluetooth stack.
The BluetoothDriverInstaller might help you, look here: Bluetooth Driver Installer - Get Bluetooth to work with the Microsoft Bluetooth stack

Gerhard
__________________
CarCode is online now   Reply With Quote
Old 09-03-2011, 07:28   #14
Registered User

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

Quote:
Originally Posted by CarCode View Post
RhythmDoctor,
sometimes the Toshiba Bluetooth stack gets stuck although the ports are still visible. I guess it is an interference with the Windows Bluetooth stack.
The only way for me to get it run again was to delete the Toshiba Bluetooth stack in software list and install it again.
You may use the Microsoft Bluetooth stack as well, but it will be hard to activate it once it has been deactivated by another Bluetooth stack.
The BluetoothDriverInstaller might help you, look here: Bluetooth Driver Installer - Get Bluetooth to work with the Microsoft Bluetooth stack

Gerhard
I hope this problem does not apply to me. My integrated Bluetooth hardware is not supposed to be supported by the Microsoft stack. My INF folder does not even contain the bth.inf file. So there should be no Microsoft stack active - just the Toshiba stack.

I have to hedge a bit on this because in the process of trying to get OpenCPN to work with Bluetooth, I did some things to try to force the Microsoft stack to activate. I basically did manual file copies and edits that were the equivalent of the automated procedure shown in your link. I did get my Bluetooth working under the Microsoft stack, but the capabilities of the Microsoft stack were far inferior and less reliable vs. the Toshiba stack (and OpenCPN autopilot COM port still did not work), so I undid my changes by deleting out the files and cleaning out the registry. I think I cleared out all the remnants of the Microsoft stack.

But thanks for the tip - I will definitely keep an eye out to see if the Tosh stack gets "stuck." The only problem I have seen so far is that I have to manually reconnect every time my computer goes into Suspend. Other than that, the Toshiba stack has been highly reliable. But my boat is on the hard for the winter, so I have not yet been able to test all this out in a real-world situation.
__________________
RhythmDoctor is offline   Reply With Quote
Old 09-03-2011, 07:54   #15
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
Reply

Tags
autopilot

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



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 02:15.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.