NMEA2000
NMEA2000 copied to clipboard
Understanding multi arch nmea2000 library
I'm trying to use the N2K library but there is no pinning hardware esp32 connecting in document directory. and just TXD an RXD define #define ESP32_CAN_TX_PIN GPIO_NUM_5 #define ESP32_CAN_RX_PIN GPIO_NUM_4 1)I'm asking about the interrupt PIN(#define N2k_CAN_INT_PIN 21) for ESP32, it is the same as arduino due no needs? 2)The code it is independent on HARDWARE transceiver chip (or inversed level)?
-
- It is good arch of the nmea2000 library?: https://github.com/MENIER/nmea2k/blob/master/nmea2kdoc.h
On ESP32 you can use any I/O-pin for CAN. Naturally it is bet to select ones, which are reserved for something else you may need like ADC or UART. Just connect selected pins to tranceiver chip and on sw define pins before including NEMA2000_CAN.h as below: #define ESP32_CAN_TX_PIN GPIO_NUM_18 #define ESP32_CAN_RX_PIN GPIO_NUM_19 #include <NMEA2000_CAN.h>
-
ESP32 has internal CAN so you do not need any interrupt pin definition. It is same with Arduino Due. You need to define interrupt pin, if you use external CAN controller like MCP2515 with e.g. Arduino Mega.
-
Yes. The tranceiver is "passive" chip and does not require any program.
-
Pretty much like that.
what board have you got? here is what worked on my NodeMCU ones. Mine didn't work using Timo's suggestion, don't know why, probably done something silly...
https://github.com/ttlappalainen/NMEA2000_esp32/issues/3#issuecomment-443166348