The Navigatrix has been updated. The new website can be found at navigatrix.net.




Post new topic Reply to topic  [ 16 posts ] 
Author Message
 Post subject: … send autopilot commands from OpenCPN

Joined: 03 Feb 2014, 04:01
Posts: 16
Hi,

I'm quite new to linux, and having a bit of a hard time getting my head around how it deals with serial ports. I have 2 serial-usb ports going to the computer, one from the radio for AIS and the other from my seatalk converter which gives gps/instruments and is also wired to output to the autopilot.

Can someone explain how I can get OpenCPN to output to the autopilot? The magical GPSD seems to be processing the gps/instruments/ais data nicely and makes it all available to OpenCPN. If GPSD is using the port going to my sea talk converter for incoming data, will I be able to set OpenCPN to output to the same port? If not, how do I disable GPSD (or even open it or configure it) and find out what the com port addresses are so I can manually add them as inputs/outputs in OpenCPN?

Also, as an aside, I've been playing around with an iPad to try to remote desktop into my navigatix netbook. I've managed to use VNC viewer on the iPad to connect to a session on navigatix, but haven't managed to actually share the same desktop. Anyone able to give me a dummies guide to doing this?

Thanks in advance!
Dave


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 04 Nov 2010, 20:51
Posts: 1062
Quote:
will I be able to set OpenCPN to output to the same port?
No. It's not because of gpsd either. Unless something has radically changed, your autopilot can only listen to one talker. If you had a machine without gpsd and fed it with a talker into OCPN, OCPN would have to pump out the data through another hole...or you could split feed your data before it enters the machine and feed the autopilot without OCPN in the middle.

You do not want to disable gpsd. This is the multiplexer you have inside to send the same data to multiple locations within the 'system' or to one, or more, hardware connectors to the 'outside' world.

I don't know enough about SeaTalk, and autopilots to know is this is the tool best suited for the job. When we last re-fitted I gave it a 'pass' for philosophical reasons and thus ignorant of any technical aspects.

If you are happy with the data stream you are seeing and just want to feed to the autopilot your easiest option is to use OCPN as a repeater.

Steps 1 and 2 are easy. Step 3, in the example below, is for a traditional "serial"...D9 RS-232 that are getting harder to find, but the protocol lives on. You said you're using usb/serial converters and a little experimenting would be necessary to know if the autopilot would stay at /de/ttyUSBx, if it would need a leash.

Attachment:
Selection_030.png
Selection_030.png [ 114.3 KiB | Viewed 12154 times ]


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 03 Feb 2014, 04:01
Posts: 16
ah, so I would need to use OCPN to repeat all the data in one "package" (heading, wind, and track) to send solely to the autopilot…?

So I have my autopilot connected to my seatalk string of instruments which gives it heading, depth, gps, etc. then I have a converter at the end to get the seatalk feed into the computer. But you're saying that if I feed track data from the computer, through the converter to the seatalk network, it won't like it?

My autopilot has a seatalk port, and also an nmea in. I wonder if I route a separate nmea feed from the computer to the autopilot if it'll accept the track...

Thanks a lot for your help!


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 04 Nov 2010, 20:51
Posts: 1062
Quote:
But you're saying that if I feed track data from the computer, through the converter to the seatalk network, it won't like it?
No, I guessing. I don't know what SeaTalk can do.

I'm treating it as 'one talker/multiple listener' model.

...I just did a bit of reading. With the flashy SeaTalk why not treat the computer as just another node in the Seatalk network....basically just reads the data from Seatalk.

...or the other way...how did you integrate your computer with the autopilot and SeaTalk before? ...man, do I feel like I'm from the steam and coal era. Sorry, I think I've muddled things up. I think I have misunderstood the objective. Let me ponder this for a short while.


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 04 Nov 2010, 20:51
Posts: 1062
I think I've got my head around the problem....I'll try to get something down on electrons in a few days.


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 03 Feb 2014, 04:01
Posts: 16
Thanks Moe!

I guess a fundamental question is, if I have a port which is used for incoming gps and instrument data to navigatrix, which is picked up by the gpsd, can I use the same port to output commands from OCPN?


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 04 Nov 2010, 20:51
Posts: 1062
The work around in this situation is to have OpenCPN pickup the data and repeat it to the autopilot and the gpsd...rather than the other way around.

OpenCPN would spit the data out to the autopilot via something like: Auto-Pilot Connection | Official OpenCPN Homepage and repeat to gpsd.

The downside is that rest of the system won't receive live gps data unless OpenCPN is running, which shouldn't be a significant issue.


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 03 Feb 2014, 04:01
Posts: 16
thanks Moe, I'll have a play around and see what I can get working.

Cheers,
Dave


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 04 Nov 2010, 20:51
Posts: 1062
Yeah, you'll have to reconfigure the gpsd because the current setting is to grab the first gps the system finds. It won't 'know' to pick it up from OpenCPN.

I'll walk you through it, if you'd like...I'm just a little scatter brained and busy at the moment to sit down and write it out so it would work without tears, as you will most likely need a to make or attach a virtual device for OpenCPN to send the data to; that gpsd can pick it up from. This sounds scarier than it really is. I can't do it off the top of my head...which is the real scary bit; because it is simple.

Let us know if you have success. The task is 'doable'.

...unless someone else wants to ring in already and is just waiting for me to shut up..


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 03 Feb 2014, 04:01
Posts: 16
If i connected a completely separate com port which had nothing coming in, but just used it to output the autopilot data from OCPN, could I have gpsd running as normal and just set the com port to output from OCPN? Would I have to set gpsd not to look at that com port to allow it to be free?


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 04 Nov 2010, 20:51
Posts: 1062
...even easier still.

Tell OpenCPN where your SeaTalk bridge is located.

Slip down to the images in this post: http://navigatrix.net/viewtopic.php?f=4&t=319 ...the third image is where you put in the 'non'virtual port that has nothing on it. You can forget the -N non-daemon flag...and then just 'ok' out.

Then point output from OpenCPN to that port.


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 03 Feb 2014, 04:01
Posts: 16
Hello Moe, I'm back again! So my set up works fine using OpenCPN on my MacBook. Telling OCPN which port is which, it receives all the relevant data, and outputs data to the autopilot.

My problem is, i'm very new to linux/ubuntu/navigatrix and still trying to get my head around how it all works. As I said above, I think I need to tell gpsd exactly which ports to get input data from and which port to leave free so I can assign it to OPCN as an output.

I've currently got three usb-serials plugged in. The first with gps/instrument data, the second with ais, and the third as output to the autopilot. I've tried to find answers/work out how to do the following, but am completely stumped!

1. How do I get navigatrix to tell which tty/USB0 or 1 or 2 etc. is which usb/serial port? Going off my MacBook, every time I reboot or plug one out/in, the numbers change (which is why I love gpsd as I don't have to do this anymore!).

2. Once I somehow fix the "addresses" of the serial/usb's, how do I tell gpsd NOT to look at a certain one? Your post before confused me as that screenshot seemed to show how to tell gpsd which port to look at for gps data… or am i missing something…

Thank you for your help!

Cheers,
Dave

p.s. as an aside, I've noticed when I first connect up the AIS feed, it seems to take quite awhile to get through gpsd and into OCPN. Is this normal?


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 04 Nov 2010, 20:51
Posts: 1062
david_302 wrote:
still trying to get my head around how it all works
...join the club.

gpsd is one of my favourite programs. It quietly sits there until it senses data coming into the system. It then queries the device to find out if it gps data.

If it is gps data, it will then select the best method of gathering the data and making it available for everything else that wants, or could use, gps data. (Time sync, Airmail position, Planetarium position, any of the navigation application, and Redshift/Nightshift...another favourite)

If the information coming in is not gps data the gpsd will leave it alone and quietly wait for a new input of data to see it it is gps data.

I thought your configuration was with a SeaTalk bridge, that is, all of the data going in/out one connector that ruled them all, multiple talkers/multiple listeners, but each politely waiting their turn.

The ability to handle AIS data was added to gpsd about 5 years ago. I don't know the behaviour if there the are two streams of data, gps and ais, and the ais happens to connected first.

But gpsd can be setup any way (most any way) you want to be completely transparent but still do what you want it to do...provide gps/ais data to anything.


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 04 Nov 2010, 20:51
Posts: 1062
david_302 wrote:
Also, as an aside, I've been playing around with an iPad to try to remote desktop into my navigatix netbook. I've managed to use VNC viewer on the iPad to connect to a session on navigatix, but haven't managed to actually share the same desktop. Anyone able to give me a dummies guide to doing this?


I'm i-ignorant when it comes to anything Apple and this isn't quite dummy guide quality, but I'm working on it.

With no additional software on a LiveCD of Navigatrix
Attachment:
Stick [Running]remote_desktop.png
Stick [Running]remote_desktop.png [ 68.19 KiB | Viewed 12049 times ]
At the popup window enter the IP of a machine you want to grant access.
Attachment:
Stick [Running]remote_available.png
Stick [Running]remote_available.png [ 20.04 KiB | Viewed 12049 times ]
On the machine you wish to view the remote Navigatrix place your add-on 'viewer' (Vinagre, Remmina, whatever)in Reverse Connections
Attachment:
Reverse Connections_005.png
Reverse Connections_005.png [ 31.23 KiB | Viewed 12049 times ]
Bingo.


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 04 Nov 2010, 20:51
Posts: 1062
Oh, might as well say it.

If you run gitso (Menu> Internet> Remote Support) on any Linux machine, one hits and the other pitches.

So two Navigatrix systems are a point and click away from a point and click remote desktop.

I like that. That's my style.


Top
   
 
 Post subject: Re: … send autopilot commands from OpenCPN

Joined: 03 Feb 2014, 04:01
Posts: 16
Thanks Moe, that makes sense, I'll give it a go and see if I can get it singing.

I'm still at a bit of a loss at how to output to serial with OPCN though. I have all the data coming in nicely with GPSD. If I run "ls /dev" in a terminal, then plug in a usb-serial (which is outputting NMEA to the Autopilot) and run "ls /dev" again, I see that "ttyUSB3" has now appeared.

So I go into OPCN and make a new serial connection to "/dev/ttyUSB3" and make it output the data I want. But it doesn't work. Lots of little red lines in the debug window.

If I do exactly the same on my Mac, it works just fine. What am I missing?


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ] 


Search for:

Credits © 2010 - 2024