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

Networking with CAN-J1939 support (Ubuntu Linux) jacd.c usage #173

Closed
josemic opened this issue Nov 27, 2019 · 5 comments
Closed

Networking with CAN-J1939 support (Ubuntu Linux) jacd.c usage #173

josemic opened this issue Nov 27, 2019 · 5 comments

Comments

@josemic
Copy link
Contributor

josemic commented Nov 27, 2019

This is a cleanup of part of the discussion in #159.
Using Ubuntu linux with kernel 5.4. The installation is described here: link on Ubuntu 19.10.
I have deinstalled the ubuntu can-utils package with "sudo apt remove can-utils".
I use latest can-utils from git.
Setup:

sudo modprobe vcan
sudo ip link add can0 type vcan
sudo ip link set can0 up
sudo modprobe can-j1939

I have 4 findings:

  1. jacd has to be called with sudo. Why? I think this should not be the case. I especially will have problems to run TTCN test cases in this case or when the sochetCAN socket commands are used in other programs. In worst case I have to change root access rights with visudo.
  2. when the command is called with an "&" at the end of the line, the command does not work, as the password is not queried, as the command is running in background. This will not query for an password:
    sudo ./jacd -r 100,80-120 -c /tmp/1122334455667781.jacd 1122334455667781 can0 &
    ,but this without the "&" at the end will query for a password:
    sudo ./jacd -r 100,80-120 -c /tmp/1122334455667781.jacd 1122334455667781 can0
  3. when using the sudo javd with "-v" option and without "&" the command fails with the message "No such file or directory". I really do not understand why this is happening. Verbosity should not have any impact on the command outcome.
sudo ./jacd -r 100,80-120 -v -c /tmp/1122334455667781.jacd 1122334455667781 can0
jacd: ready for can0:1122334455667781: No such file or directory

Sometimes also "success" is printed, but noting else and no candump output is generated. Also the prompt returns immediately. (This seems to happen, if jacd had been called before once without "-v" option):

On Termial 1:

sudo ./jacd -r 100,80-120 -v -c /tmp/1122334455667780.jacd 1122334455667780 can0
jacd: ready for can0:1122334455667780: Success

On Terminal 2:

sudo ./candump -t d can0
<EMPTY>
  1. when using the sudo jacd without "-v" option and without "&" the command works:

On Terminal 1:
sudo ./jacd -r 100,80-120 -c /tmp/1122334455667781.jacd 1122334455667781 can0

On Terminal 2:

sudo ./candump -t d can0
 (000.000000)  can0  18EAFFFE   [3]  00 EE 00
 (000.000195)  can0  18EEFF50   [8]  81 77 66 55 44 33 22 11
 (001.250191)  can0  18EEFF50   [8]  81 77 66 55 44 33 22 11

And after ctrl-c in Terminal 1:

On Terminal 2:
(212.451499) can0 18EEFFFE [8] 81 77 66 55 44 33 22 11

@olerem
Copy link
Contributor

olerem commented Dec 6, 2019

This issue should be fixed by this pull request: #180
Can you please confirm it.

@marckleinebudde
Copy link
Member

Regarding sudo: If you have sudo configured to ask for a password, you cannot start it in the background (using &). This is normal sudo behaviour, that has nothing todo with j1939 or jacd.

@josemic
Copy link
Contributor Author

josemic commented Dec 10, 2019

The 'sudo' is now no longer necessary. That is working.

What is still strange is that the -v option is not working.

In Terminal 1:
./candump -t d can0

In Terminal 2:
./jacd -r 100,80-120 -v -c /tmp/1122334455667780.jacd 1122334455667780 can0

Result in Terminal 2:
jacd: ready for can0:1122334455667780: Success

or sometimes:
jacd: ready for vcan0:1122334455667780: No such file or directory

in both cases in Terminal 1:
<EMPTY>

What is working, when jacd is called without '-v' option:

In Terminal 2:
./jacd -r 100,80-120 -c /tmp/1122334455667780.jacd 1122334455667780 can0

In Terminal 1:

./candump -t d can0
 (000.000000)  can0  18EAFFFE   [3]  00 EE 00
 (001.250231)  can0  18EEFF50   [8]  80 77 66 55 44 33 22 11

And after ctrl-C in Terminal 2 the Terminal 1 shows:
(104.651817) can0 18EEFFFE [8] 80 77 66 55 44 33 22 11

@josemic
Copy link
Contributor Author

josemic commented May 26, 2020

for the record: jacd had been renamed to j1939acd in latest can-utils

@josemic
Copy link
Contributor Author

josemic commented May 26, 2020

I this issue is closed. I have created as follow-up #206 .

@josemic josemic closed this as completed May 26, 2020
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

3 participants