CAN file and SFTP loggers
The CAN File Logger and the CAN SFTP Logger record native CAN bus messages to a file. The CAN File Logger stores the file on the local file system of the machine running Profinity. The CAN SFTP Logger transmits it to a remote Secure Shell (SSH) File Transfer Protocol (SFTP) server.
Each is added to a Profile as its own component under Loggers and is included in every edition. Profinity can also log and replay messages from a CAN bus network.
flowchart LR
Source["CAN bus messages"] --> File["CAN File Logger"] --> Files["Local log files"]
Source --> Sftp["CAN SFTP Logger"] --> Server["SFTP server"]
Both loggers have Auto connect, which is on by default, so a logger begins logging when the Profile loads. Refer to Connections and reconnecting for how it behaves. They record the bus, so they do not use tag collections.
Quick start
You need a CAN adapter connected to a CAN bus that carries traffic. The logger writes a message only when it receives one, so without traffic the file records no messages.
- Add the CAN File Logger from the Loggers group in the component catalogue, as described in How to add a component to your profile.
- Check Name. The default is
CAN File Logger. - Select ADD COMPONENT at the bottom of the dialog.
- Leave Auto connect on, which is its default, so the logger starts when the profile loads. If it is off, select Start Logger from the menu.
- On the logger dashboard, check that STATUS shows On.
- Once CAN messages have been recorded, select FILE LOGS REPOSITORY under DOWNLOAD VIA to download the log file.
Both loggers have these settings:
- Update interval (seconds) sets how often the background task runs. It defaults to 10 and accepts values from 1 to 86400. For the CAN File Logger, each CAN packet is written to the file as it arrives, and the interval checks time-based rotation only.
- File format chooses the layout of the text file, which always uses a
.txtextension. Prohelion, the default, writes a line for every packet with a Sent or Received column. Tritium writes the same fields without that column. Choose Tritium when Tritium or WaveSculptor tools will read the log, and keep Prohelion otherwise.
The CAN File Logger has no destination setting.
It creates its files under the Profinity CAN bus log directory (can_bus_logs/), in a folder named after the Profile and the component.
Refer to the artefacts directory for where that directory sits on each platform.
The CAN SFTP Logger needs the remote server settings described in File logger rotation, archive, and SFTP settings, which also covers rotating, archiving, and compressing the log files.
Example
This example is for illustration only.
Add it under components: in the profile.yaml file of the profile.
- component:
type: CANFileLogger
name: CAN File Logger 1
intervalSec: 10
fileFormat: Prohelion
autoConnect: true
This logger writes the Prohelion format and updates every 10 seconds.
Use fileFormat: Tritium for the Tritium format.
Download the logged files
Once a log file has been created, select the link on the Logger Dashboard to download it from Profinity. A CAN File Logger shows this link as FILE LOGS REPOSITORY.
For the SFTP connection and the rotation and archive settings, refer to File logger rotation, archive, and SFTP settings.
