Skip to content

Simple .log not working for WireShark #1487

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

Closed
BenViete opened this issue Jan 16, 2023 · 6 comments
Closed

Simple .log not working for WireShark #1487

BenViete opened this issue Jan 16, 2023 · 6 comments
Assignees
Labels

Comments

@BenViete
Copy link

Describe the bug

Since the update to version 4.1.0 the simple .log file cannot be loaded to Wireshark. If you try to import it generates stupid protocol errors, because the CAN protocol is not recognized.

To Reproduce

Send a message on a CAN bus and save the received messages to a .log file. Try to open it with WireShark.

Expected behavior

The .log file should be imported correctly and recognized as a CAN trace.

Additional context

OS and version: MacOS Montery 12.6.2
Python version: PYthon 3.9.2
python-can version: 4.1.0
python-can interface/s (if applicable): SocketCAN

The problem is caused by adding the direction of the message to the log file in line 185 of canutils.py.

@BenViete BenViete added the bug label Jan 16, 2023
@j-c-cook
Copy link
Contributor

Are you saying the issue is the two following lines?

if msg.is_remote_frame:
framestr += f"R{eol}"

@BenViete
Copy link
Author

No it's from the following two lines:

else:
eol = " R\n" if msg.is_rx else " T\n"

@j-c-cook
Copy link
Contributor

@jazi007 @felixdivo The change in question was merged into master here: 4d9b32c.

The associated PR is here: #1244.

@hartkopp
Copy link
Collaborator

Hi @j-c-cook ,

the direction is an optional information that can be enabled e.g. in candumpwith the -x option:

user@linux:~$ candump -L -x any
(1674328177.352335) vcan0 123#112233 T
user@linux:~$ candump -L any
(1674328199.203737) vcan0 123#112233
user@linux:~$ candump -l -x any
Disabled standard output while logging.
Enabling Logfile 'candump-2023-01-21_201014.log'
user@linux:~$ cat candump-2023-01-21_201014.log 
(1674328218.255741) vcan0 123#112233 T
user@linux:~$

As you can see the optional T or R is placed after the correct CAN frame representation - to be compatible to previous log file parsers that should simply stop when the CAN frame (as they know it) is finished.

The question is what did the Wireshark parser do that it is not capable to cope with such an extension?!?

@zariiii9003
Copy link
Collaborator

I suggest opening an issue at https://gitlab.com/wireshark/wireshark/-/issues
Since the python-can implementation is equivalent to can-utils i will close this.

@j-c-cook
Copy link
Contributor

I suggest opening an issue at https://gitlab.com/wireshark/wireshark/-/issues Since the python-can implementation is equivalent to can-utils i will close this.

@BenViete

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

No branches or pull requests

4 participants