NMEA 2000 Shield

I can try to find time within some days.

urbansk - Do you have MFD, which supports 127507? I am testing with Actisense, but according it, the definition is not same as in canboat.

I have a Garmin gpsmap 1222 according to the manual supports PGNs 127506 to 127509
Urban

So what was your plan to read 127507 or send it? If you thought to send it, how do you read it? Or do you have device sending that PGN? If yes, I need to get raw data out of it.

I was going to send it to my MFD.

My MFD supports recieving PGN 127507.

Found this information about PGN 127507 if it can be of any use:

PGN: 127507 - Charger Status

Field #1: Charger Instance
Bits: 8
Signed: false
Field #2: Battery Instance
Bits: 8
Signed: false
Field #3: Operating State
Bits: 8
Signed: false
Field #4: Charge Mode
Bits: 8
Signed: false
Field #5: Charger Enable/Disable
Bits: 2
Signed: false
Field #6: Equalization Pending
Bits: 2
Signed: false
Field #7: Reserved
Bits: 4
Signed: false
Field #8: Equalization Time Remaining
Bits: 16
Signed: false

I know that information, but as I said Actisense reads it differently as that definition. So someone is wrong. Can you provide me TeamViewer connection to computer, which has Arduino/Teensy connected with your MFD on same N2k bus? Please change to private channel or email me so we can change information more freely.

elgui:
Hi,

I'm about to buy a "triducer", the Airmar DST800. It's going to send depth/temp/speed via NMEA2000.
As a java programmer with zero experience with Arduinos (but lot of time to spend on it), do you think I have a chance, using existing resources, to decode these informations and display it on a e-ink display shield ?
I don't absolutely need a ready-to-use solution, and a simple "yes you can" would be much appreciated to preserve my motivation ^^
Of course, I'll be back later with more accurate questions :wink:

Hello,
I am working on the dst800 transducer and I have the same problem as "Elgui", I need to read the nmea2000 sensor with a mega arduino or due with an mpc2515 and 2551 module.

Has anyone been able to solve something like this?
Thank you

I expect you have found my NMEA 2000 library and its available documents on GitHub.

Library example ActisenseReader connects Arduino to the NMEA2000 bus and send data to Serial (USB) in Actisense format. Actisense format is still just NMEA 2000 meassages packet to single packages, which has to be parsed and requires knowledge of NMEA 2000 data structure. Instead you can take a look to example DataDisplay2, which reads as sample several different messages and sends them parsed to clear format. You should be able to modify example for your needs and send data in format you prefer.

Also take a look to http://signalk.org/ example ActisenseReader provides data in format, which is readable by SignalK. I have not checked, what platform they support. At least with RasberryPi and example ActisenseReader (or Actisense NGT-1) you can build up SignalK server, which provides data for HTML browsers.

timolappalainen:
I expect you have found my NMEA 2000 library and its available documents on GitHub.

Library example ActisenseReader connects Arduino to the NMEA2000 bus and send data to Serial (USB) in Actisense format. Actisense format is still just NMEA 2000 meassages packet to single packages, which has to be parsed and requires knowledge of NMEA 2000 data structure. Instead you can take a look to example DataDisplay2, which reads as sample several different messages and sends them parsed to clear format. You should be able to modify example for your needs and send data in format you prefer.

Also take a look to http://signalk.org/ example ActisenseReader provides data in format, which is readable by SignalK. I have not checked, what platform they support. At least with RasberryPi and example ActisenseReader (or Actisense NGT-1) you can build up SignalK server, which provides data for HTML browsers.

Muchas gracias Timo,
Revisare las referencias y les cuento como sigue el proyecto

timolappalainen:
I expect you have found my NMEA 2000 library and its available documents on GitHub.

Library example ActisenseReader connects Arduino to the NMEA2000 bus and send data to Serial (USB) in Actisense format. Actisense format is still just NMEA 2000 meassages packet to single packages, which has to be parsed and requires knowledge of NMEA 2000 data structure. Instead you can take a look to example DataDisplay2, which reads as sample several different messages and sends them parsed to clear format. You should be able to modify example for your needs and send data in format you prefer.

Also take a look to http://signalk.org/ example ActisenseReader provides data in format, which is readable by SignalK. I have not checked, what platform they support. At least with RasberryPi and example ActisenseReader (or Actisense NGT-1) you can build up SignalK server, which provides data for HTML browsers.

Hi Timo,

Let me tell you what happened. I tried with the example DataDisplay2 from the library NMEA2000 and everything turned out great, although at the beginning I wasn't receiving data. This was because the module MCP2515/MPC2551 which I used didn't share the conexion GND with arduino mega, so I just had to connect a jumper directly between the GND sensor and the GND arduino. After that it functioned perfectly.
Thank you for your help and congratulations for the excellent work of the library.

When I have this project finished, I'll upload pictures of the complete assembly.

Regards

Hi All, I have been reading this thread with great interest, fantastic information here!

@timolappalainen commented in one post that his preferred hardware for N2K is either the Teensey or the ESP32. I'm curious if the Teensey with the M0+ processor is sufficient, or will the M4 be required? Also, if the ESP32 is used, which pins can be used with the CAN controller? I assume we'll need an external CAN transceiver as well, is that correct?

Thank you!

Teensy 3.2 has ARM Cortex-M4 and internal CAN controller. I have not tested other than Teensy 3.2, 3.5 and 3.6, so I prefer to use one of those. They all works well e.g. with MCP2562 tranceiver chip.

You will always need tranceiver chip. NMEA 2000 also requires that device has to be isolated from the bus, so if you have any other connection from your device, you should use isolated tranceiver and isolated power on bus side. On own boat, where you have all power lines anyway connected together, this is not so big thing, but you have to remember that other devices may be totally isolated, so you get fancy problems if
you mix connections with them.

I am not sure what all pins can be defined for CAN. In some of my library example there is one sample.

Congrats Timo on this marvelous N2K developement, can't imagine the amount of time spent on it.
I have succeeded in making & tweaking many of your examples with esp32, mega2560, teensy3.2 and Due platforms. However ideally I would like to use a smaller & more cost effective platform like the esp8266 or Wemos D1 mini/pro but they aren't yet supported. I believe I read way back in this thread that SREG is not supported but it can be replaced by the use of interrupts/ no interrupts for the esp platform. I have tried and failed making these library tweaks always failing to compile.
I was wondering if your or anyone has a recommended solution for this platform.

Thanks
RossP

What CAN controller you are using with that? I expect MCP2515. And what development environment? Just Arduino?

timolappalainen:
NMEA 2000 also requires that device has to be isolated from the bus, so if you have any other connection from your device, you should use isolated tranceiver and isolated power on bus side. On own boat, where you have all power lines anyway connected together, this is not so big thing, but you have to remember that other devices may be totally isolated, so you get fancy problems if
you mix connections with them.

From reading the datasheet for the MCP2562 it appears that it is not isolated, but it is nice that its available as DIP for about $1.00 each from DigiKey. Isolated solutions, like the ISO1050 and the MAX 14882 are galvanically isolated, surface mount and cost about $6.00 each. Is galvanic isolation sufficient to meet the N2K spec or must it be optical isolation? I suppose I could use an isolator between the transceiver the the controller, is that acceptable?

Thank you again, you're a great help!

Thanks for your reply Timo.
Yes I would use a mcp2515 via the SPI interface to a Wemos D1 mini(4mbFlash) or mini pro(16mbFlash) with esp8266-12 in the Arduino ide environment. This interface worked very well with the Arduino mega2560 that you developed.

RossP

Try next:

  • change on NMEA2000_mcp.h:
    line 53 -> unsigned long id; // can identifier

  • on NMEA2000_mcp.cpp
    line 98 -> // uint8_t SaveSREG = SREG; // save interrupt flag
    line 115 -> sei(); // SREG = SaveSREG; // restore the interrupt flag
    line 167 -> // uint8_t SaveSREG = SREG; // save interrupt flag
    line 170 -> sei(); SREG = SaveSREG; // restore the interrupt flag

Then it compiles with my arduino. Report does it work.

Thanks Timo for investigating.
I'll connect the mcp2515 to a Wemos D1 mini as follows and advise upon the results.

Mcp2515. Wemos D1 mini.
Int. D1/gpio5
Clk. D5/gpio14
Miso. D6/gpio12
Mosi. D7/gpio13
CS. D8/gpio15

Congrats Timo changes appear to work with the above MCP2515 - Wemos D1 Mini connections using your SenderListener example. Only tested as an N2K Actisense receiver so far but the outcome looks promising, will do further tests and report back.

Thank you again

Continue to test the N2K setup on the WemosD1Mini and looks good so far as a Listener to Actisense/plain text except for the need to press the reset button if the Wemos is powered up while connected to a live N2K bus. If bus is totally inactive or disconnected at power up, the Wemos starts monitoring once the bus comes alive. Once this detail is corrected I'll move on to sending to the bus.
Thanks