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

Unable to transfer from a physical CAN bus to another physical CAN bus #67

Open
yazyr opened this issue Mar 7, 2024 · 3 comments
Open

Comments

@yazyr
Copy link

yazyr commented Mar 7, 2024

I tried to send a CAN message from a RPi with RS485/CAN Hat to another RPi withRS485/CAN Hat. I don't know why the RPi on the receiver side is unable to receive the messages. Though if i create a virtual CAN interface on the receiving RPi, it does work.
Could anybody help me out with this? I'm a noob to this whole CAN/networking thing. Any advice is hugely appreciated

@mguentner
Copy link
Owner

Hi @yazyr,

  • can you send with cangen on the physical CAN interface with the same user on the receiving Pi?
  • how are you determining that the Pi is not receiving anything?

@yazyr
Copy link
Author

yazyr commented Mar 8, 2024

Hi @mguentner

  1. I tried sending a message with 'cangen' on the receiving RPi. I noticed I'm not able to receive the messages when i use 'candump'. I am unable to receive the CAN messages if I use 'cansend can0 05A#1122334455D6677' as well. I am able to receive CAN messages using 'candump' only when I connect the CANH and CANL pins from the CAN Bus with the CAN Hat. For the CAN Bus, I am using a MCP2515 module interfaced with an Arduino, running a CAN transmission code

  2. Device IP - 192.168.0.2 (connected to physical CAN bus):
    cannelloni -I can0 -R 192.168.0.3 -r 20000 -l 20000
    Device IP - 192.168.0.3 (vcan0)
    cannelloni -I vcan0 -R 192.168.0.2 -r 20000 -l 20000
    In the above tunnel, when I use 'candump vcan0', I am able to see the CAN messages from the physical bus. But if I use 'cangen vcan0' and 'candump can0', I could not see any messages.

Thanks a lot for responding. I'm doing this for a remote vehicle diagnostics project and would love to see this work. I'm pretty sure the mistake is somewhere on my side, but I'm unable to figure out where

@mguentner
Copy link
Owner

Regarding 1: You will only see frames on the physical canbus if your CAN bus is working correctly, i.e. CANH and CANL are connected and your transceiver is able to arbitrate on the bus.
If it cannot do that, it cannot send and you will not be able to see the frames on the interface using candump.
You will however be able on a vcan as the arbitration there virtually always succeeds.

Regarding 2: Do you have other means of capturing the bus, maybe with another CAN module? Maybe you are sending but your CAN driver somehow does not do local loopback

Can you please redo the test in 2. but with -d cubt (debugging enabled)

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