Go Down

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

autopilotNOR

Hi Timo,

I have a new engine which have a J1939 bus connection and what I could find until now is that nmea2k is a subject of J1939 right? The manufacturer delivers a NMEA2K converter for 500 € but as this brand new engine already break my finance plan completly for this year I thought to build it my self.

Is one of your libraries doing the conversion job already, or do you know an open project doing this?

Regards,
Thomas

timolappalainen

I am sorry, but I have not searched open source converters.

With my library you can easily make device, which sends engine information out ot reads it in from N2k. But I do not know which messages your engine will send. If you find messages and their descriptions, it is not hard to read them and do conversion. E.g. Teensy 3.5 and 3.6 has two internal CAN controller, so one could be as J1939 and other N2k. Just need tranceivers. For N2k side I prefer isolated one to avoid ground loop in your system.

On the other hand, what information you want to get? E.g. Teensy has good ADC converter for reading engine analog sensors and with FreqCounter library you can easily read RPM from e.g. alternator W. Not so elegant.

sglard

Hi Timo,

I did some research and I have a following (newbie) question regarding my issue -  simrad gps that doesnt talk to a garmin plotter - (https://forum.arduino.cc/index.php?topic=50893.msg4442733#msg4442733)

after talking with both simrad and garmin and sending my network debug information to garmin.  It seems that while the pgn is in the correct structure, simrad are using some invalid values and this is the reason why the garmin plotters ignores them.

My plan is to compare the gps pgn from simrad with a pgn from a working gps, and to create a device that will read the simrad pgns from the network and will resend them with adjusted values.

What would be a good approach. using a single nmea 2000 network to both receive and send? or would it be better to have a board with two can interfaces with two nmea 2000 networks, one is connected only to the Simrad gps and the second will be connected to the rest of the boat network and will submit the adjusted pgn?

Thanks again
Sg

timolappalainen

Before doing anything I prefere to find out what is going wrong. I tested you sample message with my simulator and Actisense NMEA Reader and did not see any problem. With Simulator and Teensy with library example ActisenseListenerSender you can send messages to N2k bus. Simulator has special feature, where you can send messages directly with hex data. This is the way I tested your message with Actisense Reader. If I would have Garmin plotter, I could test does it work with it.

I can not say which way is better. If you can choose on your plotter, which GPS source to use, then you can have them on same bus. In this case your device would act just an other GPS on the system. If you separate your GPS behind own bus, you can program your "converter" to lie that it is Simrad GPS.

I would start with Teensy 3.5 or 3.6 and first test with simulator how to get it working. Then it is easy to test on one bus and if necessary add own bus for Simrad.

sglard

Thanks Timo for your detailed reply!

Here the reply that i got from garmin:

Our engineering found the following issues with the output sentences of the GS25:
"The COG in PGN 129026 being sent is invalid. Also the fix information in the PGN being sent is invalid. For our MFDs to recognize a GPS source that source must be providing valid Fix, Time, Position, Track and Velocity information."

I suspect that their plotter is ignoring the pgn when the boat is not moving since the Track and Velocity are marked as invalid (ffff) instead of 0 or something else (i asked them about it but they didn't provide any more details).  

I Just got my Teensy 3.5 and the other can transceiver components from your schematics, i will start experiment with it and hopefully i will have more insights.

Thanks again for this amazing project and your ongoing support!

timolappalainen

In a way Simrad works right and Garmin handles it wrong. If GPS receiver is not moving, it can not know COG and sending "not available" (which is not invalid) is right behaviour. Velocity could be sent as 0. Welcome to great standard!

pjungdal

Hi
I'm interfacing my old NMEA 0183 instruments to my new B&G Vulcan.

Compass and AIS is working fine, thanks Timo for the Github repositories.

I,m now building an interface for my old  tillerpilot. Its working fine, can follow a course,  Wind angle, and track between waypoints, etc. It is simulating the Simrad AP44 Display

My problem is, that it is not recognized by Vulcan or Triton2 display

Do anyone know about the protocol for B&G/Simrad NAC-2 autopilot computer and AP44 controller?

SetProductInformation ????
SetDeviceInformation  ????

PGN:59904, 59392, 60160, 60416, 60928, 60416, 126208, 126996 wich are all ISO PGNs

Regards
Peter

radapl

Hi,

Thanks Timo for great job!

May be stupid question, but should I feed with 12 volts NMEA socket on my MFD Lowrance HDS Live, when testing my NMEA device (teensy, sender only)?

If I connect my device to ActisenseListener (based on 2-nd teensy) work ok. If I connect to MFD - it not see:(. Only as idea, perhaps mfd check nmea bus with power feed and not start.

timolappalainen

You should feed NMEA2000 bus from one place. MFD:s has often own power feed, but they does not power NMEA2000 bus. They does not check anything - the tranceivers are simply isolated and powered from bus side. So if there is no power on bus, tranceivers are not on.

It is always best to check bus powering, before feeding any power to it.



radapl

#879
Mar 15, 2020, 11:42 pm Last Edit: Mar 15, 2020, 11:52 pm by radapl
the tranceivers are simply isolated and powered from bus side. So if there is no power on bus, tranceivers are not on.
Oh yes, isolated tranceivers... Thank you!  With power on bus, MFD found new data sources with no dancing around!

JCW

Hi guys so I finally got a Mega 2560 and a MCP2515 & MCP2551 combo board. I cannot seem to get it to work with my Garmin GPSMAP742xs. I tried temperature monitor and looking in the NMEA2000 device list on GPSMAP unit. I also tried Actisense and don't pick up anything.

I have the libraries set up as per the instructions on Github. I do have both the MCP and Due libraries but I don't think that will make a difference. I then also add the line #define USE_MCP_CAN_CLOCK_SET 8 because my MCP board has a 8mhz crystal.

I am adding a rough connection diagram of how I got it wired.

Any help appreciated.


proggerjos

In the cockpit of my boat some analogue B&G displays are installed, but the analogue meters are all broken. I decided to digitize  these meters with a tft screen.

I managed to write the program to translate the NMEA0183 messages coming from serial into screen pictures with needle and/or character presentation using a ESP32 (WROVER).  I used the NMEA0183 library to parse the messages.

NMEA0183.Begin(&Serial2, 3, 115200);
Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2);


tNMEA0183Msg NMEA0183Msg;
while (NMEA0183.GetMessage(NMEA0183Msg)) {......

Making all ship data available  over WiFi was a previous project and is running some years now. For this project I would like to use the WiFi data in stead of Serial data. I wrote a separate program to recieve NMEA messages from WiFi using:

   WiFiClient client;
   if (client.available())
   {
      String line = client.readStringUntil('\r');
   }

Now I have to combine these programs in order to use the WiFi Stream instead of the Serial Stream. I am using the Arduino IDE for programming so that should not be the biggest problem.  But it appears different. The functions used in the NMEA0183 library are specifically writen for receiption through Serial Port.

Please help me by indicating which alterations/extensions should be made in the library or .....?

Thanks in advance

timolappalainen

NMEA0183 can be opened either by hardware serial as in your code or just for stream NMEA0183.Begin(&<stream name>);

JCW

Hi guys so I finally got a Mega 2560 and a MCP2515 & MCP2551 combo board. I cannot seem to get it to work with my Garmin GPSMAP742xs. I tried temperature monitor and looking in the NMEA2000 device list on GPSMAP unit. I also tried Actisense and don't pick up anything.

I have the libraries set up as per the instructions on Github. I do have both the MCP and Due libraries but I don't think that will make a difference. I then also add the line #define USE_MCP_CAN_CLOCK_SET 8 because my MCP board has a 8mhz crystal.

I am adding a rough connection diagram of how I got it wired.

Any help appreciated.


Anyone have some advice for me? I used the MCP2515_Can library to determine that the device initializes correctly over the SPI bus.

timolappalainen

There is not much to do. TemperatureMonitor example has been working with Mega. You could also wire int pin and add
#define N2k_CAN_INT_PIN xx
#define MCP_CAN_RX_BUFFER_SIZE 20
#define USE_MCP_CAN_CLOCK_SET 8
#include <NMEA2000_CAN.h>
...

But I am afraid that it does not help. You need to check wires, powering the bus, terminal resistor connection etc.

Loading different libraries does not make difference. #include <NMEA2000_CAN.h> selects necessary library according to selected processor. So you can have both NMEA2000_mch and _due loaded at same time.

I should move the Arduino connectiong to last and rise Teensy to the top - there is less trouble with it.

Go Up