danielhrisca / asammdf

Fast Python reader and editor for ASAM MDF / MF4 (Measurement Data Format) files
GNU Lesser General Public License v3.0
629 stars 223 forks source link

ETH Frame extraction feature #259

Closed maxdd closed 4 years ago

maxdd commented 4 years ago

I've read you are currently supporting only CAN data. Is the Ethernet Frame extraction/conversion planned to be developed?

danielhrisca commented 4 years ago

Hello @maxdd we need a signal description to be able to extract them.

maxdd commented 4 years ago

What do you mean, a fibex file to parse the data? or the protocol information?

danielhrisca commented 4 years ago

The fibex. I don't know of a package to parse fibex

maxdd commented 4 years ago

Since a Fibex dbc is normally project based and under IP of a company, wouldn't it be possible to at least save the raw data to ascii format or extract the payload (per frame) in hex? e.g SomeIP protocol has a ServiceID, MethodID and then the payload containing the data. Having that payload in HEX would be already useful. The extraction itself shouldn't be fibex-based.

maxdd commented 4 years ago

I've seen in the code that if it is not a CAN message you are using "continue" to skip, would it be possible to at least output to file e.g. the decompressed payload?

danielhrisca commented 4 years ago

You can access the payload by getting the Data Bytes channel

maxdd commented 4 years ago

Which variable should i look to have a payload?

danielhrisca commented 4 years ago

according to the ETH bus logging standard it should be like this

ch = mdf.get("ETH_Frame.DataBytes")
print(ch.samples)
kriz87 commented 4 years ago

when I try to access the DataBytes of my ETH_Frame

db = mdf.get("ETH_Frame.DataBytes", group=54) print(db.samples)

I get following Error:

wrong data type "0" for vlsd channel

What can I do? Thanks!

danielhrisca commented 4 years ago

wrong data type "0" for vlsd channel

What can I do? Thanks!

It would help if you could use version 5.17.1 and share the complete error traceback message

kriz87 commented 4 years ago

I am using 5.17.1

Complete error traceback:

wrong data type "0" for vlsd channel
Stapelüberwachung:
 >  File "C:\MSP\Tools\GitRepos\mdflib\mdflib\workWithSignal.py", line 18, in <module>
 >    db = mdf.get("ETH_Frame.DataBytes", group=53)
"__main__" geladen
We've got an error while stopping in post-mortem: <class 'asammdf.blocks.utils.MdfException'>

Traceback (most recent call last):
  File "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\microsoft\python\core\ptvsd_launcher.py", line 119, in <module>

vspd.debug(filename, port_num, debug_id, debug_options, run_as)

  File "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\microsoft\python\core\Packages\ptvsd\debugger.py", line 37, in debug

run(address, filename, *args, **kwargs)

  File "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\microsoft\python\core\Packages\ptvsd\_local.py", line 79, in run_file

run(argv, addr, **kwargs)

  File "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\microsoft\python\core\Packages\ptvsd\_local.py", line 140, in _run

_pydevd.main()

  File "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\microsoft\python\core\Packages\ptvsd\_vendored\pydevd\pydevd.py", line 1934, in main

globals = debugger.run(setup['file'], None, None, is_module)

  File "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\microsoft\python\core\Packages\ptvsd\_vendored\pydevd\pydevd.py", line 1283, in run

return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)

  File "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\microsoft\python\core\Packages\ptvsd\_vendored\pydevd\pydevd.py", line 1290, in _exec

pydev_imports.execfile(file, globals, locals)  # execute the script

  File "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\microsoft\python\core\Packages\ptvsd\_vendored\pydevd\_pydev_imps\_pydev_execfile.py", line 25, in execfile

exec(compile(contents+"\n", file, 'exec'), glob, loc)

  File "C:\MSP\Tools\GitRepos\mdflib\mdflib\workWithSignal.py", line 18, in <module>

db = mdf.get("ETH_Frame.DataBytes", group=53)

  File "C:\Python\Python37\lib\site-packages\asammdf\blocks\mdf_v4.py", line 6393, in get

master_is_required=master_is_required,

  File "C:\Python\Python37\lib\site-packages\asammdf\blocks\mdf_v4.py", line 7447, in _get_scalar

f'wrong data type "{data_type}" for vlsd channel'

asammdf.blocks.utils
.
MdfException
: 
wrong data type "0" for vlsd channel

Der Thread 'MainThread' (0x1) hat mit Code 0 (0x0) geendet.
Das Programm "python.exe" wurde mit Code 0 (0x0) beendet.
kriz87 commented 4 years ago

Hi Daniel, do you have an idea, what I'm doing wrong? Does it depend on my mf4 file? Thanks very much in advance!

danielhrisca commented 4 years ago

Can you make a screenshot of the channel using Vector MDFValidator?

danielhrisca commented 4 years ago

Or even the pop-up window when you double click a channel in the asammdf GUI

danielhrisca commented 4 years ago

The other option would be to send the file for analysis (either as it is or you can also scramble it https://asammdf.readthedocs.io/en/latest/api.html#asammdf.mdf.MDF.scramble

kriz87 commented 4 years ago

I have sent you screenshots and the scrambled file. Thanks!

kriz87 commented 4 years ago

Have you had a chance to look into the file?

danielhrisca commented 4 years ago

@maxdd I wrote an e-mail

danielhrisca commented 4 years ago

What tools was used to generate this file? The MDF file header states "DATALOG"

kriz87 commented 4 years ago

Thanks for your mail. Looks like the solution for me. The file was generated in that data logger: https://caetec.de/en/products/a/arcos/