vokkim - Having problems with SensESP and N2K c...

Having problems with SensESP and N2K connection. B&G Zeus can get some engine RPM readings from the ESP, but lists the device name as ??? and without any device info. Also I can't verify the actual data displayed yet since the boat is on land now, but at least the Zeus showed correctly 0 RPM. What might be the problem? Here's the relevant code:
tNMEA2000 *nmea2000;
nmea2000 = new tNMEA2000_esp32(CAN_TX_PIN, CAN_RX_PIN);
nmea2000->SetN2kCANSendFrameBufSize(250);
nmea2000->SetN2kCANReceiveFrameBufSize(250);
nmea2000->SetProductInformation(
"20210331", // Manufacturer's Model serial code (max 32 chars)
103, // Manufacturer's product code
"ARBUUSI MOTOR-ESP32", // Manufacturer's Model ID (max 33 chars)
"0.1.0.0 (2024-03-01)", // Manufacturer's Software version code (max 40 chars)
"0.1.0.0 (2024-03-01)" // Manufacturer's Model version (max 24 chars)
);
nmea2000->SetDeviceInformation(
1, // Unique number. Use e.g. Serial number.
180, // Function code
25, // Device class=Inter/Intranetwork Device
2046 // Asset reg
);

nmea2000->SetMode(tNMEA2000::N2km_NodeOnly, 22);
nmea2000->EnableForward(false); // Disable all msg forwarding to USB (=Serial)
nmea2000->Open();
tNMEA2000 *nmea2000;
nmea2000 = new tNMEA2000_esp32(CAN_TX_PIN, CAN_RX_PIN);
nmea2000->SetN2kCANSendFrameBufSize(250);
nmea2000->SetN2kCANReceiveFrameBufSize(250);
nmea2000->SetProductInformation(
"20210331", // Manufacturer's Model serial code (max 32 chars)
103, // Manufacturer's product code
"ARBUUSI MOTOR-ESP32", // Manufacturer's Model ID (max 33 chars)
"0.1.0.0 (2024-03-01)", // Manufacturer's Software version code (max 40 chars)
"0.1.0.0 (2024-03-01)" // Manufacturer's Model version (max 24 chars)
);
nmea2000->SetDeviceInformation(
1, // Unique number. Use e.g. Serial number.
180, // Function code
25, // Device class=Inter/Intranetwork Device
2046 // Asset reg
);

nmea2000->SetMode(tNMEA2000::N2km_NodeOnly, 22);
nmea2000->EnableForward(false); // Disable all msg forwarding to USB (=Serial)
nmea2000->Open();
Wonder if I should use N2km_SendOnly mode instead of N2km_NodeOnly
2 Replies
Matti Airas
Matti Airas5mo ago
I'd say NodeOnly is definitely preferable. IIRC, NodeOnly participates in address resolution and sends the device information when requested while SendOnly only transmits the data. The SK server will catch SendOnly data but many other devices might ignore it. Do you have the following line somewhere?
app.onRepeat(1, []() { nmea2000->ParseMessages(); });
app.onRepeat(1, []() { nmea2000->ParseMessages(); });
Despite the misleading name, the call is required for the device to respond to the device info request and address resolution PGNs. Basically, that's the n2k library event handler. The library examples call ParseMessages in the loop() function, but in practice, every millisecond seems to be enough.
vokkim
vokkim5mo ago
No calls to ParseMessages, must be it, thanks!
Want results from more Discord servers?
Add your server