Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp32 mcp2515 not receiving data #440

Open
aiotsi opened this issue Dec 17, 2024 · 1 comment
Open

esp32 mcp2515 not receiving data #440

aiotsi opened this issue Dec 17, 2024 · 1 comment

Comments

@aiotsi
Copy link

aiotsi commented Dec 17, 2024

Hi. I have a problem with receiving data from one esp32 to another. I use simple temperature monitor to DataDisplay2 but nothing show in serial. When i use simple example of sending and receiving data send.ino and receiving.ino it's working but when i tried nmea2000 data to transfer no receiving anything. I connect my esp32 pins with mcp2515 board:
VCC -- ESP32 VIN
GND -- GND
CS -- D5
SO -- D19
SI -- D23
SCK -- D18
INT -- D4
Simple send.ino and receiving.ino work, but not nmea2000. I think it's something with code because simple send recive works. I have resisors jumper connected. If i tried ActisenseListener.ino and use Actisense NMEA Reader software there is always TimedOut.
I attached zip files with all sketches.
Thanks for help.
listener

mcp2515_CAN_bus
esp32.zip

@ttlappalainen
Copy link
Owner

Yes, for sure there is something in your code or hw - not in library.

  1. If you are using ESP32, why do you use that MCP2515 module? ESP32 has internal CAN controller and needs only transceiver - I prefer isolated ISO1050. Note that your module is not isolated. You can read more information about its importance from library documentation. Usin MCP2525 module will just make things more complex.

  2. Since you are using MCP2515 module, did you force compiler to use it? As default examples uses ESP32 internal CAN and you have not connected transceiver to it, so for sure it does not work. So as indocumentation you need to add several defines to yor project.
    #define USE_N2K_CAN 1
    #define N2k_SPI_CS_PIN GPIO_NUM_xx // Pin for SPI Can Select
    #define N2k_CAN_INT_PIN GPIO_NUM_xx // Use interrupt and it is connected to pin 21
    #define USE_MCP_CAN_CLOCK_SET 8 // possible values 8 for 8Mhz and 16 for 16 Mhz clock
    #include <NMEA2000_CAN.h>

See also:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants