signalk-server
Version:
An implementation of a [Signal K](http://signalk.org) server for boats.
100 lines (92 loc) • 16.1 kB
HTML
<html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Seatalk Connections | Signal K</title><meta name="description" content="Documentation for Signal K"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css?cache=1749583844244"/><link rel="stylesheet" href="../assets/highlight.css?cache=1749583844244"/><script defer src="../assets/main.js?cache=1749583844244"></script><script async src="../assets/icons.js?cache=1749583844244" id="tsd-icons-script"></script><script async src="../assets/search.js?cache=1749583844244" id="tsd-search-script"></script><script async src="../assets/navigation.js?cache=1749583844244" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js?cache=1749583844244" id="tsd-hierarchy-script"></script><link rel="stylesheet" href="../assets/theme.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title"><img src="../assets/logo.svg" alt="Signal K"/></a><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg><span class="visible@s">Search</span></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><div id="tsd-toolbar-links"><a href="https://discord.gg/uuZrwz4dCS" target="_blank" rel="noopener" class="toolbar-icon visible@s" aria-label="Discord"><svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M524.5 69.8a1.5 1.5 0 0 0 -.8-.7A485.1 485.1 0 0 0 404.1 32a1.8 1.8 0 0 0 -1.9 .9 337.5 337.5 0 0 0 -14.9 30.6 447.8 447.8 0 0 0 -134.4 0 309.5 309.5 0 0 0 -15.1-30.6 1.9 1.9 0 0 0 -1.9-.9A483.7 483.7 0 0 0 116.1 69.1a1.7 1.7 0 0 0 -.8 .7C39.1 183.7 18.2 294.7 28.4 404.4a2 2 0 0 0 .8 1.4A487.7 487.7 0 0 0 176 479.9a1.9 1.9 0 0 0 2.1-.7A348.2 348.2 0 0 0 208.1 430.4a1.9 1.9 0 0 0 -1-2.6 321.2 321.2 0 0 1 -45.9-21.9 1.9 1.9 0 0 1 -.2-3.1c3.1-2.3 6.2-4.7 9.1-7.1a1.8 1.8 0 0 1 1.9-.3c96.2 43.9 200.4 43.9 295.5 0a1.8 1.8 0 0 1 1.9 .2c2.9 2.4 6 4.9 9.1 7.2a1.9 1.9 0 0 1 -.2 3.1 301.4 301.4 0 0 1 -45.9 21.8 1.9 1.9 0 0 0 -1 2.6 391.1 391.1 0 0 0 30 48.8 1.9 1.9 0 0 0 2.1 .7A486 486 0 0 0 610.7 405.7a1.9 1.9 0 0 0 .8-1.4C623.7 277.6 590.9 167.5 524.5 69.8zM222.5 337.6c-29 0-52.8-26.6-52.8-59.2S193.1 219.1 222.5 219.1c29.7 0 53.3 26.8 52.8 59.2C275.3 311 251.9 337.6 222.5 337.6zm195.4 0c-29 0-52.8-26.6-52.8-59.2S388.4 219.1 417.9 219.1c29.7 0 53.3 26.8 52.8 59.2C470.7 311 447.5 337.6 417.9 337.6z"></path></svg></a><a href="https://github.com/SignalK/signalk-server" target="_blank" rel="noopener" class="toolbar-icon visible@s" aria-label="Discord"><svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></a><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../Configuration.html">Configuration</a></li><li><a href="" aria-current="page">Seatalk Connections</a></li></ul></div><div class="tsd-panel tsd-typography"><h1 id="seatalk-connections" class="tsd-anchor-link">Seatalk Connections<a href="#seatalk-connections" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><p>The Signal K Server supports a variety of data connection types including <em>Seatalk (GPIO)</em> which provides the ability to receive Raymarine Seatalk 1 (ST1) data, via simple DIY hardware connected to a Raspberry Pi GPIO, and convert it to Signal K deltas. This information can then be forwarded by the Signal K Server to a NMEA 0183 or NMEA 2000 network using appropriate hardware and plugins.</p>
<p>A guide to SeaTalk can be found <a href="http://boatprojects.blogspot.com/2012/12/beginners-guide-to-raymarines-seatalk.html">here</a>.</p>
<h2 id="hardware" class="tsd-anchor-link">Hardware<a href="#hardware" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Using an optocoupler as the hardware interface is recommended as it creates electrical isolation from hazardous voltages and avoids ground loops.</p>
<p>The circuit below uses the <a href="https://www.amazon.com/ARCELI-Optocoupler-Isolation-Converter-Photoelectric/dp/B07M78S8LB/ref=sr_1_2?dchild=1&keywords=pc817+optocoupler&qid=1593516071&sr=8-2">PC817 optocoupler board</a> but any equivlent product can be used. The LED in the circuit will flicker when there is ST1 traffic.</p>
<p><img src="../media/seatalk_circuit_3.jpg" alt="ST1_opto_SK"></p>
<p>If you are building the interface yourself use the below circuit instead. If you don't want any flickering just drop the LED at the input.</p>
<p><img src="../media/seatalk_circuit_4.jpg" alt="ST1_opto_SK"></p>
<p>A simpler, non-electrically isolated, solution is detailed below, using a low signal NPN transistor which inverts and shifts the voltage from 12V DC to 3.3V DC.</p>
<p><img src="../media/seatalk_circuit_2.jpg" alt="ST1_Tr"></p>
<p>If you do not want to build your own circuit, you can get a <strong>MacArthur HAT</strong> and simply connect it to your Seatalk 1 network <a href="https://macarthur-hat-documentation.readthedocs.io/en/latest/seatalk.html">following the manual</a>. If you also use OpenPlotter with this HAT, all the software will be installed and ready to go.</p>
<p><img src="../media/seatalk-dcdc.png" alt="MacArthur HAT"></p>
<h2 id="software" class="tsd-anchor-link">Software<a href="#software" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Before setting up the data connection on Signal K Server, you may need to install some associated Python libraries on your system. Here you have two options: gpiod library (<strong>Raspberry Pi 3, 4 and 5 models</strong>) or pigpio library (<strong>Raspberry Pi 3 and 4 models</strong>).</p>
<h3 id="gpiod-recommended" class="tsd-anchor-link">gpiod (recommended)<a href="#gpiod-recommended" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Both versions of this library 1.x.x (Debian package) and 2.x.x (Pip package) are supported. It is possible that your system already has one of the two versions of this library installed and some program is already using it, so before installing it we will check if we already have one.</p>
<p>Type this in a terminal:</p>
<pre><code><span class="hl-1">python </span><span class="hl-5">-</span><span class="hl-1">m pydoc gpiod </span><span class="hl-5">|</span><span class="hl-1"> tail</span>
</code><button>Copy</button></pre>
<p>If gpiod appears as installed, simply do nothing and go directly to the <em>Data Connection</em> section.</p>
<p>If it is not installed, type this in a terminal to install the latest version from pip:</p>
<pre><code><span class="hl-1">sudo pip3 install gpiod</span>
</code><button>Copy</button></pre>
<p>Since Debian 12 (Bookworm) and Ubuntu 24 (Noble), pip packages need to be installed in virtual environments, but we need this library to be installed at the system level, so on these systems we need to type this instead:</p>
<pre><code><span class="hl-1">sudo pip3 install gpiod </span><span class="hl-5">--break-</span><span class="hl-1">system</span><span class="hl-5">-</span><span class="hl-1">packages</span>
</code><button>Copy</button></pre>
<p>Pip will complain that the package is being installed in a non-virtual environment, but you can ignore the warning because it has not been detected to break any system packages.</p>
<h3 id="pigpio" class="tsd-anchor-link">pigpio<a href="#pigpio" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p><em>Inspired by <a href="https://github.com/Thomas-GeDaD/Seatalk1-Raspi-reader">Read SeaTalk1 from the Raspberry Pi GPIO using pigpio</a>.</em></p>
<p>Open a terminal and enter the following:</p>
<ol>
<li>Update the package manifest</li>
</ol>
<pre><code><span class="hl-1"> sudo apt</span><span class="hl-5">-</span><span class="hl-1">get update</span>
</code><button>Copy</button></pre>
<ol start="2">
<li>Install the software</li>
</ol>
<pre><code><span class="hl-1"> sudo apt</span><span class="hl-5">-</span><span class="hl-1">get install pigpio python</span><span class="hl-5">-</span><span class="hl-1">pigpio python3</span><span class="hl-5">-</span><span class="hl-1">pigpio</span>
</code><button>Copy</button></pre>
<ol start="3">
<li>Enable and start the <em>pigpio</em> <a href="http://abyz.me.uk/rpi/pigpio/">daemon</a> which handles the data connection.</li>
</ol>
<pre><code><span class="hl-1"> sudo systemctl enable pigpiod </span><span class="hl-5">&&</span><span class="hl-1"> sudo systemctl restart pigpiod</span>
</code><button>Copy</button></pre>
<ol start="4">
<li>Check the _pigpio_service is running</li>
</ol>
<pre><code><span class="hl-1"> sudo systemctl status pigpiod</span>
</code><button>Copy</button></pre>
<p><em>Note: The _pigpio</em> deamon by default provides a socket interface on port 8888, which may conflict with other software running on your Raspberry Pi. To have the socket interface use another port you will need to change the <a href="http://abyz.me.uk/rpi/pigpio/pigpiod.html">pigpiod.service file</a> using the <a href="http://abyz.me.uk/rpi/pigpio/python.html#pigpio.pi">Python program</a> with the -p option._</p>
<h3 id="data-connection" class="tsd-anchor-link">Data Connection<a href="#data-connection" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>With the required software installed, you can now add a new data connection using the Signal K Server Admin UI.</p>
<p><em>Example Data Connection:</em></p>
<p><img src="../media/config.png" alt="ST1_connection_SK"></p>
<ul>
<li>
<p>Select <em>Server -> Data Connections</em> from the main menu.</p>
</li>
<li>
<p>Click the <strong>Add</strong> button to create a new connection.</p>
</li>
<li>
<p>Select <strong>Seatalk (GPIO)</strong> in the <em>Data Type</em> dropdown list.</p>
</li>
<li>
<p>Set the <em>Enabled</em> to <strong>Yes</strong>.</p>
</li>
<li>
<p>Enter an <em>ID</em> <em>(e.g. Seatalk1)</em>.</p>
</li>
<li>
<p>In <em>GPIO Library</em>, select the software that is installed on your system as we have seen in the previous section.</p>
</li>
<li>
<p>In <em>GPIO Pin</em>, select one of the green GPIO pins from those pictured below <em>(this will be the pin to which you connect your hardware e.g. GPIO04).</em></p>
</li>
</ul>
<p><img src="../media/gpio.png" alt="GPIO"></p>
<ul>
<li>
<p>Set <em>Invert Signal</em> based on the hardware interface you have used <em>(e.g. Select <strong>No</strong> if using the optocoupler hardware setup above. Select <strong>Yes</strong> if using a hardware interface that inverts the ST1 signal)</em>.</p>
</li>
<li>
<p>Click <strong>Apply</strong> to save your data connection settings.</p>
</li>
<li>
<p>Restart the Signal K Server.</p>
</li>
</ul>
<h3 id="viewing-received-data" class="tsd-anchor-link">Viewing Received Data<a href="#viewing-received-data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Once the server has restarted, confirm that data is being received from the ST1 connection by using the <em>Data Browser</em> in the Admin UI .</p>
<p>The data received via the Seatalk connection will be displayed in the Data Browser with a source value that contains the <em>ID</em> you provided when setting up the connection.</p>
<p>If there is no data displayed in the Data Browser from the Seatalk connection, you can check if there is data available at the selected GPIO using these utilities:</p>
<p>gpiod: <a href="https://gist.github.com/astuder/c319cf955f6d651350222d36065981b3">https://gist.github.com/astuder/c319cf955f6d651350222d36065981b3</a></p>
<p>pigpio: <a href="https://raw.githubusercontent.com/MatsA/seatalk1-to-NMEA0183/master/STALK_read.py">https://raw.githubusercontent.com/MatsA/seatalk1-to-NMEA0183/master/STALK_read.py</a></p>
<p>If the display shows ST1 sentences being received at the GPIO pin then review your data connection settings.</p>
</div></div><div class="col-sidebar"><div class="page-menu"><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#hardware"><span>Hardware</span></a><a href="#software"><span>Software</span></a><ul><li><a href="#gpiod-recommended"><span>gpiod (recommended)</span></a></li><li><a href="#pigpio"><span>pigpio</span></a></li><li><a href="#data-connection"><span>Data <wbr/>Connection</span></a></li><li><a href="#viewing-received-data"><span>Viewing <wbr/>Received <wbr/>Data</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">Signal K</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>