NMEA 2000 Shield

Hi,

I'm new to these foruns. First of all thanks to everyone for sharing the information. I'm trying to send data from Arduino battery monitor example sketch to my N2k bus consisting of Garmin 720, 2 GMI10, one VHF 300i and 1 Airmar Intelliducer. I have one MCP2515 controller with TJA1050 transceiver working at 8 Mhz. From what I've realized the library is set for 16 Mhz as default. How can I change it to 8Mhz?

Thanks for your answers,

Gibas

Hi,

You should edit beginning of you BatteryMonitor sample with #define USE_MCP_CAN_CLOCK_SET 8:

#include <Arduino.h>
//#define N2k_CAN_INT_PIN 21
#define USE_MCP_CAN_CLOCK_SET 8
#include <NMEA2000_CAN.h> // This will automatically choose right CAN library and create suitable NMEA2000 object
#include <N2kMessages.h>

Hi,

As described in the begining of NMEA200_Can.h file.... I don't know how I've missed it. Thanks for your fast reply.

Regards,

Pedro

Hi!

I have trouble with 127506 PGN DC Detailed status.

I write any value of field 3 and display - "0%" !!!

Hi,

Which display you use? Do you have right type for value?

There is example MessageSender, which also sends that message as sample. I just tested that with NMEA Reader and it shows values as they have been set on sample code. One can test MessageSender code with single board by setting NMEA2000.EnableForward(true); on setup and then opening NMEA Reader to board port. You can test your code in this way too.

Thank you for you answer, problem is out)

I need another little help.

I try coding PGN 127505 and problem with field of capacity in liters.

Field is 8 byte , I don't know how to translate simple value (ex. 100) into 8 byte field ....

Are you using NMEA2000 library and N2kMessages.h/.cpp? In N2kMessages.h there is simple definition for call: SetN2kPGN127505 or SetN2kFluidLevel(tN2kMsg &N2kMsg, unsigned char Instance, tN2kFluidType FluidType, double Level, double Capacity); , where you simply set Capacity as 100 e.g.

SetN2kFluidLevel(N2kMsg,1,N2kft_Fuel,51.2,100); NMEA2000.SendMsg(N2kMsg);

This will set current fuel level to 51.5% of 100 l capacity.

another question. I try to use your library with arduino nano and can bus shield 8MHz.

" Arduino: 1.6.7 (Windows XP), Плата:"Arduino Nano, ATmega328"

In file included from C:\Documents and Settings\Admin\Мои документы\Arduino\libraries\NMEA2000-master/NMEA2000_CAN.h:85:0,

from C:\Documents and Settings\Admin\Мои документы\Arduino\Nmeatest\Nmeatest.ino:19:

C:\Documents and Settings\Admin\Мои документы\Arduino\libraries\NMEA2000_mcp-master/NMEA2000_mcp.h:58:84: error: 'MCP_16MHz' was not declared in this scope

tNMEA2000_mcp(unsigned char _N2k_CAN_CS_pin, unsigned char _N2k_CAN_clockset = MCP_16MHz, unsigned char _N2k_CAN_int_pin = 0xff);

^

In file included from C:\Documents and Settings\Admin\Мои документы\Arduino\Nmeatest\Nmeatest.ino:19:0:

C:\Documents and Settings\Admin\Мои документы\Arduino\libraries\NMEA2000-master/NMEA2000_CAN.h:95:27: error: 'MCP_8MHz' was not declared in this scope

define MCP_CAN_CLOCK_SET MCP_8MHz

^

C:\Documents and Settings\Admin\Мои документы\Arduino\libraries\NMEA2000-master/NMEA2000_CAN.h:105:39: note: in expansion of macro 'MCP_CAN_CLOCK_SET'

tNMEA2000_mcp NMEA2000(N2k_SPI_CS_PIN,MCP_CAN_CLOCK_SET,N2k_CAN_INT_PIN);

^

exit status 1

?

Hi,

You have the same problem as nilsal on this forum message #92. I responded on #93 that you should not use original seed studio library. Instead use https://github.com/peppeve/CAN_BUS_Shield. That has been also mentioned on my library documents.

Timo

Hi Timo and all !

This is my first post but I have been reading everything you did with N2k and all about boats ! Thank you very much for sharing all your work. I appreciate it very much !

I am retired in electronics but have been living the computer age since the day of the 80 series (and even the 40 !) did some assembler with the 6502 but I am new in Arduino and programming. I have been interested in the N2k CAN since my friend has a boat using this network. So I need to help him with electronics.

However I have 2 due's working with CAN in a closed N2k network. All is working FB including a short program I put together from bits and pieces of programs including your work that sends waterspeed to N2kbus from a paddle speed sensor. It works OK including the Product and Device information but I am shy to share it as it probably would not survive experts opinion,hi.

Anyway I am able now to inspect my friends N2k network and perhaps do some work in the future. I would like to look at the Address Claiming in the near future. I hope to be able to learn more about this N2k with the Arduino due and have some NMEA0183 devices connected too. Please continue your work !

Thank you

Fred

Just found this as I am starting a project on a new wake sport boat. I have been long time electronics guy but mostly in the analog realm until the last few years. That said I have been coding for a very long time and do it for a living. It is all just syntax and IO so I figure with enough time I will be able to figure out N2K.

My intent is to automate a few things that I normally could have done without the need for N2K. The issue is that the newer wake sport and day boats are moving to custom built in MFD with joystick control knob and button devices for the human interface that all communicate of N2K. Boats in this class are getting far more complex as they are including features from the factory that use to be add ons. The custom MFD in my boat handles the task of communicating over the engine can bus, the radio can bus, NMEA 0183, and NMEA 2000. The MFD also communicates with a gateway over N2K in order control things such as lights, bilge, horn, etc. The only things I need to decipher for my current project are GPS and all of the joystick/button commands. Obviously there will be a few undocumented PGNs but I hope to be able to figure them out. I am first going to attempt to use the actisense listener sketch to see what is being broadcasted but from there I may need a hand as I am new to N2K. The upside is I may discover and help document a few PGN on the HID side of things which are becoming more common.

Hi syntaxio,

You have interesting job to discover undocumented PGN:s. Note that there are pgn.h under SignalK project and PGNDefs.N2kdfn.xml (latest version under www.kave.fi/Apps) under OpenSkipper, which already has a lot PGN information. Also it is easiest for reverse engineering to minimize bus data by switching devices off.

Anyway do not hesitate to ask help.

I have tried sending a private message a few days ago but not sure if it worked. Long story short is I have isolated the proprietary PGN and values that I need to be able to read and write. Just need to get them added to the library and having just a bit of brain fart trying to do that. Could certainly use a hand at this point.

Hi,

I do not know, why I did not receive notify for private message.

Since these are proprietary, it is best to create own message files for these. So if you have device manufacturer B&G, you could create message files N2kBandGProprietaryMessages.cpp and .h. Then you create message creation and parsing messages similar as they are on N2kMessages.cpp and .h. Note also that since different manufacturers can use same PGN:s for proprietary messages, it may be that there is no sense name functions as they are on N2kMessages e.g. SetN2kPGN127489. Instead just use informative name e.g. // Sonic hub proprietary PGN 130816 void ParseN2kSonicHubInfo(...)

So you do not need to add your PGNs at this point to library. When you have tested handling functions for then, it would be greate to get them published for possible other users.

Without information about you PGN structure I can not say more for now.

Does anyone have a Garmin chart plotter that uses a NMEA 2k GPS? I can decode all the GPS PGNs, but I can't turn on WAAS and GLONASS. Garmin is no help at all, and I do not suggest using their NMEA 2k products as a result since they wont support them outside of their own products which violates the whole point of NMEA 2k.

By the way, Maretron manuals are a good source for NMEA 2k PGN information.

I prefer also to look CanBoat project pgn.h (https://github.com/canboat/canboat/blob/master/analyzer/pgn.h) and derived OpenSkipper PGNDefns.N2kDfn.xml (see http://openskipper.org/). Both has better description of data than Maretron Manuals. I have some fixes for OpenSkipper PGN definitions, which has not yet been published, but I'll do it within some weeks.

I am working with Maretron products (FFM100 and FPM100 sensors), reading data in NMEA2k and sending in RS232 port. I have decoded FPM100 sentences, but i faced difficulties in FFM100 65286 / 65287 propietary sentences. I would need information about those fields, to decode info and later send it. I would appreaciate if you could provide any kind of information.

I am using a Arduino Mega and CANbus shield for sending data through to a NMEA 2k network. I am successfully sending the following PGNs and displaying on an a98 Raymarine MFD

SetN2kEngineDynamicParam SetN2kEngineParamRapid SetN2kDCBatStatus SetN2kEnvironmentalParameters

However, I am trying to construct my own AIS messages and send SetN2kAISClassAPosition but it is not being displayed on a98 Raymarine MFD even though it does appear to be 'read' on the actisense nmea reader.

SetN2kAISClassAPosition(N2kMsg, 1, Repeat, 123456789, 26.396, -80.075, 1, 1, 1, 20, 20, 30, 0, NavStatus);

has anyone successfully sent AIS messages?

Eric

Dear colleagues, we are producing fuel flow meters. And now making Nmea2k version of differential type fuel flow meter (can be easy installed for supply-return flow engine).

Would be fine to have some cooperation with other NMEA2k investigators.

We now can send messages to Lowrance display:

http://imgur.com/a/PWNBU http://imgur.com/a/PWNBU

but I understand it is point-point communication, in real big NMEa2k network it will create problems

We are lacking address claiming support. And PGN list report.

SO if any can share this docs with us we can send our products for example as X-mas gift :)

Hi,

Are you using my NMEA2000 library (https://github.com/ttlappalainen/NMEA2000). It has automatic address claiming support etc.

There is also progress with "Remove Arduino dependencies" under issue with that name.

Funny that I am also building fuel flow/engine monitor just for my own.