MacSailing.net

Full Version: iNavx and GPSD
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All looking for some advice and help on NMEA over TCP for iNavx

First and most simple question is does anyone know if iNavx supports GPSD delivering NMEA data via TCP? If that answer is, it doesn't then stop reading and smile at the time ive wasted :p

I have installed and have working a copy of GPSD on a Raspberry Pi, it has successfully connected to the GPS and the supplied routines cgps and xgps give me a proper fix.

I have invoked it with the -G flag which allows it make NMEA data available over its network connection. (pasted below is the entire line its invoked with)

gpsd -N -D3 -G -F /var/run/gpsd.sock /dev/ttyACM0

If put in the correct ip address and port number into iNavx it will connect and receives the welcome below from GPSD but does not appear to send the ?WATCH command to start the data stream

{"class":"VERSION","release":"3.6","rev":"3.6","proto_major":3,"proto_minor":7}

If I connect to the port on the Raspberry from a mac with the following command 'nc 192.168.1.20 2947' and then send it a '?WATCH={"enable":true,"json":true}' command it streams data perfectly to the Mac - However Opencpn on the Mac does not seem to want to work with it

Im am wondering if iNavx simply does not support GPSD or if I have got some basic principles wrong

Any help, clues etc that anyone can give would be much appreciated.

Regards

Ric
Can't say I have had much luck getting gpsd to work on my Mac. iNavX will accept raw NMEA data over a TCP or UDP connection..

http://www.macsailing.net/fbb/showtopic.php?tid/1178/
Now you just gave me a clue there !

Use gpspipe !! I used gpspipe to take raw NMEA from gpsd and piped that through netcat to another port (randomly selected 3330) and connect iNavx to that and it works!

If it helps anyone else I used the following command.

gpspipe -r | nc -l 3330


So in theory I can now take GPS data, Wind speed and direction data,depth/log info and feed it all into gpsd which will mux it all together on my cheepy Raspberry Pi and send it all out to iNavx :-)

Ric
Thanks for this bit of information!

Now to give something back: if you want to use UDP broadcast you can use
Code:
gpspipe -r | socat -  UDP-DATAGRAM:192.168.1.255:5000,broadcast

then you can configure INavX to listen with just the port number, no server ip required. The trick is to use your local network's broadcast address.

You can check that this works by issuing

Code:
nc -lu 5000
on another machine. For some reason it only prints a few lines and then stop, but in INavX NMEA configuration screens the data flowing if things are working.
Thank you

I will give it a try, I did wonder how to use UDP broadcasts in the past

I have now extended my use of nc with the following

gpspipe -r | nc -l 3330 | nc -l 3331

If you setup gpsd to listen on port 3331 it will then receive via std out of NC goto waypoint instructions from iNavx, and.... I believe I can then feed this to an ST1000 auto helm!

If you see a boat going in circles in the solent - it could be me geting my nc's and socat's in a muddle !

Ric