Go Down

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

timolappalainen

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.

2. 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.

autopilotNOR

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: https://github.com/peterantypas/ais_transponder 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: https://github.com/peterantypas/ais_transponder
OSHPark files and details:
RF part: https://oshpark.com/shared_projects/E84PAqMK
Logic part: https://oshpark.com/shared_projects/U0kWDO24


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..

popeye_70

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

timolappalainen

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.

gwmurray

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.

timolappalainen

1. Which Seatalk version. Read https://en.wikipedia.org/wiki/NMEA_2000 (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.

gwmurray

Brilliant Timo, thanks for the fast response.

popeye_70

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

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?

timolappalainen

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);

popeye_70

#414
Mar 06, 2018, 01:32 pm Last Edit: Mar 06, 2018, 03:38 pm by popeye_70
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

timolappalainen

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.

popeye_70

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?

timolappalainen

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().

popeye_70

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!

timolappalainen

Dig deeper - Google "126993 heartbeat pgn corrigendum"

Go Up