NMEA 2000 Shield

When I did latest update, I tested both DataDisplay2 and MessageSender with Teensy 4.0 and ESP32. As default it uses CAN1 for Teensy 4.0. Also tested that compilation succeeds Arduino Mega and Arduino DUE.

In my test board I have MCP2562 tranceiver and connection is simple:
pin 1 -> Teensy pin 22 (Tx)
pin 2 -> Gnd
pin 3 -> 5V
pin 4 -> Teensy pin 23 (Rx)
pin 5 -> 3.3V
pin 8 -> Gnd

DataDisplay2 has been running without modifications for about 5 hours. Also MessageSender runs without any modification.

The library is under tests, since I do not know any certified device done with it. There is no reports of failure.

And you should be worried about error "PGN xxxxxx send failed". It means that CAN controller could not communicate with bus and it does not actually send anything. You get error delayed, since first "succeeded" frames has been buffered. When buffer gets full, you get error.

Please:

  • check your connection to tranceiver
  • check you have at least 1 120 ohm termination resistor on bus. Bus works with one on short test conditions and final bus must have 2 termination resistors on longest end on the bus
  • check your connection to tranceiver. Yes do it again.

If you want to change port for Teensy 4.0 for, you define
#define NMEA2000_TEENSYX_CAN_BUS tNMEA2000_Teensyx::CAN2
#include <NMEA2000_CAN.h>