User Tools

Site Tools


ve.can:changing_nmea2000_instances

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
ve.can:changing_nmea2000_instances [2019-08-15 12:17] – replace venus-device with GX device guy_stewartve.can:changing_nmea2000_instances [2023-06-28 13:32] (current) – Update links sloges
Line 3: Line 3:
 ===== 1. Introduction ===== ===== 1. Introduction =====
  
-Instances are used in an NMEA2000 network to identify multiple similar products connected on the same network.+==== 1.1 Purpose of  NMEA 2000 instances ==== 
 +Instances are used in an NMEA 2000 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.+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 N2K network. For the displays to show these values at the right place, they need to know which voltage belongs to what battery. That is what instances are for.
  
-For the displays to show these values at the right place, they need to know which voltage belongs to what battery. 
  
-=== How can I change the instances===+==== 1.2 Different types of instances ====
  
-This document describes three options:+There various types of instances, and for marine systems are two that matterthe Device instance and the Data instance. The data instance goes by various different names, like Fluid instance, Battery instance and DC instance.
  
-  - Use [[http://www.actisense.com/|Actisense]] software & hardware. Can change both the device- and data-instances  +Details and differences of each type are explained in detail in the [[https://www.victronenergy.com/media/pg/Cerbo_GX/en/marine-mfd-integration-by-nmea-2000.html|Cerbo GX manual, NMEA 2000 chapter]].
-  - Use [[https://www.maretron.com/|Maretron]] software & hardware. +
-  From the [[open_source:ccgx:commandline|commandline]] of a [[venus-os:start|GX device]]. Note that this is a software developer trick. Not for any day use.+
  
-=== Device instance vs the data instances === +**WARNING**: whilst it is possible to change the Battery and DC instances on a Skylla-i battery charger, changing those will render it impossible for a GX device to properly read the data. This is because the GX device expects the charger's output one to be on Battery & DC instance 0output two on Battery & DC instance 1and output three on Battery & DC instance 2. Changing the fluid instanceas well as other data instances for PGNs transmitted by a GX device on a NMEA2000 network using its NMEA2000-out featureis no problem.
-There are two types of instancesdevice instances and data instancesAnd depending on the make and model of the displays being used (GarminMaretronRaymarineetcetera)you need to change one of them or both.+
  
-Both the device instance and the data instance of a product can easily be changed with both Maretron N2Kview as well as and Actisense PC software.+Note that its only rarely necessary to change either device or data instances like the Fluid-, Battery- and DC-instance. See next section.
  
-=== Required hardware === +==== 1.3 Recommend instancing setup for main MFD brands ====
-Changing the device instance requires an usb-canbus adapter to link the CAN-bus network to your computer:+
  
-  * For Actisense, see the [[http://www.actisense.com/product/nmea-2000-to-pc-interface-ngt-1/|Actisense NGT-1]] +The only common use case we encounter in testing and support where it is necessary to change instances is with older Raymarine hardware & software:
-  * For Maretron, see their [[https://www.maretron.com/products/usb100.php|USB100]]+
  
-=== Related information === +    * Raymarine i70: max number of tank levels is 5; fluid instance 0-4 and type must be fuel. 
-For more detailed information, see also the FAQ in our [[https://www.victronenergy.com/upload/documents/Whitepaper-Data-communication-with-Victron-Energy-products_EN.pdf|Data communication whitepaper]].+    * Raymarine i70smax number of tank levels is 5; fluid instance 0-4 and type must be fuel. 
 +    * Axiom MFDs: per Lighthouse version 4.1.75, a maximum of 16 tanks can be connected; fluid instance 0-15.
  
-And the main [[ve.can:nmea-2000:start|NMEA2000 integration guide]].+Further details per brand are in these documents:
  
-===== 2Changing the device instance with Actisense =====+  * [[venus-os:mfd-raymarine#nmea_2000|NMEA 2000 configuration for Raymarine]] 
 +  * [[venus-os:mfd-garmin#nmea_2000|NMEA 2000 configuration for Garmin]] 
 +  * [[venus-os:mfd-furuno#nmea_2000|NMEA 2000 configuration for Furuno]] 
 +  * [[venus-os:mfd-navico#nmea_2000|NMEA 2000 configuration for Navico (B&G, Simrad and Lowrance]]) 
 + 
 +==== 1.4 Different methods for setting up instances ==== 
 + 
 +As the NMEA2000 protocol prescribes commands to change an instance by sending commands to a device, there are various ways of changing instancesThe purpose of this document is to describe all commonly used methods. 
 + 
 +Besides the here described methods there are more, for example some MFDs allow changing instances as well. 
 + 
 +  - GX Device: Device- instances only 
 +  - Actisense software + NGT-1 USB: Device- as well as data-instances  
 +  - Maretron software + USB adapter: Unknown 
 +  - Commandline of a [[venus-os:start|GX device]]: Device- as well as data-instances. Note that this required advanced Linux skills; and is listed here only for benefit of experienced software developers 
 + 
 +Chapter 2, 3, 4, 5 and 6 explain these methods in detail. 
 + 
 +==== 1.5 Further reading on Victron and NMEA 2000 ==== 
 + 
 +  * [[ve.can:nmea-2000:start]] 
 +  * [[https://www.victronenergy.com/upload/documents/Whitepaper-Data-communication-with-Victron-Energy-products_EN.pdf|Data communication white paper]] 
 +  * [[https://www.victronenergy.com/media/pg/Cerbo_GX/en/marine-mfd-integration-by-nmea-2000.html|Cerbo GX manual, NMEA 2000 chapter]] 
 +  * [[https://community.victronenergy.com/topics/NMEA%202000%20-%20N2K.html|NMEA2000 related discussions on Victron Community]] 
 + 
 +===== 2. GX Device: changing device instances ===== 
 + 
 +The Settings -> Services -> VE.Can -> Devices menu shows a list of all devices on the N2K / VE.Can network: 
 + 
 +{{  :ve.can:device_instance_gx.png?direct&400 |}} 
 + 
 +By clicking the right button, a detailed menu is shown: 
 + 
 +{{  :ve.can:device_instance_detail_menu.png?direct&400 |}} 
 + 
 + 
 +===== 3. Actisense: changing device instances =====
  
 Note: make sure to use a recent Actisense driver. Otherwise the instance might not ‘stick’. Note: make sure to use a recent Actisense driver. Otherwise the instance might not ‘stick’.
 +
 +Requires the [[http://www.actisense.com/product/nmea-2000-to-pc-interface-ngt-1/|Actisense NGT-1]].
  
 Changing a device instance: Changing a device instance:
Line 46: Line 80:
 {{:ve.can:device_instance.png?direct&}} {{:ve.can:device_instance.png?direct&}}
  
-===== 3Changing a data instance with Actisense =====+===== 4. Actisense: changing data instances =====
  
-Changing a data instance:+Requires the [[http://www.actisense.com/product/nmea-2000-to-pc-interface-ngt-1/|Actisense NGT-1]]. 
 + 
 +Step by step instructions:
  
   - Open Actisense NMEA Reader   - Open Actisense NMEA Reader
   - Select data view (tab selection is at the bottom left)   - Select data view (tab selection is at the bottom left)
-  - Right click the PGN: \\ {{:ve.can:data_instance_0.png?direct&}} +  - Right click on the PGN numberNote that this will only work on PGNs that allow changing their data instance (first screenshot below) 
-  - And change the value: \\ {{:ve.can:data_instance_1.png?direct&}} +  - And change the value (second screenshot below)
- +
-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.+Notes: 
 +  * The Battery Instance and the DC instance are the same value within Victron products. 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.   * 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.
 +  * Changing the fluid level instance using Actisense has a bug. Probably due Actisense seeing it as 8 bit number; while in the definition it is a 4 bit number. Work around: using the GX, set the fluid type to Fuel (0), then using Actisense change the fluid instance to the desired value, and then using your GX, set the type back to the desired type.
 + 
 +{{:ve.can:data_instance_0.png?direct&}}
  
-===== 4Changing Instance Using Maretron N2KAnalyzer =====+{{:ve.can:data_instance_1.png?direct&}}
  
-Maretron understands that it is sometimes difficult to know whether a particular product uses device instance or if it uses data instance to uniquely identify itself on an NMEA 2000 network. For this reason, Maretron uses a term called "Unique Instance" where the N2KAnalyzer software tool automatically determines if a particular device uses device or data instances. 
  
-Open N2KAnalyzer and make sure that the "Unique Instance" column is turned on (i.e. checked) using the Setup>Columns menu item. 
  
-{{:ve.can:maretronn2kanalyzeruniqueinstancecolumn.jpg?850|}}+===== 5Maretron N2KAnalyzer =====
  
-Within the N2KAnalyzer main window, any cell with 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 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.+Maretron uses term called "Unique Instance" where the N2KAnalyzer software tool automatically determines if a particular device uses device or data instances.
  
-{{:ve.can:maretronn2kanalyzeranalyzeinstancing.jpg?850|}}   +WARNINGAt Victron we do not understand what and how the Maretron software works with regards to thisWe 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.
  
-===== 5. Changing the DeviceInstance from the CCGX command line ===== +===== 6. Changing the instances from the GX command line ===== 
-Instead of using Actisense or Maretron software, it is also possible to change the device instance from the Color Control shell. To get root access, follow these instructions: [[ccgx:root_access]]+ 
 +==== 6.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: [[ccgx: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. 
 + 
 +==== 6.2 Warning: better use an Actisense! ==== 
 + 
 +Note that the methods explained in this Chapter 6 are usually not recommended. Use an Actisense instead, see chapters 3 and 4 instead. 
 + 
 +==== 6.3 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. 
 + 
 +<code> 
 +# dbus -y com.victronenergy.vecan.can0 / GetValue 
 +value = { 
 + 'Devices/00002CC001F4/DeviceInstance': 0, 
 + 'Devices/00002CC001F4/FirmwareVersion': 'v2.73', 
 + '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] 
 +</code> 
 + 
 +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: 
 +<code> 
 +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]. 
 +</code> 
 + 
 +==== 6.4 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. 
 +<code> 
 +Settings/Vecan/can0/Forward/battery/256/BatteryInstance0            <- Data instance for main voltage measurement 
 +Settings/Vecan/can0/Forward/battery/256/BatteryInstance1            <- 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          <- Battery voltage & current 
 +Settings/Vecan/can0/Forward/solarcharger/1/DcDataInstance1          <- 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 
 +</code> 
 + 
 +==== 6.5 Old method ==== 
 + 
 +(Only allows changing Device instances - not data instances as used in the NMEA2000-out function)
  
-Once logged into the shell, follow below instructions. Note that the example shown changes the device instance of a Skylla-i. The device instance of a VE.Can connected MultiPlus or Quattro can be changed as well. It will show as  ''%%com.victronenergy.vebus.socketcan_can0_di0_xxxx%%''. 
  
 Step 1. List the devices: Step 1. List the devices:
Line 101: Line 228:
 Device instance changed successful! Device instance changed successful!
  
- 
-===== DISQUS ===== 
-~~DISQUS~~ 
  
ve.can/changing_nmea2000_instances.1565864224.txt.gz · Last modified: 2019-08-15 12:17 by guy_stewart

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki