UNPKG

signalk-server

Version:

An implementation of a [Signal K](http://signalk.org) server for boats.

84 lines (71 loc) 16.1 kB
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Raspberry Pi | 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=1767726585343"/><link rel="stylesheet" href="../assets/highlight.css?cache=1767726585343"/><script defer src="../assets/main.js?cache=1767726585343"></script><script async src="../assets/icons.js?cache=1767726585343" id="tsd-icons-script"></script><script async src="../assets/search.js?cache=1767726585343" id="tsd-search-script"></script><script async src="../assets/navigation.js?cache=1767726585343" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js?cache=1767726585343" 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="../Installation.html">Installation</a></li><li><a href="" aria-current="page">Raspberry Pi</a></li></ul></div><div class="tsd-panel tsd-typography"><h1 id="installing-on-raspberry-pi" class="tsd-anchor-link">Installing on Raspberry Pi<a href="#installing-on-raspberry-pi" 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>Installation of Signal K server can consists of the following steps:</p> <ol> <li>Install the tools and libraries required to run the Signal K server (the dependencies)</li> <li>Install a Signal K Server to process the Signal K data</li> <li>Run the Setup script.</li> </ol> <p><em><strong>Important:</strong> If you are updating a Signal K server installation, especially if upgrading an installed version &lt;= 1.40.0, <a href="Updating_your_Installation.html">please check here first</a>.</em></p> <h2 id="prerequisites" class="tsd-anchor-link">Prerequisites:<a href="#prerequisites" 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>Raspberry Pi OS is installed on the device.</p> <p>For instructions on how to install the operating system <a href="https://www.raspberrypi.org/documentation/computers/getting-started.html#setting-up-your-raspberry-pi">can be found here.</a>.</p> <p><em>Note: It is also possible to perform a &quot;headless install&quot; using <code>Raspberry Pi OS Lite</code> since the GUI for Signal K is browser based.</em></p> <p>Once the OS installation has been completed, you are ready to commence.</p> <hr> <h2 id="install-the-dependencies" class="tsd-anchor-link">Install the Dependencies<a href="#install-the-dependencies" 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><ol> <li> <p>Log in to the RPi Desktop and open a terminal.</p> </li> <li> <p>Update the list of install packages.</p> <pre><code><span class="hl-0">sudo apt update</span> </code><button>Copy</button></pre> </li> <li> <p>Install NodeJS 20 and npm.</p> <p>Follow <a href="https://github.com/nodesource/distributions#installation-instructions">instructions for Ubuntu and Debian based distributions like Raspberry Pi OS at NodeSource Distributions</a>.</p> </li> <li> <p>Ensure that we're using the latest version of npm.</p> <pre><code><span class="hl-0">sudo npm install </span><span class="hl-1">-</span><span class="hl-0">g npm@latest</span> </code><button>Copy</button></pre> <p>Use the following command to check the versions of NodeJS and npm installed.</p> <pre><code><span class="hl-0">node </span><span class="hl-1">-</span><span class="hl-0">v </span><span class="hl-1">&amp;&amp;</span><span class="hl-0"> npm </span><span class="hl-1">-</span><span class="hl-0">v</span> </code><button>Copy</button></pre> <p>Ensure the reported versions are equal to or greater than <code>v18.15.0, 9.5.0</code> respectively.</p> </li> <li> <p>Install a Bonjour (mDNS) service for Linux called Avahi, which allows Apps and other network devices to Discover the Signal K server.</p> <pre><code><span class="hl-0">sudo apt install libnss</span><span class="hl-1">-</span><span class="hl-0">mdns avahi</span><span class="hl-1">-</span><span class="hl-0">utils libavahi</span><span class="hl-1">-</span><span class="hl-0">compat</span><span class="hl-1">-</span><span class="hl-0">libdnssd</span><span class="hl-1">-</span><span class="hl-0">dev</span> </code><button>Copy</button></pre> </li> </ol> <h2 id="install-signal-k-server" class="tsd-anchor-link">Install Signal K Server<a href="#install-signal-k-server" 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><pre><code><span class="hl-0">sudo npm install </span><span class="hl-1">-</span><span class="hl-0">g signalk</span><span class="hl-1">-</span><span class="hl-0">server</span> </code><button>Copy</button></pre> <p>You can test that installation was successful by starting the server using some sample data.</p> <pre><code><span class="hl-0">signalk</span><span class="hl-1">-</span><span class="hl-0">server </span><span class="hl-1">--</span><span class="hl-0">sample</span><span class="hl-1">-</span><span class="hl-0">nmea0183</span><span class="hl-1">-</span><span class="hl-0">data</span> </code><button>Copy</button></pre> <p>You should see the terminal output &quot;signalk-server running at 0.0.0.0:3000&quot; as shown below...</p> <pre><code><span class="hl-0">signalk</span><span class="hl-1">-</span><span class="hl-0">server </span><span class="hl-1">--</span><span class="hl-0">sample</span><span class="hl-1">-</span><span class="hl-0">nmea0183</span><span class="hl-1">-</span><span class="hl-0">data</span><br/><span class="hl-0">Using sample data from </span><span class="hl-1">/</span><span class="hl-0">usr</span><span class="hl-1">/</span><span class="hl-0">lib</span><span class="hl-1">/</span><span class="hl-0">node_modules</span><span class="hl-1">/</span><span class="hl-0">signalk</span><span class="hl-1">-</span><span class="hl-0">server</span><span class="hl-1">/</span><span class="hl-0">samples</span><span class="hl-1">/</span><span class="hl-0">plaka.log</span><br/><span class="hl-0">signalk</span><span class="hl-1">-</span><span class="hl-0">server running at </span><span class="hl-2">0.0</span><span class="hl-0">.</span><span class="hl-2">0.0</span><span class="hl-0">:</span><span class="hl-2">3000</span> </code><button>Copy</button></pre> <p>The Signal K Node Server is now reading and publishing sample NMEA0183 data from the specified file.</p> <p>Using a Web browser enter the following URL: <code>http://127.0.0.1:3000/signalk</code> which should display the following information indicating the server is up and running.</p> <pre><code class="JSON"><span class="hl-0">{</span><br/><span class="hl-0"> </span><span class="hl-3">&quot;endpoints&quot;</span><span class="hl-0">:{</span><br/><span class="hl-0"> </span><span class="hl-3">&quot;v1&quot;</span><span class="hl-0">:{</span><br/><span class="hl-0"> </span><span class="hl-3">&quot;version&quot;</span><span class="hl-0">:</span><span class="hl-4">&quot;2.0.0&quot;</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">&quot;signalk-http&quot;</span><span class="hl-0">:</span><span class="hl-4">&quot;http://127.0.0.1:3000/signalk/v1/api/&quot;</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">&quot;signalk-ws&quot;</span><span class="hl-0">:</span><span class="hl-4">&quot;ws://127.0.0.1:3000/signalk/v1/stream&quot;</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">&quot;signalk-tcp&quot;</span><span class="hl-0">:</span><span class="hl-4">&quot;tcp://127.0.0.1:3858&quot;</span><br/><span class="hl-0"> }</span><br/><span class="hl-0"> },</span><br/><span class="hl-0"> </span><span class="hl-3">&quot;server&quot;</span><span class="hl-0">:{</span><br/><span class="hl-0"> </span><span class="hl-3">&quot;id&quot;</span><span class="hl-0">:</span><span class="hl-4">&quot;signalk-server-node&quot;</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">&quot;version&quot;</span><span class="hl-0">:</span><span class="hl-4">&quot;2.0.0&quot;</span><br/><span class="hl-0"> }</span><br/><span class="hl-0">}</span> </code><button type="button">Copy</button></pre> <h2 id="run-the-setup-script" class="tsd-anchor-link">Run the Setup Script<a href="#run-the-setup-script" 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>Now that you have Signal K server installed, you will want to generate a settings file for your vessel and configure your RPi to start the server automatically. To do this run the setup script by entering the following command and follow the prompts.</p> <pre><code><span class="hl-0">sudo signalk</span><span class="hl-1">-</span><span class="hl-0">server</span><span class="hl-1">-</span><span class="hl-0">setup</span> </code><button>Copy</button></pre> <p>You can re-run this command at any time in the future to change the settings.</p> <p><em>Note: The setup script will enable security which will require you to <code>Login`` from the Admin UI. Clicking </code>Login` for the first time will prompt you to create a user and password.</em></p> <p>Signal K server will now be started automatically when your RPi boots up.</p> <p>If you want to temporarily stop the Signal K server, you can do so by entering the following commands:</p> <pre><code><span class="hl-0">sudo systemctl stop signalk.service</span><br/><span class="hl-0">sudo systemctl stop signalk.socket</span> </code><button>Copy</button></pre> <p>To start Signal K server again enter the following commands:</p> <pre><code><span class="hl-0">sudo systemctl start signalk.service</span><br/><span class="hl-0">sudo systemctl start signalk.socket</span> </code><button>Copy</button></pre> <p>To stop Signal K server from starting automatically enter the following commands:</p> <pre><code><span class="hl-0">sudo systemctl disable signalk.service</span><br/><span class="hl-0">sudo systemctl disable signalk.socket</span> </code><button>Copy</button></pre> <p>You are ready to now <strong><a href="../Configuration.html">configure</a></strong> your installation and connect data from devices on your boat.</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="#prerequisites"><span>Prerequisites:</span></a><a href="#install-the-dependencies"><span>Install the <wbr/>Dependencies</span></a><a href="#install-signal-k-server"><span>Install <wbr/>Signal <wbr/>K <wbr/>Server</span></a><a href="#run-the-setup-script"><span>Run the <wbr/>Setup <wbr/>Script</span></a></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>