NMEA 2000 Shield

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?

reader-detail.jpg|839x231

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)

Do you use Arduino Serial monitor? Could you try same with e.g. Putty.

Since you system works fine with Actisense NMEA Reader, I think that the Mega itself handles messages right. I have time to time seen different problems with Arduinos USB-Serial drivers.

Which OS you have?

I have mostly used Arduino serial monitor but also Putty both with the same result, unfortunate. I use win 10. Maybe it’s a problem with receiving in windows and not the Mega?

I have W10 too, so it is difficult to say. Please confirm that with ActisenseListener - Actisense NMEA reader it runs without stopping - let it run long. In principle there is not much difference on handling between ActisenseListener and DataDisplay2. You could also try with ActisenseListener in text mode by uncommenting line NMEA2000.SetForwardType(tNMEA2000::fwdt_Text); and then use putty or serial monitor.

Yes, the ActisenseListener runs without stop for 15 min. When I uncommenting the text line so I get text-mode I only get 200 sentences again exactly as the DataDisplay2 and it works in 10 seconds….

I have tried another serial converter and connected it with wires to tx0 and Rx0 and get the same resultate as USB port. Both on Putty and Arduino serial monitor.

When I run AtisenseListener and connect it with USB to Actisense Reader and in the same time connect serial reader with wires to Tx0/Rx0 I read data there too, but nothing I can understand.

Is there any buffer in the Mega that is filling up with data when it’s in text-mode?

Now I have some progress!

When I set the speed of the serial port to 230400 in the arduino program ActisenseListener and DataDisplay2 it runs without any problem when connected to my computer!

I don't now why and how but it works. Any idea?

No ideas. As I mentioned I have transmitted data with Messagesender and received all with Mega 115200 on DataDisplay2. And Message sender sends much more than on yours sample. One difference can be that your data had several 1 frame messages, which can be send faster. But I have not had time to simulate that.