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

J1939 messages not sent/received in Ubuntu 20.04 (Kernel 5.4) #212

Closed
BalkanRising opened this issue May 29, 2020 · 4 comments
Closed

J1939 messages not sent/received in Ubuntu 20.04 (Kernel 5.4) #212

BalkanRising opened this issue May 29, 2020 · 4 comments

Comments

@BalkanRising
Copy link

Hi guys, hope all is well! I think I am facing an issue with the j1939 driver in kernel 5.4. The below test works with a very old set of j1939/can drivers on my arm board running kernel 4.9 but fails on Ubuntu 20.04 x86/Kernel 5.4:

Terminal 1:

testj1939 -r vcan0

Terminal 2:

testj1939 -s8 vcan0:0x80 :0x12300

Problem: In Ubuntu 20.04, Terminal one never prints anything out, indicating the message I sent from terminal 2 did not get properly sent or received. Before I start debugging the driver, I am wondering if there are any known issues with what I am trying to do? I did not see anything while looking through older issues on here.

Setup

Install Ubuntu 20.04 and can-utils and then do the following to set up machine:

modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
modprobe can-j1939
@BalkanRising
Copy link
Author

Thank you to @josemic for pointing out issue #159. It looks like broadcast does not work and so when I changed the commands to the following it worked as expected:

Terminal 1:

testj1939 -r vcan0:0x69

Terminal 2:

testj1939 -s8 vcan0:0x70 vcan0:0x69,0x1200

According to @olerem in issue #159, broadcast not working is a defect with testj1939 utility:

send to broadcast is currently not supported by testj1939

I would like to point out broadcast also does not work in my C++ code either. It looks like it is an issue with the J1939 driver in kernel 5.4. This functionality works in the older version of the driver I am using on my embedded system running kernel version 4.9. Can someone confirm if this is fixed or not? Should I close this issue?

@josemic
Copy link
Contributor

josemic commented Jun 3, 2020

I have closed #159, as all procedures described in kickstart.md now have passed on my Ubuntu 20.04 machine.
However I have not used the latest can-utils package from ubuntu, instead I have compiled the linux/can-utils myself.
Please test again with self compiled can-utils from this repository.

@josemic
Copy link
Contributor

josemic commented Jun 30, 2020

@BalkanRising: Is this solved now? Can we close the issue?

@BalkanRising
Copy link
Author

Yes, the core of my problems in my C++ code was that I needed to pass a socket option to enable broadcast, whereas in the earlier version of the driver that option was not required. If the latest can-utils works then I don't see any issue with the driver or testj1939.

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