Files
venus/axiom-nmea/examples/dbus-raymarine-publisher/README.md
dev 9756538f16 Initial commit: Venus OS boat addons monorepo
Organizes 11 projects for Cerbo GX/Venus OS into a single repository:
- axiom-nmea: Raymarine LightHouse protocol decoder
- dbus-generator-ramp: Generator current ramp controller
- dbus-lightning: Blitzortung lightning monitor
- dbus-meteoblue-forecast: Meteoblue weather forecast
- dbus-no-foreign-land: noforeignland.com tracking
- dbus-tides: Tide prediction from depth + harmonics
- dbus-vrm-history: VRM cloud history proxy
- dbus-windy-station: Windy.com weather upload
- mfd-custom-app: MFD app deployment package
- venus-html5-app: Custom Victron HTML5 app fork
- watermaker: Watermaker PLC control UI

Adds root README, .gitignore, project template, and per-project
.gitignore files. Sensitive config files excluded via .gitignore
with .example templates provided.

Made-with: Cursor
2026-03-16 17:04:16 +00:00

14 KiB

Raymarine D-Bus Publisher

Publishes Raymarine sensor data to Venus OS via D-Bus, making it available to the Victron ecosystem (VRM, GX Touch display, etc.). Also runs an NMEA TCP server for navigation apps.

Published Services

Service Description
com.victronenergy.gps.raymarine_0 GPS position, speed, course
com.victronenergy.meteo.raymarine_0 Wind direction/speed, air temp, pressure
com.victronenergy.navigation.raymarine_0 Heading, depth, water temperature
com.victronenergy.tank.raymarine_tankN_0 Tank level for each tank
com.victronenergy.battery.raymarine_batN_0 Battery voltage for each battery

Quick Deployment

1. Build the package

From the examples/dbus-raymarine-publisher directory:

./build-package.sh

This creates dbus-raymarine-publisher-1.0.0.tar.gz with the following structure:

dbus-raymarine-publisher/
  raymarine_nmea/       # Python library
  venus_publisher.py    # Publisher script
  service/              # Daemontools service files
  install.sh            # Installation script
  uninstall.sh          # Removal script
  README.md             # This file
  VERSION               # Build info

2. Copy to Venus OS

scp dbus-raymarine-publisher-1.0.0.tar.gz root@venus:/data/

3. Extract on Venus OS

ssh root@venus
cd /data
tar -xzf dbus-raymarine-publisher-1.0.0.tar.gz

4. Run the installer

bash /data/dbus-raymarine-publisher/install.sh

The installer will:

  • Find velib_python and create a symlink
  • Prompt you to select a network interface (eth0, wlan0, or custom IP)
  • Configure the NMEA TCP server port
  • Install the daemontools service
  • Set up automatic logging
  • Configure rc.local for firmware update survival

4b. Or test manually first

cd /data/dbus-raymarine-publisher
python3 venus_publisher.py --interface eth0

Service Management

After installation, control the service with:

# Check status
svstat /service/dbus-raymarine-publisher

# View logs
tail -F /var/log/dbus-raymarine-publisher/current | tai64nlocal

# Stop service
svc -d /service/dbus-raymarine-publisher

# Start service
svc -u /service/dbus-raymarine-publisher

# Restart service
svc -t /service/dbus-raymarine-publisher

Changing the Network Interface

Edit the run script:

vi /data/dbus-raymarine-publisher/service/run

Change the INTERFACE variable to eth0, wlan0, or a specific IP address.

Then restart the service:

svc -t /service/dbus-raymarine-publisher

Surviving Firmware Updates

The installer automatically configures /data/rc.local to restore the service symlink after Venus OS firmware updates.

Uninstalling

bash /data/dbus-raymarine-publisher/uninstall.sh

To completely remove all files:

rm -rf /data/dbus-raymarine-publisher /var/log/dbus-raymarine-publisher

Command Line Options

Option Description
--interface IP Network interface or IP (default: 198.18.5.5)
--no-gps Disable GPS service
--no-meteo Disable Meteo (wind) service
--no-navigation Disable Navigation service (heading, depth, water temp)
--no-tanks Disable all Tank services
--no-batteries Disable all Battery services
--tank-ids 1,2,10 Only publish specific tanks
--battery-ids 11,13 Only publish specific batteries
--update-interval MS D-Bus update interval (default: 1000ms)
--nmea-tcp-port PORT NMEA TCP server port (default: 10110)
--no-nmea-tcp Disable NMEA TCP server
--debug Enable debug logging
--dry-run Listen without D-Bus registration

D-Bus Path Reference

GPS (com.victronenergy.gps)

Path Description Unit
/Position/Latitude Latitude degrees
/Position/Longitude Longitude degrees
/Speed Speed over ground m/s
/Course Course over ground degrees
/Fix GPS fix status 0=no fix, 1=fix

Meteo (com.victronenergy.meteo)

Path Description Unit
/WindDirection True wind direction degrees
/WindSpeed True wind speed m/s
/ExternalTemperature Air temperature C
/Pressure Barometric pressure hPa

Navigation (com.victronenergy.navigation)

Path Description Unit
/Heading True heading degrees
/Depth Depth below transducer m
/WaterTemperature Water temperature C

Tank (com.victronenergy.tank)

Path Description Unit
/Level Tank level 0-100%
/Remaining Remaining volume m3
/Capacity Tank capacity m3
/FluidType Fluid type enum
/Status Sensor status 0=OK

Fluid types: 0=Fuel, 1=Fresh water, 2=Waste water, 3=Live well, 4=Oil, 5=Black water

Battery (com.victronenergy.battery)

Path Description Unit
/Dc/0/Voltage Battery voltage V
/Soc State of charge (estimated) %
/Alarms/LowVoltage Low voltage alarm 0/1/2
/Alarms/HighVoltage High voltage alarm 0/1/2

Testing with dbus-spy

On Venus OS, use dbus-spy to view published data:

# List all Raymarine services
dbus -y | grep raymarine

# Read GPS position
dbus -y com.victronenergy.gps.raymarine_0 /Position/Latitude GetValue
dbus -y com.victronenergy.gps.raymarine_0 /Position/Longitude GetValue

# Read navigation data
dbus -y com.victronenergy.navigation.raymarine_0 /Heading GetValue
dbus -y com.victronenergy.navigation.raymarine_0 /Depth GetValue

# Read wind data
dbus -y com.victronenergy.meteo.raymarine_0 /WindDirection GetValue
dbus -y com.victronenergy.meteo.raymarine_0 /WindSpeed GetValue

# Read tank levels
dbus -y com.victronenergy.tank.raymarine_tank1_0 /Level GetValue

Network Requirements

The Venus OS device must be connected to the same network as the Raymarine LightHouse MFD. The service will use the selected interface (eth0 or wlan0) and resolve the IP address at runtime, which works with DHCP.

If you need a specific VLAN IP (e.g., 198.18.x.x), you can add it manually:

# Add VLAN interface (temporary)
ip addr add 198.18.4.108/16 dev eth0

# Or configure in /etc/network/interfaces for persistence

MQTT Access

Venus OS includes an MQTT broker that mirrors all D-Bus values, allowing external systems (Home Assistant, Node-RED, SignalK, etc.) to access sensor data.

Enabling MQTT

On the GX device (or Venus OS):

  1. Go to Settings > Services > MQTT
  2. Enable MQTT on LAN
  3. Optionally enable MQTT on LAN (SSL) for encrypted connections

Default ports:

  • 1883 - MQTT (unencrypted)
  • 8883 - MQTT with SSL

MQTT Topic Structure

Venus OS uses this topic structure:

N/<portal_id>/<service_type>/<instance>/<path>

Where:

  • N/ - Notification topic (read values)
  • <portal_id> - Unique VRM portal ID (e.g., b827eb123456)
  • <service_type> - Service category (gps, tank, battery, meteo, navigation)
  • <instance> - Device instance number
  • <path> - D-Bus path without leading slash

To write values, use W/ prefix instead of N/.

Raymarine Sensor MQTT Topics

GPS Topics

MQTT Topic Description Unit
N/<id>/gps/0/Position/Latitude Latitude degrees
N/<id>/gps/0/Position/Longitude Longitude degrees
N/<id>/gps/0/Speed Speed over ground m/s
N/<id>/gps/0/Course Course over ground degrees
N/<id>/gps/0/Fix GPS fix status 0=no fix, 1=fix

Meteo/Wind Topics

MQTT Topic Description Unit
N/<id>/meteo/0/WindDirection True wind direction degrees
N/<id>/meteo/0/WindSpeed True wind speed m/s
N/<id>/meteo/0/ExternalTemperature Air temperature C
N/<id>/meteo/0/Pressure Barometric pressure hPa

Navigation Topics

MQTT Topic Description Unit
N/<id>/navigation/0/Heading True heading degrees
N/<id>/navigation/0/Depth Depth below transducer m
N/<id>/navigation/0/WaterTemperature Water temperature C

Tank Topics

Each tank is published as a separate instance. With default tank configuration:

Tank Instance MQTT Base Topic
Fuel Starboard (ID 1) 0 N/<id>/tank/0/...
Fuel Port (ID 2) 1 N/<id>/tank/1/...
Water Bow (ID 10) 2 N/<id>/tank/2/...
Water Stern (ID 11) 3 N/<id>/tank/3/...
Black Water (ID 100) 4 N/<id>/tank/4/...

Available paths per tank instance:

Path Suffix Description Unit
/Level Tank fill level 0-100%
/Remaining Remaining volume m3
/Capacity Total capacity m3
/FluidType Fluid type enum see below
/Status Sensor status 0=OK
/CustomName Tank name string

Example full topics for Fuel Starboard tank:

N/<id>/tank/0/Level
N/<id>/tank/0/Remaining
N/<id>/tank/0/Capacity
N/<id>/tank/0/FluidType

Battery Topics

Each battery is published as a separate instance. With default battery configuration:

Battery Instance MQTT Base Topic
House Bow (ID 11) 0 N/<id>/battery/0/...
House Stern (ID 13) 1 N/<id>/battery/1/...
Engine Port (ID 1000) 2 N/<id>/battery/2/...
Engine Starboard (ID 1001) 3 N/<id>/battery/3/...

Available paths per battery instance:

Path Suffix Description Unit
/Dc/0/Voltage Battery voltage V DC
/Soc State of charge (estimated) 0-100%
/Alarms/LowVoltage Low voltage alarm 0/1/2
/Alarms/HighVoltage High voltage alarm 0/1/2
/CustomName Battery name string

Example full topics for House Bow battery:

N/<id>/battery/0/Dc/0/Voltage
N/<id>/battery/0/Soc
N/<id>/battery/0/Alarms/LowVoltage

MQTT Message Format

Values are published as JSON:

{"value": 25.4}

For string values:

{"value": "Fuel Starboard"}

Subscribing to All Raymarine Sensors

# Subscribe to all GPS data
mosquitto_sub -h <venus_ip> -t 'N/+/gps/#' -v

# Subscribe to all navigation data
mosquitto_sub -h <venus_ip> -t 'N/+/navigation/#' -v

# Subscribe to all tank data
mosquitto_sub -h <venus_ip> -t 'N/+/tank/#' -v

# Subscribe to all battery data
mosquitto_sub -h <venus_ip> -t 'N/+/battery/#' -v

# Subscribe to all meteo/wind data
mosquitto_sub -h <venus_ip> -t 'N/+/meteo/#' -v

# Subscribe to everything
mosquitto_sub -h <venus_ip> -t 'N/#' -v

Keep-Alive Requirement

Venus OS MQTT requires periodic keep-alive messages to continue receiving updates. Send an empty message to the read topic:

# Initial subscription request
mosquitto_pub -h <venus_ip> -t 'R/<portal_id>/system/0/Serial' -m ''

# Or request all values
mosquitto_pub -h <venus_ip> -t 'R/<portal_id>/keepalive' -m ''

For continuous monitoring, send keep-alive every 30-60 seconds.

Home Assistant Integration

Example MQTT sensor configuration for Home Assistant:

mqtt:
  sensor:
    # GPS Position
    - name: "Boat Latitude"
      state_topic: "N/<portal_id>/gps/0/Position/Latitude"
      value_template: "{{ value_json.value }}"
      unit_of_measurement: "deg"

    - name: "Boat Longitude"
      state_topic: "N/<portal_id>/gps/0/Position/Longitude"
      value_template: "{{ value_json.value }}"
      unit_of_measurement: "deg"

    - name: "Boat Speed"
      state_topic: "N/<portal_id>/gps/0/Speed"
      value_template: "{{ (value_json.value * 1.94384) | round(1) }}"
      unit_of_measurement: "kn"

    # Navigation
    - name: "Boat Heading"
      state_topic: "N/<portal_id>/navigation/0/Heading"
      value_template: "{{ value_json.value }}"
      unit_of_measurement: "deg"

    - name: "Water Depth"
      state_topic: "N/<portal_id>/navigation/0/Depth"
      value_template: "{{ (value_json.value * 3.28084) | round(1) }}"
      unit_of_measurement: "ft"

    # Tank Levels
    - name: "Fuel Starboard"
      state_topic: "N/<portal_id>/tank/0/Level"
      value_template: "{{ value_json.value }}"
      unit_of_measurement: "%"
      device_class: battery

    - name: "Fresh Water Bow"
      state_topic: "N/<portal_id>/tank/2/Level"
      value_template: "{{ value_json.value }}"
      unit_of_measurement: "%"

    # Battery Voltage
    - name: "House Battery Voltage"
      state_topic: "N/<portal_id>/battery/0/Dc/0/Voltage"
      value_template: "{{ value_json.value | round(2) }}"
      unit_of_measurement: "V"
      device_class: voltage

Node-RED Integration

Example Node-RED flow to monitor tank levels:

  1. Add mqtt in node subscribed to N/<portal_id>/tank/+/Level
  2. Add json node to parse the message
  3. Add function node:
    msg.payload = msg.payload.value;
    msg.topic = msg.topic.split('/')[3]; // Extract tank instance
    return msg;
    
  4. Connect to dashboard gauge or further processing

SignalK Integration

SignalK can subscribe to Venus MQTT and convert values to SignalK paths. Install the signalk-venus-plugin for automatic integration, or manually map MQTT topics in the SignalK server configuration.

Troubleshooting

No D-Bus services registered

  • Check that velib_python is installed (pre-installed on Venus OS)
  • Ensure dbus-python with GLib support is available

No data received

  • Verify network interface is configured correctly
  • Check that the Raymarine MFD is broadcasting on the network
  • Use --debug to see raw packet data

Stale data

  • Data older than 10-30 seconds is marked as stale
  • Check network connectivity to Raymarine multicast groups

Service won't start

  • Check logs: tail /var/log/dbus-raymarine-publisher/current
  • Verify run script is executable: ls -la /service/dbus-raymarine-publisher/run
  • Check service status: svstat /service/dbus-raymarine-publisher