You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/data-processing/README.md
+21-9Lines changed: 21 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,6 @@ Download this folder, enter it, open your command prompt and run below:
16
16
-`process_data.py`: List log files between dates, DBC decode them and perform various processing
17
17
-`process_tp_data.py`: Example of how multiframe data can be handled incl. DBC decoding (Transport Protocol)
18
18
-`utils.py`: Functions/classes used in the above scripts (note: Identical to utils.py from the dashboard-writer repo)
19
-
-`utils_tp.py`: Functions/classes used for Transport Protocol handling
20
19
21
20
---
22
21
@@ -30,15 +29,31 @@ If you're using AWS S3, your endpoint would e.g. be `https://s3.us-east-2.amazon
30
29
---
31
30
32
31
### Regarding Transport Protocol example
33
-
The example in `process_tp_data.py` should be seen as a very simplistic WIP TP implementation. It can be used as a starting point and will most likely need to be modified for individual use cases. We of course welcome any questions/feedback on this functionality.
32
+
The example in `process_tp_data.py` should be seen as a very simplistic TP implementation. It can be used as a starting point and will most likely need to be modified for individual use cases. We of course welcome any questions/feedback on this functionality.
34
33
35
34
The basic concept works as follows:
36
35
37
-
1. You specify a list of 'response IDs', which are the CAN IDs with multiframe responses
38
-
2. The raw data is filtered by the response IDs and the payloads of these frames are combined
36
+
1. You specify the "type" of transport protocol: UDS (`uds`), J1939 (`j1939`) or NMEA 2000 Fast Packets (`nmea`)
37
+
2. The raw data is filtered by the protocol-specific 'TP response IDs' and the payloads of these frames are combined
39
38
3. The original response frames are then replaced by these re-constructed frames with payloads >8 bytes
40
-
4. You can modify how the first/consequtive frames are interpreted (see the UDS and J1939 examples)
41
-
5. The re-constructed data can be decoded using DBC files, optionally using multiplexing as in the sample UDS DBC files
39
+
4. The re-constructed data can be decoded using DBC files, optionally using multiplexing as in the sample UDS DBC files
40
+
41
+
#### Implementing TP processing in other scripts
42
+
To use the Transport Protocol functionality in other scripts, you need to make minor modifications:
43
+
44
+
1. Ensure that you import the `MultiFrameDecoder` class from `utils.py`
45
+
2. Specify the type via the `tp_type` variable and ensure you include this in the `extract_phys` function
For UDS basics see the [Wikipedia article](https://en.wikipedia.org/wiki/Unified_Diagnostic_Services). The UDS example for device `17BD1DB7` shows UDS response data from a Hyunda Kona EV.
@@ -79,6 +94,3 @@ A UDS DBC file can use extended multiplexing to decode UDS signals, utilizing th
79
94
80
95
The script merges the reconstructed UDS frames into the original data (removing the original entries of the response ID). The result is a new raw dataframe that can be processed as you would normally do (using a suitable DBC file). The above example has an associated DBC file, `tp_uds_hyundai_soc.dbc`, which lets you extract e.g. State of Charge.
81
96
82
-
-----
83
-
### Pending improvements
84
-
- Improve the UDS/J1939 scripts to alternatively trigger the creation of a new combined frame once the payload exceeds the data length
0 commit comments