ttlappalainen / NMEA2000

NMEA2000 library for Arduino
532 stars 221 forks source link

PGN Conflict #186

Open tmsio opened 4 years ago

tmsio commented 4 years ago

Hello Timo, i have a problem, My Yamaha outboard, send fuel flow in NMEA network, i have my esp32 that send the same data. Raymarine Axiom, read yamaha data and not esp32 data. Axiom don t allow me to choice wich data to display. There is a way to allow Axiom to read esp32 data?

Another question i want to recive trip fuel used It s correct this:

double litri_trip_nmea() {
  return litri_trip;
}
.......
  SetN2kEngineTripParameters(N2kMsg, 0, litri_trip_nmea(), N2kDoubleNA, N2kDoubleNA, N2kDoubleNA);
  NMEA2000.SendMsg(N2kMsg);
.......

Thi is my code:

double Engine0Flow() {
  return lh1;
}

double tank_nmea() {

  return tank_perc;
}

double cap_tank_nmea() {
  return cap_tank;

}
double litri_trip_nmea() {
  return litri_trip;

}

void SendN2kFlow() {

  tN2kMsg N2kMsg;
  SetN2kEngineTripParameters(N2kMsg, 0, litri_trip_nmea(), N2kDoubleNA, N2kDoubleNA, N2kDoubleNA);
  NMEA2000.SendMsg(N2kMsg);
  SetN2kFluidLevel(N2kMsg, 0, N2kft_Fuel, tank_nmea(), cap_serbatoio_nmea());
  NMEA2000.SendMsg(N2kMsg);
  SetN2kEngineDynamicParam(N2kMsg, 0, N2kDoubleNA, N2kDoubleNA, N2kDoubleNA, N2kDoubleNA, Engine0Flow(), contatore_1, N2kDoubleNA, N2kDoubleNA, N2kInt8NA, N2kInt8NA, false);
  NMEA2000.SendMsg(N2kMsg);
}

Thank You regards. Emiliano

ttlappalainen commented 4 years ago

Can Axiom read data, you you disconnect yamaha?

tmsio commented 4 years ago

Hi Timo, Yes it did. Regards

ttlappalainen commented 4 years ago

Then I am afraid that there is not much to do. If Axiom does not offer selection possibility for data sources, only way is to disconnect sources. Or you could make a gateway, which has Yamaha on one side and other on other side. Just collect data you need and forward it to other bus. It is possible with library, if you create manually at least for other NMEA2000 object. Now there is easy way for Arduino users just include NMEA2000_CAN.h, which just internally selects "driver" according to MCU and creates NMEA2000 object. For ESP32 it should be possible to add MCP2515 with MCP2551 and make other NMEA2000_Yamaha by using mcp_can library.

tmsio commented 4 years ago

Think you for you support and quick answerTimo. Regards