NMEA 2000 Shield

Yes, but unfortunately old devices does not support 130316. So if you are making TemperatureMonitor like system for your boat, you have to check does your viewers support new PGN.

Hey Timo,

I have a question.

So first I have participate on some courses about Arduino programming and got much more used to the basics and do understand now as well the library you gave to the world! I hope that I don´t need to ask anymore a lot of stupid questions! :slight_smile:

//To 1. part. I just tested it out, looks to be working fine! The jumping around which happend with the internal reciever just disappeared and the position is more accurate now as well. I am not anymore on map at my neighbours house. So that worked perfect! It took some time until the MFD recognized the new signal but finnaly I could selet it.

So here to my my question:

I got this GPS module from Linx which is a lot better than the one I have in my MFD ( I think and hope so at least). So the Linx GPS outputs "NMEA" sentences to serial. I got so far know with the GPS it self so I know how to adjust the settings of the module like setting baud rate, wich sentences to output to serial, frequency and so on.

Now I´d like to use this device instead of the one which is onboard of the MFD. How to do that on the MFD is not a big deal. It is looking for GPS / GNSS devices on the bus.

My actual question is:

    • already fixed (working fine)
      The device outputs NMEA sentences through serial, not more detailed specified. Is that right that these sentences is the NMEA0183 protocol?

If so, can I than just simply use the NMEA0183ToNMEA2K sketch to translate all the information comming from the module to the NMEA2k bus or do I need to read every sentences and cut into the peaces to use the NMEA2000 library positioning / navigation part and forward it by this way to the 2K bus? I looked into the NMEA0183ToNMEA2K library and have seen there all the positioning information. That´s why I thought this can be the right start.

I am looking for some details if there exist any standart for the frequencies used for rapid data and longer periodly send data. What I mean is how many times per second is rapid and how ofteen is the rest of not so fast changing data to be send to the bus?

Mostly there are stupid answers instead of stupid questions.

  1. If it uses serial, it is most likely NMEA0183 format. And you need to know right baudrate that is using. Note also that serial is a bit wide definition and hopefully you also know the physical output, since it can be TTL, RS422 or RS232. Connecting RS232 to TTL may burn TTL side.

NMEA0183ToN2k does a lot and it seem to already have basic GPS conversion. There is no direct way to do that. NMEA0183ToN2k reads data from NMEA0183 and collects it to variables (see BoatData.h). When it has enough data, it will forward it. It seem to send at least GNSS, SetN2kCOGSOGRapid and Heading messages.

  1. GNSS will be normally sent with 1 sec period. Heading and COGSOGRapid will be send with 100 ms or 50 ms period. NMEA0183ToN2k sends all messages as they arrive, since there is no data send faster.

Thanks Timo!

The gps/gnss i have is using ttl. I could connect it right to serial1 and it was working out of the box with the 0183to2k library. Some things are missing, but before I need to take a closer look on what exactly the output is from the module to compare what I recieve on the MFD / bus and what exactly is send before I can say what is missing.

I ordered to PCB tofay which I found on OSHPark. They where for AIS implementation. I was missing the tx part onboard and since this was a hell of expensive i thought to give this one a try!

The application part is on github: GitHub - peterantypas/maiana: MAIANA™ is the first Open Source AIS transponder. It proudly raises an extra long middle finger to the marine electronics industry, government overregulation and everything else that gets in the way of innovation in this space. by Peter Antypas.
One off the "Fans" was wondering about NMEA2K since that one is based on NMEA0183, I guess due to rs232 radio and MFD connection.

How ever, since they where talking about implementation of NMEA2K I posted them the link to your github repository as well to this post. I hope that is ok for your..

If somebody is interessted, Web of Peters github repo: GitHub - peterantypas/maiana: MAIANA™ is the first Open Source AIS transponder. It proudly raises an extra long middle finger to the marine electronics industry, government overregulation and everything else that gets in the way of innovation in this space.
OSHPark files and details:
RF part: OSH Park ~
Logic part: OSH Park ~

Since AIS is already a part of the library I thought may it would be easy for them to translate it to nmea2k (easy thought). So we will see..

timolappalainen:
One company has started to make Teensy based sensor boards for NMEA2000. They contacted me due to my library and send me some sample boards. There is one nice ready IMU board. I can ask are they ready to sell.

Hi Timo,
compliments for your libraries.

Have you any news about these Teensy sensors?
I would like to make a 9-axis compass to add at NAC-1 autopilot. My target is Lowrance Precision-9, this is what she do:

  • Messages: PGN 127250, 127251, 127257, 127252
  • Data output: Magnetic heading (20 Hz), rate of turn (20 Hz), pitch/roll (10 Hz), heave (10 Hz)
    with a Roll/Pitch range of +-45° and Haeding accuracy +-2°

Do you think it's doable with Teensy board and your libs?
Thanks

Unfortunately thy are not yet on market, but the board is nice.

There is no problem with library to do that except 127252, which is unknown PGN. Teensy boards are good for that. If your prject is large as I would think that compaas would not be, Teensy 3.2 should be enough.

Hello,
I'm just about to start a project building a tacho, engine hrs, temp and display it on a Raymarine MFD. I have a couple of questions before I start and apologies if these have been answered before, ( I have been through the 28 pages and couldn't see it)

  1. Is it possible to connect the CAN bus directly to the SeaTalk bus?

  2. The MFD looks for an Engine manufacture when scanning for new devices, do I have to emulate my engine manufacture? (I have a Yanmar)

Many thanks for any pointers, help.

  1. Which Seatalk version. Read NMEA 2000 - Wikipedia (Raymarine SeaTalk 2, Raymarine SeaTalkNG, Simrad Simnet, and Furuno CAN are rebranded implementations of NMEA 2000, though may use physical connectors different from the standardised DeviceNet Micro-C M12 5-pin screw connector, all of which are electrically compatible and can be directly connected) and make your own decicions.

  2. It should not be necessary. MFD:s should just read PGN127488 and PGN127489 information from any manufacturer.

Brilliant Timo, thanks for the fast response.

gwmurray:
I'm just about to start a project building a tacho, engine hrs, temp and display it on a Raymarine MFD.
.....
(I have a Yanmar)

Hi gwmurray, i have a Yanmar me too, mine is 4JH4 model.
Some infos hoping help you: original gauges are from VDO (mine are EU model, 40-120 C° for water temp and 0-10 bar for oil press) and the PPR (pulse per revolution) value at W wire (tachometer) is 10,29 with Hitachi 80A or 12,10 with Valeo 125A alternator

timolappalainen:
Unfortunately they are not yet on market
.....
There is no problem with library to do that except 127252, which is unknown PGN.

Hi Timo, just reached new hardware from Mouser...it's my first time with Teensy.

I started loading TemperatureMonitor, but i can't see nothing in Actisense Reader; so uncommenting also:

NMEA2000.SetForwardType(tNMEA2000::fwdt_Text);

i have that in Serial Monitor:

PGN 130312 send failed
PGN 130311 send failed
PGN 130310 send failed

What i'm doing wrong?

What hw you have? It is possible that you hw has enable signal for trasmitter. On library there is no automatic enable. So check from schematics it tranceiver tx enable connected permanetly to enabled state (as in my sample schematics) or to some teensy pin. If it goes to Teensy pin, then add to the beginning of code:
pinMode(PIN(??), OUTPUT);
digitalWrite(PIN(??), LOW);

I have Teensy 3.2 board

Arduino 1.8.3
just installed latest Teensyduino, then deleted his FlexCAN library and installed the one found at your github. also installed nmea2000 and nmea2000_teensy libraries

In Arduino, which cpu speed is better to set for the 3.2 board?

i only opened temperaturemonitor.ino, uncommented lines as described in 4.2.1 "Try on PC only" chapter of your reference.pdf file, loaded on board and then opened Actisense Nmea Reader on my notebook with Win7.

EDIT:

problem solved adding:

NMEA2000.SetN2kCANSendFrameBufSize(500);

in setup, as you suggested to other guy in message #157

With NMEA2000.SetN2kCANSendFrameBufSize(500); you just move the point, when it starts to complain that it can not sent messages. TemperatureMonitor uses default value 40, which is enough normally. if you send a lot long messages at same time, you need to use bigger buffer. Note also that 500 eats a lot of memory. It means frames and one frame has 32 bit ID + 8 byte data so totally you have 5500 byte buffer. The Teensy has 64 kB ram, so it is not problem, if you do not write a big program.

I just tested TemperatureMonitor alone in Teensy 3.2 as it is explained in doc. 4.2.1 and it works fine. If you uncomment NMEA2000.SetForwardType(tNMEA2000::fwdt_Text);, then you can not see messages on NMEA Reader, since that changes the format to text. Instead you should see those messages on serial monitor.

I have used default speed on Teensy and not even tested others. But should be ok, with lower speed, since even Arduino Mega works and it is slower than Teensy.

Hi Timo
first o all, I thank you for your help and for your patience.

I'm still fighting with TemperatureMonitor.ino: I don't understand why it sends that strange 126993 PGN you can see in attached jpg...it not exists!

It probably should have been PGN 126996 "Product Information", or maybe also 126998 "Configuration Information"...and anyway i can't see the "ISO Address Claim" 60928 PGN as described in reference.pdf

Also tried the WindMonitor example, it works fine without NMEA2000.SetN2kCANSendFrameBufSize(500);
but also here i have the 126993 PGN

Maybe this strange PGN overload the buffer of TemperatureMonitor (that sends 3 other PGNs) but still not the WindMonitor buffer that sends only 130306 PGN?

PGN 126993 is Heartbeat PGN sent on every 60 sec automatically by the library. This is new required PGN, which you old version of NMEA Reader does not know. The new version of NMEA Reader know it, but unfortunately Actisense have not published that version yet. Heartbeat beat is single frame message an so will not overload anything.

Also ISO Address Claim is problematic with only board/NMEA Reader combination. When you plugin the board, serial port does not exist and it take long time before NMEA Reader can attach to the serial port and on that time ISO Address Claim has already gone. And since no one is requesting it, you will not see it. You can see it e.g. with TyCommander (with test mode) or by adding delay(15000) as first command in setup().

timolappalainen:
PGN 126993 is Heartbeat PGN sent on every 60 sec automatically by the library. This is new required PGN

Oh, thank you for that info.
I had not found 126993 PGN even at www.nmea.org site!

So i think i can start write my project, and at the end of the game try to decrease step-by-step the buffer size.
I will try even if something changes using another computer and by feeding the Teensy from external power...maybe the usb port of my old notebook is too tired to work!

Dig deeper - Google "126993 heartbeat pgn corrigendum"

Hi Timo
First o all, thank you for your fantastic work.

I'm using a Arduino Mega with MCP2515 Can modified with a 16Mzh crystal. When I’m running your example ActisenseListener everything works great together with Actisense reader!

But when I run DataDisplay2 I get different results every time in my serial port. Sometime I only get 1 sentence, other times I get 10-20 sentences and sometimes I get 200 sentences.
When I restart the Arduino it works directly again and I get some sentences.

Do you have any idea why I’m getting different amount of data?

Where you are getting the data and how much there is data? How many different PGNs and devices?

Just now I do not have idea. I have tested DataDisplay2 with MessageSender on Teensy and it still can catch all that traffic. The serial port may get stuck, if it gets data from PC to Mega direction. But this should not be the case, if you just follow the serial monitor and do not send any data to other direction. The stuck problem can be handled by adding while ( Serial.available() ) Serial.read(); after NMEA2000.ParseMessages(); But I would be surpriced, if that would be the case.

For now I only have one device connected to the NMEA 2000 network, my engine, as you can see in the attached file.

I’m not sending any data on the serial port, just watching the information send in the example code.

As you can see in the attachment it just stops sending data in the middle of a sentences, and when I restart the serial port I will receive data from start again.

Data 2018-03-24.txt (35.4 KB)