User Tools

Site Tools


nmea2000

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
nmea2000 [2024/12/24 10:52] adminnmea2000 [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 ===== +{{:firefly_20241118061720.png?200|}}====== Installing and Configuring MacArthur HAT on Raspberry Pi with NMEA 2000 and Signal K ======
- 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 "Interfacing Options" > "I2C" and enable it. +
-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, gyroscope, and magnetometer), barometer, and temperature sensors. This HAT enables the Raspberry Pi to collect comprehensive environmental and navigational data, making it ideal for marine electronics projects, weather stations, and IoT applications. Its compatibility with NMEA 2000 networks and Signal K platforms enhances its utility in modern marine systems, allowing easy integration with other onboard electronics and data-sharing capabilities.
 +
 +===== 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 "Interfacing Options" > "I2C" and enable it.
 +  - Reboot the Raspberry Pi: ''sudo reboot''.
 +
 +===== Step 4: Install Required Software =====
 +
 +  - Update your system:
 +<code>
 sudo apt update sudo apt update
 sudo apt upgrade -y sudo apt upgrade -y
-Install necessary packages:+</code>
  
 +  - Install necessary packages:
 +<code>
 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:+</code>
  
 +  - Install the MacArthur HAT Python library:
 +<code>
 sudo pip3 install macarthur-hat sudo pip3 install macarthur-hat
-Step 5: Configure the MacArthur HAT +</code> 
-Create a new Python script to test the HAT:+ 
 +===== Step 5: Configure the MacArthur HAT =====
  
 +  - Create a new Python script to test the HAT:
 +<code>
 nano ~/test_macarthur.py nano ~/test_macarthur.py
-Add the following content:+</code>
  
 +  - 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:+</code>
  
 +  - Run the script to test the HAT:
 +<code>
 python3 ~/test_macarthur.py python3 ~/test_macarthur.py
-Step 6: Set Up NMEA 2000 Interface +</code>
-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:
 +<code>
 sudo pip3 install pycanboat sudo pip3 install pycanboat
-Create a new Python script for NMEA 2000 data:+</code>
  
 +  - Create a new Python script for NMEA 2000 data:
 +<code>
 nano ~/nmea2000_reader.py nano ~/nmea2000_reader.py
-Add the following content:+</code>
  
 +  - 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:+</code>
  
 +  - Run the script to test NMEA 2000 data reception:
 +<code>
 python3 ~/nmea2000_reader.py python3 ~/nmea2000_reader.py
-Step 7: Install and Configure Signal K +</code>
-Install Node.js and npm:+
  
 +===== Step 7: Install and Configure Signal K =====
 +
 +  - Install Node.js and npm:
 +<code>
 curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
 sudo apt install -y nodejs sudo apt install -y nodejs
-Install Signal K:+</code>
  
 +  - Install Signal K:
 +<code>
 sudo npm install -g signalk-server sudo npm install -g signalk-server
-Create a new Signal K configuration:+</code>
  
 +  - Create a new Signal K configuration:
 +<code>
 signalk-server-setup signalk-server-setup
-Start the Signal K server:+</code>
  
 +  - Start the Signal K server:
 +<code>
 signalk-server signalk-server
-Step 8: Connect MacArthur HAT and NMEA 2000 to Signal K + 
-Open a web browser and navigate to http://<raspberry-pi-ip>:3000.+</code> 
 +==== 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:
 +<code>
 For signalk-macarthur-hat, set the update interval and select the sensors you want to use. For signalk-macarthur-hat, set the update interval and select the sensors you want to use.
 For signalk-canboat-parser, set the NMEA 2000 interface (usually /dev/ttyUSB0 for Actisense NGT-1). For signalk-canboat-parser, set the NMEA 2000 interface (usually /dev/ttyUSB0 for Actisense NGT-1).
 +</code>
 Restart the Signal K server: Restart the Signal K server:
  
 +<code>
 sudo systemctl restart signalk.service sudo systemctl restart signalk.service
-Step 9: Verify the Setup +</code> 
-Navigate to http://<raspberry-pi-ip>:3000 in your web browser. + 
-Check the Data Browser to ensure you're receiving data from both the MacArthur HAT and the NMEA 2000 network. +==== 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. 
 +  Check the Data Browser to ensure you receive data from the MacArthur HAT and the NMEA 2000 network. 
 +  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.
nmea2000.1735062720.txt.gz · Last modified: 2024/12/24 10:52 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki