nmea2000
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
nmea2000 [2024/12/24 10:52] – admin | nmea2000 [2024/12/25 01:22] (current) – [Installing and Configuring MacArthur HAT on Raspberry Pi with NMEA 2000 and Signal K] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Installing and Configuring MacArthur HAT on Raspberry Pi with NMEA 2000 and Signal ===== | + | {{: |
- | K | + | |
- | Prerequisites | + | |
- | Raspberry Pi (3B+ or 4 recommended) | + | |
- | MacArthur HAT | + | |
- | NMEA 2000 to USB adapter (e.g., Actisense NGT-1) | + | |
- | MicroSD card (16GB or larger) | + | |
- | Power supply for Raspberry Pi | + | |
- | Ethernet cable or Wi-Fi connection | + | |
- | Step 1: Prepare the Raspberry Pi | + | |
- | Download and install the latest Raspberry Pi OS (previously called Raspbian) on your MicroSD card. | + | |
- | Insert the MicroSD card into the Raspberry Pi. | + | |
- | Connect the Raspberry Pi to your network via Ethernet or Wi-Fi. | + | |
- | Power on the Raspberry Pi. | + | |
- | Step 2: Install the MacArthur HAT | + | |
- | Power off the Raspberry Pi. | + | |
- | Carefully attach the MacArthur HAT to the GPIO pins on the Raspberry Pi. | + | |
- | Secure the HAT with standoffs if provided. | + | |
- | Step 3: Enable I2C Interface | + | |
- | Power on the Raspberry Pi and open a terminal. | + | |
- | Run sudo raspi-config. | + | |
- | Navigate to " | + | |
- | Reboot the Raspberry Pi: sudo reboot. | + | |
- | Step 4: Install Required Software | + | |
- | Update your system: | + | |
+ | The MacArthur HAT (Hardware Attached on Top) is a specialized expansion board designed for the Raspberry Pi, primarily used in marine and outdoor applications. It integrates various sensors, including GPS, 9-axis IMU (accelerometer, | ||
+ | |||
+ | ===== Prerequisites ===== | ||
+ | * Raspberry Pi (3B+ or 4 recommended) | ||
+ | * MacArthur HAT | ||
+ | * NMEA 2000 to USB adapter (e.g., Actisense NGT-1) | ||
+ | * MicroSD card (16GB or larger) | ||
+ | * Power supply for Raspberry Pi | ||
+ | * Ethernet cable or Wi-Fi connection | ||
+ | |||
+ | ===== Step 1: Prepare the Raspberry Pi ===== | ||
+ | |||
+ | - Download and install the latest Raspberry Pi OS (previously called Raspbian) on your MicroSD card. | ||
+ | - Insert the MicroSD card into the Raspberry Pi. | ||
+ | - Connect the Raspberry Pi to your network via Ethernet or Wi-Fi. | ||
+ | - Power on the Raspberry Pi. | ||
+ | |||
+ | ===== Step 2: Install the MacArthur HAT ===== | ||
+ | |||
+ | - Power off the Raspberry Pi. | ||
+ | - Carefully attach the MacArthur HAT to the GPIO pins on the Raspberry Pi. | ||
+ | - Secure the HAT with standoffs if provided. | ||
+ | |||
+ | ===== Step 3: Enable I2C Interface ===== | ||
+ | |||
+ | - Power on the Raspberry Pi and open a terminal. | ||
+ | - Run '' | ||
+ | - Navigate to " | ||
+ | - Reboot the Raspberry Pi: '' | ||
+ | |||
+ | ===== Step 4: Install Required Software ===== | ||
+ | |||
+ | - Update your system: | ||
+ | < | ||
sudo apt update | sudo apt update | ||
sudo apt upgrade -y | sudo apt upgrade -y | ||
- | Install necessary packages: | + | </ |
+ | - Install necessary packages: | ||
+ | < | ||
sudo apt install -y git cmake build-essential libgps-dev gpsd gpsd-clients python3-pip | sudo apt install -y git cmake build-essential libgps-dev gpsd gpsd-clients python3-pip | ||
- | Install the MacArthur HAT Python library: | + | </ |
+ | - Install the MacArthur HAT Python library: | ||
+ | < | ||
sudo pip3 install macarthur-hat | sudo pip3 install macarthur-hat | ||
- | Step 5: Configure the MacArthur HAT | + | </ |
- | Create a new Python script to test the HAT: | + | |
+ | ===== Step 5: Configure the MacArthur HAT ===== | ||
+ | - Create a new Python script to test the HAT: | ||
+ | < | ||
nano ~/ | nano ~/ | ||
- | Add the following content: | + | </ |
+ | - Add the following content: | ||
+ | <code python> | ||
from macarthur_hat import MacArthurHAT | from macarthur_hat import MacArthurHAT | ||
import time | import time | ||
Line 46: | Line 65: | ||
print(hat.read_all()) | print(hat.read_all()) | ||
time.sleep(1) | time.sleep(1) | ||
- | Run the script to test the HAT: | + | </ |
+ | - Run the script to test the HAT: | ||
+ | < | ||
python3 ~/ | python3 ~/ | ||
- | Step 6: Set Up NMEA 2000 Interface | + | </ |
- | Connect your NMEA 2000 to USB adapter to the Raspberry Pi. | + | |
- | Install the NMEA 2000 library: | + | ===== Step 6: Set Up NMEA 2000 Interface ===== |
+ | - Connect your NMEA 2000 to USB adapter to the Raspberry Pi. | ||
+ | |||
+ | - Install the NMEA 2000 library: | ||
+ | < | ||
sudo pip3 install pycanboat | sudo pip3 install pycanboat | ||
- | Create a new Python script for NMEA 2000 data: | + | </ |
+ | - Create a new Python script for NMEA 2000 data: | ||
+ | < | ||
nano ~/ | nano ~/ | ||
- | Add the following content: | + | </ |
+ | - Add the following content: | ||
+ | <code python> | ||
import can | import can | ||
from pycanboat import PGNs | from pycanboat import PGNs | ||
Line 70: | Line 98: | ||
if decoded: | if decoded: | ||
print(decoded) | print(decoded) | ||
- | Run the script to test NMEA 2000 data reception: | + | </ |
+ | - Run the script to test NMEA 2000 data reception: | ||
+ | < | ||
python3 ~/ | python3 ~/ | ||
- | Step 7: Install and Configure Signal K | + | </ |
- | Install Node.js and npm: | + | |
+ | ===== Step 7: Install and Configure Signal K ===== | ||
+ | |||
+ | - Install Node.js and npm: | ||
+ | < | ||
curl -sL https:// | curl -sL https:// | ||
sudo apt install -y nodejs | sudo apt install -y nodejs | ||
- | Install Signal K: | + | </ |
+ | - Install Signal K: | ||
+ | < | ||
sudo npm install -g signalk-server | sudo npm install -g signalk-server | ||
- | Create a new Signal K configuration: | + | </ |
+ | - Create a new Signal K configuration: | ||
+ | < | ||
signalk-server-setup | signalk-server-setup | ||
- | Start the Signal K server: | + | </ |
+ | - Start the Signal K server: | ||
+ | < | ||
signalk-server | signalk-server | ||
- | Step 8: Connect MacArthur HAT and NMEA 2000 to Signal K | + | |
- | Open a web browser and navigate to http://< | + | </ |
+ | ==== Step 8: Connect MacArthur HAT and NMEA 2000 ==== | ||
+ | |||
+ | Open a web browser and navigate to | ||
Go to Server > Plugin Config. | Go to Server > Plugin Config. | ||
Line 97: | Line 139: | ||
signalk-canboat-parser | signalk-canboat-parser | ||
Configure the plugins: | Configure the plugins: | ||
+ | < | ||
For signalk-macarthur-hat, | For signalk-macarthur-hat, | ||
For signalk-canboat-parser, | For signalk-canboat-parser, | ||
+ | </ | ||
Restart the Signal K server: | Restart the Signal K server: | ||
+ | < | ||
sudo systemctl restart signalk.service | sudo systemctl restart signalk.service | ||
- | Step 9: Verify the Setup | + | </ |
- | Navigate to http://< | + | |
- | Check the Data Browser to ensure you're receiving | + | ==== Step 9: Verify the Setup ==== |
- | Congratulations! You have successfully installed and configured a MacArthur HAT on a Raspberry Pi, added an NMEA 2000 network interface, and connected it to a Signal K application. | + | |
+ | Navigate to your web browser. | ||
+ | | ||
+ | |
nmea2000.1735062720.txt.gz · Last modified: 2024/12/24 10:52 by admin