NMEA 2000 Shield

Hi all,

Is it possible to send Roll of the boat without sending Heading? If not and there are two devices sending Heading how does one select which Heading to use/read in third one?

Heading is on PGN 127250 and roll PGN 127257. So simply do not send heading message.

It is also possible to leave data out from message, which has multiple fields by defining it as NA. Then if there is e.g. two different devices sending engine data with PGN 127489, one can do

SetN2kEngineDynamicParam(N2kMsg,0,EngineOilPress,EngineOilTemp,N2kDoubleNA,N2kDoubleNA,N2kDoubleNA,N2kDoubleNA);

and other

SetN2kEngineDynamicParam(N2kMsg,0,N2kDoubleNA,N2kDoubleNA,EngineCoolantTemp,AltenatorVoltage,N2kDoubleNA,N2kDoubleNA);

The receiver should combine data right.

If there are really two devices sending heading, there should be way on receiver side to select, which one to use. Some MDF:s has that some does not. if you are making your own device, you should use my N2kDeviceList module and lock the device you want to follow to device "NAME" not source address, since that may change due to address claiming.

PGN 127257 contains Yaw which is commented as Heading in radians. I will test today if the display will display it too as heading. Should be able to select correct data to be shown based on device name if PGN 127257 heading is also shown as heading . Also should be able to select heading for the third device by sending and reading PGN 127250.

thank you

You can also do:

SetN2kAttitude(N2kMsg,0xff,N2kDoubleNA,N2kDoubleNA,Roll);

Hi to all

Sorry that my question not linked with this great NMEA library, but it is experienced NMEA-community so I will try...

I make own stm32 project.

Does anybody has experience with correct PGN 127497 generation? to be displayed on MFDs.

We produce 2 PGNs: 127497 and 127489, they both longer than 2 bytes and must be sent in separate packets. We do it in the same procedure for both, but results are different:

Checked by Actisence reader software: https://imgur.com/3FsuMOQ

PGN 127489 is displayed correctly, assembled from 2 packets PGN 127497 is displayed as 2 separate messages, first one contains correct information (but named as 8-byte message, though it has 9 bytes) but second one totally not correct, belong to another engine instance and ruin the information on the display when we connect real device under this instance.

https://imgur.com/Ytx5Ih1

May be somebody has an example of raw CAN bus log with successful PGN 127497 sending and receiving.

many thanks!

The PGN127497 is fast packet and not listed on library fp messages, so it can not receive it right. I can add this in coming days.

If you need it immediately, other option is that you add it to known list with tNMEA2000 class function ExtendFastPacketMessages and create handlers by yourself. You can then switch handlers, when I have added it. Please do not add handlers to library modules, so your own handlers will not be deleted on library update.

Thank you for reply, Timo

We didn't use your great library for Arduino, we made it from scratch on our STM-controller (already had J1939 implemented before).

PGN 127489 is fast packet message too and decoded right by Actisense. So it is confusing for us why same algorythm for 127489 and 127497 provides different results when connected to real devices (Actisense, MFD).

Will try your library too (have arduino Duo) and compare, thanks!

Hi Timo,

I could not find the multimedia class 125 and functions (130&140) so I guess it is not implemented. Could that be interesting as there is so less device supporting the nmea2k? Thought about building a media central controllable by the MFD.

There is no multimedia PGN functions on the library. On N2kMessages module are the most common PGNs. It is pretty simple to create new module e.g. N2kMultimedia.h/.cpp and write functions as in N2kMessages.

Hello all, For starters, I would like to thank Timo for the wonderful work on the library. I'm impressed.

I'm doing tests on the Arduino Mega and MCP2515. At the moment everything works very well. On this weekend I will be testing with the ST-NG network with Raymarine devices: i70, i70s and Ray260 radio with AIS receiver.

My question is about the NMEA2000ToNMEA0183 example. Have you already tried to translate AIS messages from NMEA2000 to NMEA0183? I would like to display AIS data on OpenCPN.

Best regards,

AIS conversion has been on my list for long time, but unfortunately since I do not need it just now, it is not on the top of my list. And I have pretty much work to do.

Do you have any examples of how to use PGN 127489 with Arduino DUE? I read all the documentation, maybe I did not understand, but I only get the messages on the serial.

22:44:58.492 → Start add 0
22:44:58.492 → Initialize buffers
22:44:58.492 → CAN device ready
22:44:58.679 → Start address claim for device 0
22:45:07.684 → PGN 127489, frame:3/4 send failed
22:45:08.688 → PGN 127489, frame:0/4 send failed
22:45:09.696 → PGN 127489, frame:0/4 send failed
22:45:10.704 → PGN 127489, frame:0/4 send failed

Regards

timolappalainen:
Heading is on PGN 127250 and roll PGN 127257. So simply do not send heading message.

It is also possible to leave data out from message, which has multiple fields by defining it as NA. Then if there is e.g. two different devices sending engine data with PGN 127489, one can do

SetN2kEngineDynamicParam(N2kMsg,0,EngineOilPress,EngineOilTemp,N2kDoubleNA,N2kDoubleNA,N2kDoubleNA,N2kDoubleNA);

and other

SetN2kEngineDynamicParam(N2kMsg,0,N2kDoubleNA,N2kDoubleNA,EngineCoolantTemp,AltenatorVoltage,N2kDoubleNA,N2kDoubleNA);

The receiver should combine data right.

If there are really two devices sending heading, there should be way on receiver side to select, which one to use. Some MDF:s has that some does not. if you are making your own device, you should use my N2kDeviceList module and lock the device you want to follow to device “NAME” not source address, since that may change due to address claiming.

When you get text "Send failed", it means that CAN controller can not send frames to bus. Most common reasons are: 1. Missing 120 ohm bus teminators. 2. Mixed CANL / CANH connection 3. Bad CAN connection 4. Wrong tranceiver connection on processor or controller. 5. Broken tranceiver

Hey folks, i am probably one of the so many people trying to make their arduino work with the nmea2000.

my project wasn't that hard till now.

all i wanted to do was to control the simrad autopilot computer "AC12" and receive his rudder pos back.

but the system cant find the AC12 at all.

i use the actisense ngt-1 to look for devices and it does find the arduino a raymarine interface but not the simnet connected AC12....

could it be because of the diferences between Seatalk"NG" and simnet that the AC12 can not be seen?

does anyone have any experience with the simnet system at all?

rn what ever i do results in "Adress claim info - Failed" and it had to be something with the AC12

Simnet, Seatalk NG and NMEA 2000 differs only in connectors. If you follow right NMEA 2000 cabling - totally 2 termination resistors on whole bus at longest end, all devices should see each other.

Where do you get "Adress claim info - Failed".

What NMEA 2000 library you use for Arduino?

timolappalainen: Simnet, Seatalk NG and NMEA 2000 differs only in connectors. If you follow right NMEA 2000 cabling - totally 2 termination resistors on whole bus at longest end, all devices should see each other.

Where do you get "Adress claim info - Failed".

What NMEA 2000 library you use for Arduino?

i use your library including the nmea2000_due library. this works fine the ngt reads every pgn send by the arduino. but when i connect the ac12 to the network it simply hangs. maybe also the reason why i receive Adress claim info - Failed. i receive the error in the actisense software. but i am pretty sure that the cabling is correctly connected but who knows what swapping the wires does on the AC12

I still expect there is some connection failure with AC12. Did you use Simnet-NMEA2000 adaptor cable? With that connection should be right. If not you have to find out CANH, CANL and power pins and connect them right to the bus. Note also that you should not have termination resistors on both simnet and NMEA2000 bus. When you connect them directly together, it is like one bus and must have totally two termination resistors.

well, There is one bus with both resistor terminator's

on this bus there is. The power supply, The Arduino, The NGT-1 And the AC12 i replaced the AC12 with an Raymarine AXIOM mfd to check the bus and there is no problem as well.

could there be devices that need an specific pgn to reply on the bus? could there be someting like this?

Must me either your device ir the connection to it as I did have the AC12 box setup tring to do commissioning and initial setup on my test NMEA 2000 setup at home. I could see the device no problem what so ever

well, then i might test the device for nmea 0183. who knows what pops out. or the device is simply broken.