NMEA 2000 on a Raspberry Pi with a PiCAN-M

Connect a Raspberry Pi to your boat's NMEA 2000 network with a PiCAN-M: the backbone, power and terminators, SocketCAN (can0), testing with candump, and which PGNs MarineOS reads.

Updated Oct 3, 2026

NMEA 2000 is the network most boat instruments share: GPS, depth, wind, engines and autopilots all talk on one cable. A Raspberry Pi can join it with a PiCAN-M board. This guide covers how the network fits together, how to connect the Pi, how to check it's receiving, and what MarineOS Helm does with the data.

How an NMEA 2000 network fits together

Underneath, NMEA 2000 is a CAN bus at 250 kbit/s. Each kind of message has a number, its PGN: position is 129025, depth is 128267, and so on.

Connecting a Raspberry Pi with a PiCAN-M

The PiCAN-M, from Copperhill Technologies, is a HAT that sits on the Raspberry Pi. It has an NMEA 2000 Micro-C connector, NMEA 0183 (RS-422) terminals, and an optional 12 V power supply that can run the Pi from the boat.

  1. Fit the PiCAN-M to the Pi's 40-pin header.
  2. Run a Micro-C drop cable from the PiCAN-M to a free T on the backbone.
  3. Make sure the backbone is powered and terminated at both ends.

On Linux the PiCAN-M appears as a SocketCAN interface, can0, which has to be brought up at 250 kbit/s. The MarineOS Helm SD card image does this at every start, so there's nothing to configure.

Checking it's receiving

On a working network, a GPS or depth sounder sends several messages a second. Over SSH, watch them arrive:

candump can0

No lines at all usually means the backbone has no power, or a terminator is missing. To test the PiCAN-M on its own, away from the boat, loop its messages back:

sudo ip link set can0 down
sudo ip link set can0 up type can bitrate 250000 loopback on
candump can0 &
cansend can0 09F80123#1122334455667788

The frame you send prints back. On the MarineOS image, sudo systemctl restart marineos-can puts can0 back to normal.

In MarineOS, Settings › Data Sources › NMEA 2000 (can0) shows what it's receiving.

What MarineOS reads from NMEA 2000

PGNData
129025, 129026Position; course and speed over ground
127250Heading
128267Water depth
128259Speed through water
130306Wind: apparent and true
130310, 130312Water temperature
127508Battery
127505Fuel level
127488Engine RPM
Not yet: messages sent as fast packets, which span several CAN frames. That includes AIS (129038, 129039 and others), engine details (127489: temperatures, oil pressure, hours) and GNSS fix quality (129029). They're next on the list.

Sending to the autopilot

MarineOS also sends on the network. While you follow a route or a Go To, it claims its own address on the bus and sends cross-track error (129283), navigation data (129284) and route and waypoint information (129285) once a second, so a compatible autopilot can steer the route. Autopilot control is in beta: try it in open water first.

NMEA 0183 on the same board

The PiCAN-M's RS-422 port is /dev/ttyAMA0 on the Pi. Instruments talking NMEA 0183 connect to its receive terminals, and an older autopilot, such as a Raymarine ST7000, can take the route from its transmit terminals (4800 baud). Check the terminal names against the PiCAN-M and instrument manuals before connecting.

Next

For the whole build, from parts to charts on the screen, see how to build a Raspberry Pi chartplotter.

MarineOS: your whole boat, one platform

Charts, navigation, weather, engines and alarms at the helm, on your phone and at home. Free on iPhone, iPad and the web.

More guides

MarineOS is not certified navigation equipment: keep a proper watch and keep official charts on board.