User Tools

Site Tools


ve.can:changing_nmea2000_instances

Changing NMEA2000 instances

1. Introduction

Instances are used in an NMEA2000 network to identify multiple similar products connected on the same network.

As an example, take a system with two battery monitors (one for the main battery bank, and another for the hydraulic-thruster bank) and also a Quattro inverter/charger. All three of those devices will send their battery voltage measurements out on the canbus.

For the displays to show these values at the right place, they need to know which voltage belongs to what battery.

Before going ahead and change instances, please make sure to first study the NMEA2000-out chapter in the GX manual.

How can I change the instances?

This document describes three options:

  1. Use Actisense software & hardware. Can change both the device- and data-instances
  2. Use Maretron software & hardware. Can change device instance only.
  3. From the commandline of a GX device. Note that this is a software developer trick. Not for any day use. Allows changing device instances as well as data instances.

Device instance, data instances and other instances

There various types of instances, and for marine systems are two that matter in most cases: the Device instance as well as the Data instance. Please make sure to study the NMEA2000-out chapter in the GX manual before continuing. It also links to specific instructions for Raymarine, Garmin, Furuno, Simrad, B&G and Lowrance MFDs.

For more detailed information, see also the FAQ in our Data communication whitepaper.

And the main NMEA2000 integration guide.

2. Changing the device instance with Actisense

Note: make sure to use a recent Actisense driver. Otherwise the instance might not ‘stick’.

Requires the Actisense NGT-1.

Changing a device instance:

  1. Open Actisense NMEA Reader
  2. Select the network view (tab selection is at the bottom left)
  3. Select the product whose device instance you want to change
  4. Select the properties tab at the bottom right and change the device instance

3. Changing a data instance with Actisense

Requires the Actisense NGT-1.

Changing a data instance:

  1. Open Actisense NMEA Reader
  2. Select data view (tab selection is at the bottom left)
  3. Right click on the PGN number. Note that this will only work on PGNs that allow changing their data instance:
  4. And change the value:

Notes for BMVs, Lynx Shunt and the Lynx Ion + Shunt:

  • The Battery Instance and the DC Detailed instance are the same value. Changing one of them, will also change the other one.
  • Since the BMV sends out two voltages, the main voltage and the aux- or starter-voltage, it comes preconfigured with two battery instances: 0 and 1. When you want to change that to 1 and 2, change the 1 into 2 first, and then the 0 into 1, as they cannot be the same.

4. Changing Instance Using Maretron N2KAnalyzer

Maretron uses a term called “Unique Instance” where the N2KAnalyzer software tool automatically determines if a particular device uses device or data instances.

WARNING: At Victron we do not understand what and how the Maretron software works with regards to this. We advise to use another tool, not Maretron, so that you know what you are doing, ie know what instance you are changing. So far, we have not been able to use Maretron software to change a data instance. And changing the other instance, the device instance can also be done straight from the Victron GX device its user interface. To change a data instance, for example to fix instance conflicts as reported by the Maretron software, we recommend to use Actisense. Not Maretron.

This procedure requires a Maretron USB adapter.

Open N2KAnalyzer and make sure that the “Unique Instance” column is turned on (i.e. checked) using the Setup>Columns menu item.

Within the N2KAnalyzer main window, any cell with a white background can be edited by clicking in the cell and typing in the desired value. You can see from the following screen shot that a few parameters have a white background including Label and Installation Description #1. To change a devices instance, click in the Unique Instance cell for the device you want to change and type the new number followed by a carriage return. If the particular products accepts the instance change, you will see the new instance number reflected in the cell. You can also use a tool within N2KAnalyzer to check that all products on the network are uniquely instanced. Use the Analyze>Instancing menu to verify correct overall system instancing.

5. Changing the instances from the GX command line

5.1 Introduction

Instead of using Actisense or Maretron software, it is also possible to change the VE.Can aka N2K Device instance from the GX Device shell. To get root access, follow these instructions: Venus OS: Root Access.

Once logged into the shell, follow below instructions. More back ground information of the used commands such as dbus and dbus-spy is found by reading about root access document.

5.1 New method - changing a Device instance

All devices available on the canbus are enumerated under the com.victronenergy.vecan service. And for all devices that support the necessary can-bus commands, the Device instance can be changed. All Victron products support changing their Device instance; and most or all non-Victron products as well.

# dbus -y com.victronenergy.vecan.can0 / GetValue
value = {
 'Devices/00002CC001F4/DeviceInstance': 0,
 'Devices/00002CC001F4/FirmwareVersion': 'v2.60-beta-29',
 'Devices/00002CC001F4/Manufacturer': 358,
 'Devices/00002CC001F4/ModelName': 'Cerbo GX',
 'Devices/00002CC001F4/N2kUniqueNumber': 500,
 'Devices/00002CC001F4/Nad': 149,
 'Devices/00002CC001F4/Serial': '0000500',
 'Devices/00002CC005EA/CustomName': 'Hub-1',
 'Devices/00002CC005EA/DeviceInstance': 0,
 'Devices/00002CC005EA/FirmwareVersion': 'v2.60-beta-29',
 'Devices/00002CC005EA/Manufacturer': 358,
 'Devices/00002CC005EA/ModelName': 'Color Control GX',
 'Devices/00002CC005EA/N2kUniqueNumber': 1514,
 'Devices/00002CC005EA/Nad': 11,
 'Devices/00002CC005EA/Serial': '0001514',
 'Devices/00002CC005EB/CustomName': 'SmartBMV',
 [and so forth]

To change them, do a SetValue call to the DeviceInstace path like below. Or, perhaps easier, use the dbus-spy tool.

These lines read it, then changes it to 1, then reads it again:

root@ccgx:~# dbus -y com.victronenergy.vecan.can0 /Devices/00002CC005EB/DeviceInstance GetValue
value = 0
root@ccgx:~# dbus -y com.victronenergy.vecan.can0 /Devices/00002CC005EB/DeviceInstance SetValue %1
retval = 0
root@ccgx:~# dbus -y com.victronenergy.vecan.can0 /Devices/00002CC005EB/DeviceInstance GetValue
value = 1

[note that numbers, like can0, and 00002CC005EB can ofcourse be different on your system].

5.2 New method - changing Data instance

This applies only the NMEA2000-out feature. See links on top of page for what the NMEA2000 out feature is.

The data instances used for the NMEA2000 out feature are stored in local settings. Here is a snippet of the lines, taken by using the dbus-spy tool that also allows changing entries:

The Data instances are the “Battery-”, “DCDetailed-”, and so forth instances.

Settings/Vecan/can0/Forward/battery/256/BatteryInstance0       0      <- Data instance for main voltage measurement
Settings/Vecan/can0/Forward/battery/256/BatteryInstance1       1      <- Data instance for starter or mid-voltage measurement
Settings/Vecan/can0/Forward/battery/256/Description2                           
Settings/Vecan/can0/Forward/battery/256/IdentityNumber        15
Settings/Vecan/can0/Forward/battery/256/Instance               1
Settings/Vecan/can0/Forward/battery/256/Nad                  233      <- Source address - no need, also not good, to change this
Settings/Vecan/can0/Forward/battery/256/SwitchInstance1        0      <- Data instance for switchbank
Settings/Vecan/can0/Forward/battery/256/SystemInstance         0
Settings/Vecan/can0/Forward/solarcharger/0/DcDataInstance0     0
Settings/Vecan/can0/Forward/solarcharger/0/DcDataInstance1     1
Settings/Vecan/can0/Forward/solarcharger/0/Description2        
Settings/Vecan/can0/Forward/solarcharger/0/IdentityNumber     25
Settings/Vecan/can0/Forward/solarcharger/0/Instance            0
Settings/Vecan/can0/Forward/solarcharger/0/Nad                36
Settings/Vecan/can0/Forward/solarcharger/0/SystemInsta         0
Settings/Vecan/can0/Forward/solarcharger/1/DcDataInstance0     0      <- Battery voltage & current
Settings/Vecan/can0/Forward/solarcharger/1/DcDataInstance1     1      <- PV voltage & current
Settings/Vecan/can0/Forward/solarcharger/1/Description2                                                  
Settings/Vecan/can0/Forward/solarcharger/1/IdentityNumber     24
Settings/Vecan/can0/Forward/solarcharger/1/Instance            0
Settings/Vecan/can0/Forward/solarcharger/1/Nad                36
Settings/Vecan/can0/Forward/solarcharger/1/SystemInstance      0
Settings/Vecan/can0/Forward/solarcharger/258/DcDataInstance0   0
Settings/Vecan/can0/Forward/solarcharger/258/DcDataInstance1   1
Settings/Vecan/can0/Forward/solarcharger/258/Description2                                                               
Settings/Vecan/can0/Forward/solarcharger/258/IdentityNumber   23
Settings/Vecan/can0/Forward/solarcharger/258/Instance          0
Settings/Vecan/can0/Forward/solarcharger/258/Nad              36
Settings/Vecan/can0/Forward/solarcharger/258/SystemInstance    0

5.3 Old method

(Only allows changing Device instances - not data instances as used in the NMEA2000-out function)

Step 1. List the devices:

root@ccgx:~# dbus -y
com.victronenergy.bms.socketcan_can0_di0_uc10
com.victronenergy.charger.socketcan_can0_di1_uc12983

It shows a Skylla-i (the charger). di1 in the name means that it is currently on DeviceInstance 1.

Step 2. Change it, for example, to 4:

root@ccgx:~# dbus -y com.victronenergy.charger.socketcan_can0_di0_uc12983 /DeviceInstance SetValue %4
retval = 0

Step 3. Wait a few seconds, and double check:

root@ccgx:~# dbus -y
com.victronenergy.bms.socketcan_can0_di0_uc10
com.victronenergy.charger.socketcan_can0_di4_uc12983

Device instance changed successful!

ve.can/changing_nmea2000_instances.txt · Last modified: 2020-06-28 21:36 by mvader