<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This file is Copyright 2013 by the GPSD project
SPDX-License-Identifier: BSD-2-clause
-->
<!DOCTYPE refentry PUBLIC
   "-//OASIS//DTD DocBook XML V4.1.2//EN"
   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id='gps2udp.1'>
 <refentryinfo>
  <date>6 December 2020</date>
 </refentryinfo>
 <refmeta>
  <refentrytitle>gps2udp</refentrytitle>
  <manvolnum>1</manvolnum>
  <refmiscinfo class="source">The GPSD Project</refmiscinfo>
  <refmiscinfo class="manual">GPSD Documentation</refmiscinfo>
 </refmeta>
 <refnamediv id='name'>
  <refname>gps2udp</refname>
  <refpurpose>feed the take from gpsd to one or more aggregation sites</refpurpose>
 </refnamediv>
 <refsynopsisdiv id='synopsis'>
  <cmdsynopsis>
   <command>gps2udp</command>
   <arg choice='opt'>--ais</arg>
   <arg choice='opt'>--count <replaceable>COUNT</replaceable>
   </arg>
   <arg choice='opt'>--daemonize</arg>
   <arg choice='opt'>--debug <replaceable>LVL</replaceable>
   </arg>
   <arg choice='opt'>--help</arg>
   <arg choice='opt'>--json</arg>
   <arg choice='opt'>--nmea</arg>
   <arg choice='opt'>--tpv</arg>
   <arg choice='opt'>--udp <replaceable>HOST:PORT</replaceable>
   </arg>
   <arg choice='opt'>-a</arg>
   <arg choice='opt'>-c <replaceable>COUNT</replaceable>
   </arg>
   <arg choice='opt'>-d <replaceable>LVL</replaceable>
   </arg>
   <arg choice='opt'>-h</arg>
   <arg choice='opt'>-j</arg>
   <arg choice='opt'>-n</arg>
   <arg choice='opt'>-t</arg>
   <arg choice='opt'>-u <replaceable>HOST:PORT</replaceable>
   </arg>
   <arg choice='opt'>-V</arg>
   <arg choice='opt'>-V</arg>
   <group>
    <replaceable>server</replaceable>
    <group>
     <replaceable>:port</replaceable>
     <group>
      <replaceable>:device</replaceable>
     </group>
    </group>
   </group>
  </cmdsynopsis>
 </refsynopsisdiv>
 <refsect1 id='description'>
  <title>DESCRIPTION</title>
  <para>
   <application>gps2udp</application> is a tool to connect to
<application>gpsd</application> and output the received sentences to
one or many UDP host:port destinations.  This makes the program useful
for feeding AIS information from <application>gpsd</application> to
aishub, marinetraffic, shipfinder,... </para>
  <para>
   <application>gps2udp</application> does not require root
privileges, and can be run concurrently with other tools connecting
to the local <application>gpsd</application> without causing problems.</para>
  <para>The output will consist of one or both of NMEA (<option>-n</option> option) or
JSON (<option>-j</option> option) <application>gpsd</application> sentences. The
output is sent to one or many destinations host through a UDP network
socket (<option>-u HOST:PORT</option> options) .</para>
  <para>Optionally a server, TCP/IP port number and remote device can be given.
If omitted, <application>gps2udp</application> connects to localhost on
the default port (2947) and watches all devices opened by
<application>gpsd</application>.</para>
  <para>
   <application>gps2udp</application> may be run as a daemon (<option>-b</option>
option).</para>
  <para>
   <application>gps2udp</application> is designed to run smoothly in
background; it reconnects automatically to
<application>gpsd</application> whenever it is restarted. For
debugging purporses, there is an option to exit gracefully after a given
count of packets (<option>-c</option> option).</para>
 </refsect1>
 <refsect1 id='options'>
  <title>OPTIONS</title>
  <variablelist>
   <varlistentry>
    <term>
     <option>-?</option>
    </term>
    <term>
     <option>-h</option>
    </term>
    <term>
     <option>--help</option>
    </term>
    <listitem>
     <para>-Print a usage message and exit.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-a</option>
    </term>
    <term>
     <option>--ais</option>
    </term>
    <listitem>
     <para>Send only AIS messages.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-b</option>
    </term>
    <term>
     <option>--daemon</option>
    </term>
    <listitem>
     <para>Causes <application>gps2udp</application> to run as a daemon.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-c COUNT</option>
    </term>
    <term>
     <option>--count COUNT</option>
    </term>
    <listitem>
     <para>Exit after COUNT sentences are sent.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-d LVL</option>
    </term>
    <term>
     <option>--debug LVL</option>
    </term>
    <listitem>
     <para>Set debug level to LVL. LVL = 0 prints nothing.
LVL =1 prints sent packet on stdout.  LVL =2 prints ignored packets.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-j</option>
    </term>
    <term>
     <option>--json</option>
    </term>
    <listitem>
     <para>Causes JSON sentences to be output.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-n</option>
    </term>
    <term>
     <option>--nmea</option>
    </term>
    <listitem>
     <para>Causes NMEA sentences to be output.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-t</option>
    </term>
    <term>
     <option>--tpv</option>
    </term>
    <listitem>
     <para>Only output TPV sentences.  Implies --json.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-u HOST:PORT</option>
    </term>
    <term>
     <option>--udp HOST:PORT</option>
    </term>
    <listitem>
     <para>UDP destination for output sentenses (up to five destinations).</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-v</option>
    </term>
    <term>
     <option>-V</option>
    </term>
    <term>
     <option>--version</option>
    </term>
    <listitem>
     <para>Prints the program version, then exit.  -v is deprecated December
2020.</para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>
 <refsect1 id='exampletitle'>
  <title>EXAMPLE</title>
  <para>With a running <application>gpsd</application> accessible on the
network </para>
  <para>
   <command>gps2udp -d 1 -n -u data.aishub.net:2222 </command> will
collect data from localhost:gpsd display them on stdout and send a
copy to test aishub in NMEA format.</para>
  <para>
   <command>gps2udp -a -n -b -u data.aishub.net:2222 -u 5.9.207.224:5321 -u 109.200.19.151:4001 fridu.net:2947</command> will collect
data from a remote gpsd located on fridu.net host, will filter AIS
messages and send them to 3 destination (aishub, marinetraffic,
shipfinder) in NMEA format, command is running in background
mode</para>
 </refsect1>
 <refsect1 id='see_also'>
  <title>SEE ALSO</title>
  <para>
   <citerefentry>
    <refentrytitle>gpsd</refentrytitle>
    <manvolnum>8</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>gps</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>libgps</refentrytitle>
    <manvolnum>3</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>libgpsmm</refentrytitle>
    <manvolnum>3</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>gpsprof</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>gpsfake</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>gpsctl</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>gpscat</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>.
<citerefentry>
    <refentrytitle>gpsmon</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>.
</para>
 </refsect1>
 <refsect1 id='maintainer'>
  <title>AUTHOR</title>
  <para>Fulup Ar Foll <email>fulup@sinagot.net</email>.</para>
 </refsect1>
</refentry>
