Site Information

 Loading... Please wait...

Implementing OpenPlotter and Signal K with Raspberry Pi and PiCAN-M HATs

Posted by Wilfried Voss on

Raspberry Pi Marine Navigation Hub: OpenPlotter & Signal K in ActionOpenPlotter is a powerful open-source software suite designed for maritime navigation, data collection, and automation using a Raspberry Pi. It integrates Signal K, an open data standard for marine use, enabling the collection and sharing of data from various sensors and communication protocols like NMEA 0183 and NMEA 2000.

This guide will cover the implementation of OpenPlotter and Signal K using a Raspberry Pi with PiCAN-M HATs, a hardware module that enables NMEA 0183 and NMEA 2000 connectivity.

Hardware Requirements

To set up OpenPlotter and Signal K with NMEA connectivity, you will need:

  • Raspberry Pi (4 or 5 preferred)

  • PiCAN-M HAT (Available at CopperhillTech)

  • MicroSD Card (32GB or larger, Class 10 recommended)

  • 5V Power Supply (3A or higher)

  • NMEA 0183 and NMEA 2000-compatible sensors and devices

  • Marine-grade cables and connectors

  • Optional: GPS module, AIS receiver, environmental sensors

Software Requirements

  • OpenPlotter (Latest stable version from https://openplotter.readthedocs.io/)

  • Signal K Server

  • Raspberry Pi OS (Debian-based, 64-bit recommended)

  • Can-utils (for CAN bus diagnostics)

Step-by-Step Implementation

1. Setting Up Raspberry Pi

  1. Download the latest Raspberry Pi OS from the official Raspberry Pi website.

  2. Use Raspberry Pi Imager or Balena Etcher to flash the OS onto the MicroSD card.

  3. Insert the MicroSD card into the Raspberry Pi and power it up.

  4. Connect the Raspberry Pi to the internet via Wi-Fi or Ethernet.

  5. Update the system:

    sudo apt update && sudo apt upgrade -y

2. Installing OpenPlotter

  1. Add the OpenPlotter repository:

    echo 'deb http://repo.openplotter.cloud buster main' | sudo tee /etc/apt/sources.list.d/openplotter.list
  2. Update the package list:

    sudo apt update
  3. Install OpenPlotter:

    sudo apt install openplotter-settings
  4. Launch OpenPlotter from the Raspberry Pi menu and configure the system.

3. Installing and Configuring Signal K

  1. Install Node.js:

    curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
    sudo apt install -y nodejs
  2. Install Signal K:

    sudo npm install -g signalk-server
  3. Start the Signal K server:

    signalk-server --sample
  4. Access the Signal K web interface at http://raspberrypi.local:3000 or http://[your-pi-IP]:3000.

4. Configuring the PiCAN-M HAT

  1. Enable SPI and CAN interfaces:

    sudo raspi-config
    • Navigate to Interface Options > SPI > Enable

    • Navigate to Interface Options > CAN > Enable

  2. Add the following to /boot/config.txt:

    dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
  3. Reboot the Raspberry Pi:

    sudo reboot
  4. Verify CAN interfaces:

    ip link set can0 up type can bitrate 250000
    ifconfig can0
  5. Install CAN utilities:

    sudo apt install can-utils
    • Check incoming data:

      candump can0

5. Integrating PiCAN-M with Signal K

  1. In the Signal K web interface, go to Server > Data Connections.

  2. Add a new connection:

    • Type: NMEA 2000 (CAN bus)

    • Interface: can0

    • Baud Rate: 250000

  3. Save and restart Signal K.

  4. Check incoming data in Signal K's data browser.

6. Testing and Debugging

  • Use candump to monitor CAN bus traffic:

    candump can0
  • Restart Signal K if needed:

    sudo systemctl restart signalk
  • If issues arise, check logs:

    journalctl -u signalk -f

7. Expanding the System

  • Connect GPS and AIS modules for position tracking.

  • Integrate Wi-Fi and LTE modules for remote data access.

  • Enable MQTT and InfluxDB to store and visualize data.

  • Use Node-RED for automation and alerts.

Conclusion

By implementing OpenPlotter and Signal K on a Raspberry Pi with a PiCAN-M HAT, you create a versatile marine data hub that integrates NMEA 0183 and NMEA 2000 networks. This setup allows sailors, researchers, and DIY enthusiasts to monitor and automate marine systems efficiently. With OpenPlotter’s robust tools and Signal K’s standardized data handling, you can enhance maritime navigation, automation, and safety.


Marine Electrical and Electronics Bible: A Practical Handbook for Cruising Sailors

Marine Electrical and Electronics Bible: A Practical Handbook for Cruising Sailors

The Marine Electrical and Electronics Bible is an essential, hands-on guide for selecting, installing, maintaining, and troubleshooting electrical and electronic systems on board. Whether you own a cruising yacht, racing sailboat, trawler, powerboat, or even a superyacht, this comprehensive resource provides practical solutions tailored to real-world marine needs.

Fully illustrated with over 200 charts, wiring diagrams, tables, and graphs, this guide is designed for easy reference. Light on theory and rich in actionable advice, it acknowledges that most boat owners don’t have a technical background. Each chapter is structured for quick access to technical explanations and troubleshooting tips, drawing from the author’s extensive marine electrical expertise, firsthand cruising experience, and invaluable insights gained through decades of collaboration with fellow sailors. More information...