I'd be happy to help. PM sent.
#include "N2kMsg.h"#include "NMEA2000.h"#include <FlexCAN.h>#include <NMEA2000_teensy.h> tNMEA2000 &NMEA2000=*(new tNMEA2000_teensy(4,1));
"CAN device failed to open" simply means that library can not communicate with can controller.You have wrong definition for clock set. See NMEA2000_CAN.h descriptions on the beginning.The right definition is:#define USE_MCP_CAN_CLOCK_SET 8
There seem to be default receive frame buffer only 2 for mcp_can. Uncomment line // NMEA2000.SetN2kCANReceiveFrameBufSize(50);To set it 50. You may need to reduce it smaller due to low RAM on Arduino Mega.