Skip to content

~Raspberry Pi Installation (Java Server)

Teppo Kurki edited this page Feb 26, 2020 · 1 revision

Getting Started

This a "How to" Guide for installing Signal K on a Raspberry Pi (RPi). This is being written whilst installing on a new RPi 3+, but it should be applicable for earlier models.

So you have your RPi and are "chomping at the bit" to start using it. Make sure you have the following items...

  1. A network to connect the RPi to the internet (via Wi-Fi or ethernet)
  2. An HDMI monitor or TV
  3. A USB keyboard
  4. An 8GB or larger micro SD Card
  5. A Windows PC or Mac that can read micro SD Cards via a card reader or SD slot+adaptor

First get you need an SD card, 8GB or larger. Use one of the following methods to prepare it, depending on your skills:

  1. Buy a preloaded NOOBS SD card with your RPi
  2. Download NOOBS and create a fresh install of Rasbian Lite on your SD card. See https://www.raspberrypi.org/documentation/installation/noobs.md
  3. If you are more skilled you may prefer to download the Raspbian Lite image and flash it yourself, see https://www.raspberrypi.org/documentation/installation/installing-images/README.md

Get the SD card ready as above, insert into the RPi, connect HDMI screen or TV, USB keyboard, and a USB charger (minimum 2Amps, ideally 2.5+).

The RPi will boot with a lot of messages and you will see the login: prompt on the screen

You will need a connection to the internet to proceed. If you have ethernet, plug in a cable. If you have WiFi, then configure it in raspi-config below

Login

Login using the default user 'pi' and password 'raspberry'

At the command prompt (looks like this pi@raspberrypi:~ $) type the following and click [Enter]

pi@raspberrypi:~ $ raspi-config

In the menu that appears use the arrow keys to select, and the [TAB] key to jump to the options Set the following:

      Localization>
	       Timezone: select your timezone
      Interfacing options>
	       Enable SSH: yes, you want ssh to start at boot time
      Advanced Options>	
	       Expand filesystem: yes
	       Memory split: 16
      Network>
		N2 WiFi>
			Country: Select your country (NZ for me, this must be set to something even if you dont have WiFi access)
			SSID: the name of your home wifi network, or blank
 	                Passphrase: the password for your wifi network, or blank

Reboot the pi and login again

pi@raspberrypi:~ $ sudo reboot

Installing Signal K

Installing signalk is a one line command. Type it just as you see here:

pi@raspberrypi:~ $ source <(curl -s https://raw.githubusercontent.com/SignalK/signalk-java/master/setup_raspbian.sh)

Click [Enter].

It will ask a few questions, read, type your choices and press [Enter]

It will take quite a while depending on internet speed, and there will be quite a lot of messages scrolling past. It will end with:

The script has completed successfully.

Press ENTER to reboot or CTRL-c to cancel

Press [Enter], and the Rpi will reboot. The reboot will cause the Rpi to restart , it may take several minutes or more to become fully available.

Login again, at the prompt type:

pi@raspberrypi:~ $ tail -f signalk-java/signalk-static/logs/start.log

And press [Enter]. It will take quite a while depending on internet speed, and there will be quite a lot of messages scrolling past. There will also be a few long pauses, a couple of the longest are:

Downloading: .. the first few can be slow
Warning: Nashorn engine is planned to be removed from a future JDK release... can be several minutes

The install will finish with:

URLS:
https://[rpi_ip_address]:8443
https://127.0.0.1:8443

### The artemis server is ready! ###

Enter the https://[rpi_ip_address]:8443 into the browser on your PC, and you should get the login page. It may seem sluggish, this will improve with use.

Now type [Cntrl-c] to exit the logs, and log out of the Rpi. Its ready!.

Adding apps can be done via the ui at one of the URLs above https://[rpi_ip_address]:8443. The https://127.0.0.1:8443 address is only available if you are running the browser on the Rpi itself.

Trouble

If the script fails there will generally be log and error messages on the screen. After googling for easy answers, you need to copy those screen messages (phone camera shot maybe?) and log an issue at https://github.com/SignalK/signalk-java/issues with full details of your RPi, what you did, what happened, etc.

You should get a response within 24hrs, often faster.

Using the server

(some updating still to be done here )

Once installed, open the a decent web browser (not IE or Edge) on your PC and type this URL in to the address bar "https://[rpi_ip_address]:8443".

This default install uses https with self-signed certificates.

Browsers will complain the connection is untrusted, you can safely continue by adding an exception/accept the certificate for non-critical installations. You can also disable https in the configuration later.

This directs the browser to the Java Server on the RPi and you should see the following screen...login using user: admin, password: admin', and remember to change it later!. If you dont login a lot of data and functionality below will not be available.

Java Server Web Interface

Step 3 - Install Signal K Consumers

A "Consumer" of Signal K data is any web app, mobile device app or software program that can read and use Signal K data. It is hoped that the number of consumers will grow rapidly as more developers discover this open format and dream up new applications to make boating easier, more efficient or just more fun.

The Java Server has a very simple "one click" web installer for installing apps. Go to the 'Manage Apps' tab and install the major apps (Freeboard-sk, Instrument Panel, SKWiz, and Kip). For the purposes of this "How to" we will install Freeboard, which is easily done by clicking on the "@signalk/freeboard-sk vx.x.x" button.

"One Click" App Installation

Installation will take a minute or so depending upon the speed of your internet connection and once complete you will either see some errors or an "Installation Complete" message...

Java Server Web Interface

Now you can go back to the main index page and click on the blue "Freeboard-sk vx.x.x" button to run the Freeboard Chartplotter App...

Java Server Web Interface

If you have managed to get to the end of this guide, you will now have a good understanding of what Signal K is all about and in particular the Java Server. We have been using the server's demo file (select it in Configuration menu), but Java Server can also read NMEA0183 data via an NMEA to USB adaptor cable, NMEA2000 data via a 3rd party NMEA2000 gateway or both NMEA0183 and NMEA2000 via the new iKommunicate gateway.