Modality reflector plugins for CAN (Controller Area Network).
Lowercase names are the config keys which may be used in a reflector config toml file. Uppercase names are environment variables which may be used for the same configuration.
These options are used by both the collectors and the importers.
-
timeline-from-node/MODALITY_CAN_TIMELINE_FROM_NODEShould the transmitting DBC node be used as the timeline identity and name? Defaults to true. -
default-timeline/MODALITY_CAN_TIMELINEThe default timeline name used when no DBC file is provided, or there are no transmitting nodes for a given CAN frame in the provided DBC. Defaults to 'canbus'. -
event-from-message/MODALITY_CAN_EVENT_FROM_MESSAGEUse the DBC message name for event naming. Defaults to true. When no DBC file is provided, or there is no message definition, the CAN ID will be used. -
dbc/MODALITY_CAN_DBCDBC file to use when parsing the CAN frames. -
MODALITY_RUN_IDThe run id to value to use in timeline metadata (timeline.run_id). This is used as the basis for the segmentation method used in the default Modality workspace. Defaults to a randomly generated uuid. -
MODALITY_AUTH_TOKENThe content of the auth token to use when connecting to Modality. If this is not set, the auth token used by the Modality CLI is read from~/.config/modality_cli/.user_auth_token -
MODALITY_HOSTThe hostname where the modality server is running.
These options are used by the SocketCAN collector.
-
interface/MODALITY_CAN_INTERFACEThe SocketCAN interface to use. Defaults to 'can0'. -
filters/MODALITY_CAN_FILTERSList of CAN filters to apply. When provided via the environment variable, use the format<id>:<mask>[:!]for a single filter. Can be comma-separated for multiple filters. -
hw-timestamps/MODALITY_CAN_HW_TIMESTAMPSEnable receive hardware timestamps. Defaults to true. -
bitrate/MODALITY_CAN_BITRATECAN bitrate. Defaults to unchanged. This is a privileged operation that requires theCAP_NET_ADMINcapability. -
data-bitrate/MODALITY_CAN_DATA_BITRATECAN FD data bitrate. Defaults to unchanged. This is a privileged operation that requires theCAP_NET_ADMINcapability. -
restart-ms/MODALITY_CAN_RESTART_MSSet the automatic restart time (in milliseconds). Zero means auto-restart is disabled. Defaults to unchanged. This is a privileged operation that requires theCAP_NET_ADMINcapability. -
termination/MODALITY_CAN_TERMINATIONThe CAN bus termination resistance. Defaults to unchanged. This is a privileged operation that requires theCAP_NET_ADMINcapability. -
listen-only/MODALITY_CAN_LISTEN_ONLYSet the listen-only control mode bit. Defaults to false. This is a privileged operation that requires theCAP_NET_ADMINcapability. -
fd/MODALITY_CAN_FDSet the CAN FD control mode bit. Defaults to false. This is a privileged operation that requires theCAP_NET_ADMINcapability.
These options are used by the importer.
absolute-timestamps/MODALITY_CAN_ABSOLUTE_TIMESTAMPSAssume the timestamps in the log are absolute. For hardware timestamps, leave false. Defaults to false.
The following describes the default mapping between CAN/DBC concepts and Modality's concepts.
-
Timeline creation is customizable, based on the
timeline-from-nodeconfiguration option.- If a DBC file is given, then the transmitting node for a given message will be used for the timeline.
- If the message is not known to the DBC, or a DBC was not given, then the
default-timelinename is used.
-
Events are named based on the message name in the DBC, or the CAN ID if not found or no DBC file was provided.
-
DBC message signals are parsed into attribute key/value pairs.
-
CAN frame-level details (e.g. DLC) are logged with the prefix
event.frame.. -
The importer currently supports candump logs produces by the
candumputility from thecan-utilspackage.