CAN Explorer
Goal
Display CAN messages coming in from the CAN bus within a GUI. The GUI should display both raw and decoded CAN data based on the DBC file in a convenient way. Extra features can be added later on such as the ability to filter messages and the ability to sort the data.
Definitions
Decoded CAN Data: Similar to telemetry, see Telemetry: Architecture and look specifically at the aggregating data section. We need the datetime, name of message, sender, and data.
Raw CAN Data: See https://python-can.readthedocs.io/en/master/message.html#can.Message. We need the timestamp, arbitration ID, DLC, and data from the raw CAN data.
Architecture
Below is the architecture for the project. Note that this is very similar to the telemetry project except that the data should be streamed to the CAN explorer project. There are also some features for the project
Main Requirements
These are the main requirements for the project that must be implemented.
Python script to aggregate the data and continuously send the raw data and decoded data to the application
GUI created with Python (or with another tool) that allows the user to:
Load a DBC file
Log CAN message (raw and decoded) from the CAN bus
Configure settings (such as bitrate) when reading data
This application should run easily and it would be nice for it to be platform-independent.
Features
These features are to be added after the main requirements have been fulfilled.
Ability to pack/send CAN message and the ability to filter messages when logging messages from the CAN bus
Representation of the raw data in different number systems (eg binary)
Ability to pause and resume the logging of data
Sort the CAN data that is received based on a primary key, such as the DateTime
Details
Two components: python script and GUI
Tasklist
Setup new repo to hold CAN explorer
Create a Python script to aggregate the data and stream the data with WebSockets, see telemetry_xiv for inspiration. The telemetry_scripts folder should hold web_aggregate_can_data.py which should be useful for developing the python script for CAN Explorer.
Figure out how to develop a GUI with Python. Tkinter might be helpful in this case. However, other tools can be used if they are easier to use. The main thing to keep in mind is that the Python script needs to connect to the backend of the GUI and stream data through websockets (or another protocol can be used if it is more suitable)
Develop intuitive design for the GUI that allows the user to easily read the logged CAN. A table would suffice to display this data. However, do keep in mind that this table should be configurable and should allow the user to sort through the data easier later on.
Develop backend of the GUI that connects to the Python script and can retrieve the data
Create functions to allow the user to configure settings within the GUI and send these settings to the Python script
Figure out how the CAN data should be stored within the application.
Deploy the application. This application should be easily run and should not require the user to have to setup many things. Might be good to use something like Docker so it can be platform-independent. However, if this is not possible we can always just stick with Ubuntu.