buhhe / VolvoPenta-N2K_Interface

GNU General Public License v3.0
12 stars 7 forks source link

Why 2 devices for can bus #5

Open MeY0u opened 2 months ago

MeY0u commented 2 months ago

Hello, I would love to use your work for mine boat mdi readings, i ready your pdf file and i have few questions left.

  1. Why did you use 2 different can bus devices?
  2. Does it matter which device / part tranciever (sn or mcp) to what) n2k or mdi) can bus you connect?
  3. The speed of multilink / mdi is 250Khz?

Thank you,

buhhe commented 2 months ago

Hi, question1: Since Timo Lappalainen's CanBus libraries doesn't support two devices at one ESP32 I've looked for a second different library supporting canbus. I found coryjfowlers library supporting the MCP2515. So I took a MCP2515 for the second canbus.

question2: Neither at the physical layer nor at the logical one. But as the two libraries differ in it's scope of functions I felt it's easier to do it as it is now.

question3: The MCP2515 which reads the MDI data is initialized with 500kb/s.

MeY0u commented 2 months ago

thank you, so if i dont need any nmea2000 message forwarding then i can use the TWAI built functions in esp32-s3 with SN transceiver to read the Multilink CAN Bus at speed of 500Kbs and parse using your code using the results for further use, am i correct? or i might missed a step?

buhhe commented 2 months ago

I made two decisions regarding the J1939 CanBus and the N2K CanBus on my boat: 1st: Firstly, I keep them separated as much as possible since both are part of the safety infrastructure. Although it should be possible to physically connect the two busses, I chose not to do so. The ESP32 connection to the VP bus is „readonly“, nothing will be written to the bus.

2nd: Keep it simple and focused to one job. That means

I cannot determine if the TWAI API is suitable for listening on a CanBus. It is important to ensure full compatibility with the CanBus/N2K (both physical and logical). Especially in case of writing to the bus. Timo’s library includes all functions needed for timing collision detection etc. I think that is the most comfortable way to deal with N2K. And as i wrote in the disclaimer: Any changes at the boats wiring or electrical and electronical givens can cause damages or critical situations. That is on your own risk.

MeY0u commented 2 months ago

Thank you, i ran your code and it worked. Thanks for the suggestions regarding using n2k library for sending data, didn't learn about the collisions detection in canbus yes, so good to know that he can handle itself.

Can you share the source of the canbus multilink parsing? I would like to see more data

buhhe commented 1 month ago

No problem. Congrats for getting the code succcessful running. Unfortunately I don't understand for what you are asking. Do you mean a record of the data sent by the MDI??

MeY0u commented 1 month ago

thank you <3. beside the tachometer , coolanttemp. engine hour there are more possible sensors. i want to create a big library of possible png messages, but i dont know how to parse them or where to find more png code. hence my question is whether can you guide me to your source of parsing the sensors you currently read.

On Tue, 14 May 2024 at 17:27, buhhe @.***> wrote:

No problem. Congrats for getting the code succcessful running. Unfortunately I don't understand for what you are asking. Do you mean a record of the data sent by the MDI??

— Reply to this email directly, view it on GitHub https://github.com/buhhe/VolvoPenta-N2K_Interface/issues/5#issuecomment-2110391396, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEZBJT4342GRRCBDRO6BKLTZCINM3AVCNFSM6AAAAABGB7GIJOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJQGM4TCMZZGY . You are receiving this because you authored the thread.Message ID: @.***>

buhhe commented 1 month ago

You can find lots of N2K and PGN related information on github.