Go Down

Topic: NMEA 2000 Shield (Read 162378 times) previous topic - next topic

simonfe

Hi Timo,

Many thanks for the guidance, I was looking in the wrong place and had not seen the flags! I will have a play later to test it out

re Termination of the bus, yes understood. In this application I will only have the two devices as it is on a small motor launch and has no multi drop bus, just CAN breakout wired straight to the MFD. I guess that the MFD has no internal termination resistor so perhaps I should reduce the value of the termination resistor on the CAN breakout? It is working ok with the termination 120R on the breakout board, so maybe not an issue. I will later fit the same to our sailing yacht which has a properly terminated multi-drop bus so will not fit the terminator on that installation.

Thanks again
Simon

timolappalainen

 I have not met any MDF with internal resistor. It would not be good. On test system with short bus, one terminating resistor is normally enough.

autopilotNOR

Hello Timo,

after a half year now I have found some time again to take a look into NMEA again. This also due to my Princess gets a "new" engine which needs again a digital interface.

We started beside selling diesel based heaters for boat and caravan. I was thinking about if it is possible to control the heaters through the protocol. From the library, I found the "tN2kTempSource" class. Like the name show, it is just a source.

So do you know about devices which can control the cabin temperature through the NMEA2K protocol? I could find yet something about this from my device, the Raymarine Axiom 9. Would be great if I could make an interface which then could control the heaters through some kind of panel or already existing multifunction device.

I am talking about this device https://marine-varmer.no/produkt/planar-2d-12-tm-3995-12v-2kw-pu27/ , please this is not meant as advertisement here. We do not sell outside NO,DK,SE as well. It would be also interesting to control warm water heater which we use the engine water heater for together with a tank.
There is also a SMS module which can turn on and control the heaters. With the right interface it should be able to control whatever device in from the NMEA2K network where it would make sense.

So do you know about devices which are able to controle heating systems, do you have an example like a panel which could be mounted several places on the boat to controle the things?

timolappalainen

I do not know any common device for controlling heaters. The problem is that there is no standard messages for that, so every manufacturer would use proprietary messages.

On the other hand there temperature PGN:s 130312 (obsolote) and 130316 could be used for tempretature control. They both has field "Set temperature", which can be changed by standard way with Complex groupg function PGN 126208. So in principle your device can provide Cabin current temperature and set temperature with 130316. Then with other device - e.g. MFD it should be possible to change set temperature field on your device and so your heater would start to heat. Unfortunately I do not know does MFD:s support that functionality or if any does, how complex it would be change set temeperature. I mean that it may be behind several click.

Also you can make your own control panel and use proprietary PGN:s. With that you only win that the cabling could be used and you can provide current cabin temperature to the N2k bus. But there is also marketing question about certification. Even my library is "certification ready" the costs for getting you device certified are some thousand dollars. So how meaningfull it is for customers if you sell your system just NMEA 2000 compatible instead of NMEA 2000 certified, if they should connect it with critical network with navigation systems.

It may be easier to make own control panel with some wireless solution .

sprokkie

My plotter B&G vulcan 9 does not transmit or send the pgn for the binairy bank status  pgn 127501.
There is a way to get c-zone enabled i have to put in a config file.

anyone familiar with C-zone and know how to implement this ?
i eventualy want te set an output with my Vulcan 9

sunnycoastgreg

hello timo
i have got my teensy3.2 + CAN breakout board working
I can send test data (windmonitor example sketch to nmea) to MFD (Raymarine Axiom LH3 - latest versions 3.5)
data displays on MFD as expected - all good.
I can monitor the nmea2000 messages (using actisense reader) and see all my bus devices and respective PGN messages etc - all good. (inc those generated by the sketch)

However when trying the "battery monitor example" .. using same config etc .. i see the various
PGNs generated by the sketch (PGN 127506, 127508, 127513) however i cant get any data
to display on axiom/LH3.
Raymarine manual lists PGN 127506 as supported (latest 3.5 LH3 version) - however respective data fields on MFD are blank (eg battery SOC - ive tried each of the 5 battery instances it claims to support - and note the sketch is sending battery =1)
The LH3 manual states data items support for
"battery - voltage, current, temperature... data items available for up to 5 batteries"
(which also is the same number of engines supported)
the LH3 manual doesnt provide any details on how the available data items map to the list of supported PGNs .
The "engine" related PGNs have a "alternator voltage" field, but no mention of current or temp.
At presentI dont have any devices sending battery voltage (nor do i have an engine gateway,
so no battery voltage or battery data displayed)

So to the question : do you have any clues on which PGNs might be used for the battery temp, current? (other than PGN 127508 - which is not shown on the supported LH3 PGN list .. and the list doesnt have any obvious PGNs listed for battery ... very strange)

sunnycoastgreg

further to above
I added the additional hardware (USB port) to my teensy, and using listenersender
sketch I have now been able to use your simulator s/w .
... as an aside - a BIG thanks for providing these tools, tutorials and great work on N2K library...

I can get data from simulator to display on MFD (axiom LH3) - all good, and have confirmed that
indeed the MFD is supporting (& displaying) PGN 127508... this question solved.

However ... whilst using the simulator and changing various parameters and viewing them using
actisense reader & on MFD Ive discovered some inconsistencies:
1) engine load % appears incorrect?
- for example when setting to 30% in simulator, NMEA bus displays 14% on BOTH MFD & actisense reader.
2) engine fuel rate L/Hr
- for example when setting 11.5L/Hr in simulator, NMEA bus displays 0.0052cu m/hr (5.2L/Hr) on actisense reader AND MFD displays 5.2L/Hr also.

the other engine parameters all appear to be OK ... the simulator values match MFD and nmea reader values.

also a couple of additional questions about simulator
3) DC status PGN 127506 - i can enable it in simulator, and see values on nmea bus reader
however it shows 246% for SOC ... and there doesnt appear any way to change this in simulator?
I assume its hard coded?
(MFD doesnt display... but this may be because it expects a value of 100% or less?)
4) Alternator voltage (engine PGN) - these are displayed on MFD and nmea reader - but i cant find anywhere to change these on simulator , once again Im assuming these are hard coded?


eMTea

Hi!

Interesting thread!

I've been thinking about something like this myself, to input data to my MFD at the Garmin 721XS.
I've found a Datalink to NMEA2000 converter for all the engine data, but it does not include all the data I wish to see.

I would like to send to N2k network:
Oil Pressure (from an analog 0-5v sensor)
Raw water temp (from analog sensor)
Raw water pressure (from analog 0-5v sensor), but I don't know if the MFD has a display field for it though.

I see there is a lot of people using N2k and arduino, so please, can you guide me to a place to start learning about protocol and hardware, because can-bus systems is new to me.

timolappalainen

1) engine load % appears incorrect?
- for example when setting to 30% in simulator, NMEA bus displays 14% on BOTH MFD & actisense reader.
2) engine fuel rate L/Hr
- for example when setting 11.5L/Hr in simulator, NMEA bus displays 0.0052cu m/hr (5.2L/Hr) on actisense reader AND MFD displays 5.2L/Hr also.

the other engine parameters all appear to be OK ... the simulator values match MFD and nmea reader values.

also a couple of additional questions about simulator
3) DC status PGN 127506 - i can enable it in simulator, and see values on nmea bus reader
however it shows 246% for SOC ... and there doesnt appear any way to change this in simulator?
I assume its hard coded?
(MFD doesnt display... but this may be because it expects a value of 100% or less?)
4) Alternator voltage (engine PGN) - these are displayed on MFD and nmea reader - but i cant find anywhere to change these on simulator , once again Im assuming these are hard coded?


I'll try to check the errors above. Some values are just hard coded quicly to get some information to the bus.

timolappalainen

I see there is a lot of people using N2k and arduino, so please, can you guide me to a place to start learning about protocol and hardware, because can-bus systems is new to me.
You do not need to study protocol - it is bit complex. Just take my library (https://github.com/ttlappalainen/NMEA2000), check the examples and start to build your own systems.

eMTea

OK, thanks for the good work you have done, and shares with the community. :)

I will dig into this and see if I'm able to get familiar :P I've built a sensor based system before, with i2c OLED screen, but this bus system is alot more complex.

What happens if there is two similar PGN's at the same network? If I send some data that is already broadcasted by another device?

sunnycoastgreg

quote "what happens if there is two similar PGN's at the same network? If I send some data that is already broadcasted by another device?"

... nodes on nmea200 broadcast messages at various intervals, the frequency is different
depending on the type of data. (eg engine specific data has a rapid update, whereas something like airtemp would be much slower)
the nodes displaying the respective data (eg MFD) will typically react to whatever is the last recieved data.
so if you have more than one node sending the same PGN data fields,
you would expect the mfd to flip back and forth between the differing values, depending
on the rate of change,
however the frequency and concuurency will likely create some weird and unpredictable behaviour.

... bottom line .. avoid this situation!
.. timos libraries allow data fields within specific PGNs to be "not sent" ... so you can avoid this situation occuring.
( & with the hardware and listener example sketch , and the actisense reader on PC,
its possible to monitor the nmea bus to determine exactly what PGNs and fields are being sent,
and hence then avoid duplication of any data)

timolappalainen

To be strict each PGN has defined default update period. Like Engine rapid data has 100 ms and engine dynamic data 1000 ms. I am not sure about temperature PGNs, but if I remember right they are also 1000 ms.

Note also that some PGNs like 130312 Temperature, 130316 Temperature Extended Range has "Instance" field. So there can be several devices sending same PGN and there is no problem, if the instance field differs. Also engine rapid data PGN 127488 has instance field, but that is locked to your engine or generator.

On newer MFD:s one can also define, which device data they show. So there can be several devices sending Depth or GPS position and then you define on MFD, which one it uses. In that case MFD will lock data to device "Name", which is unique for all devices on the bus. Either on this case there is no harm for multiple devices sending same PGN. If I remember right, this locking is mandatory on certified devices.

sunnycoastgreg

Timo, i think you are partially correct in respect to defining source for certain PGNs,
and Im sure it varies from mfr to mfr.
Im only using my Raymarine Axion LH3 as basis for my view...
The LH3 allows user to lock the data source for depth, speed thru water, heading, GPS, wind, time & date.
Hence with multiple sources of same (above) PGN, its possible to select (lock) which
the MFD will use.
However I cant find any reference in LH3 for selecting or locking other PGN sources,
eg fuel tank, water tank, battery, environmental etc.
So one does need to be careful with some of these additional data sources to prevent a clash.


timolappalainen

Fuel tank, water tank, battery, environmental etc. PGNs works with instance field. E.g. Garmin GMI 20 can not either lock to specific source for those, but you can see different instances. Also GMI does not show anything selectable, if you do not have several instances available. But as you said one has to be carefull,but on the other hand why you would have several sensors on same tank? And if they are on different tank, they re different instances.

Go Up