Percepio Receiver
-----------------
Release 2025.1, April 15, 2025.


This tool extracts "alert data" created by the DFM library from device log files and converts it
to alert files for ingestion into the Percepio Detect server. Use this tool while testing your
device to capture issues reported via DFM.

This tool requires that you have python installed and accessible from the command line.

Start the receiver by calling the start script:
- On Linux: ./percepio-receiver.sh
- On Windows: percepio-receiver.bat

Running Percepio Receiver as-is will use the bundled demo log file as input and write the 
alert files to the test-data/alert-files directory. By default, the script will wait for 
additional data to be added in the log file, so close it with Ctrl-C.

To use Percepio Receiver on your own log file open the start script and
update the following variables to match your setup:

* DEVICE_OUTPUT_LOGFILE: The path to the device log file containing alert data (i.e. the input).
  This is typically generated from a serial terminal program, such as TeraTerm.

* ALERTS_DIR: Where to output the alert files, i.e. where the server is looking for data. 
  If the server isn't running on the same computer, use a network-shared folder, accessible
  from both the server and your local machine.

* DEVICE_ID: If the DFM library on the target device has been initialized using
  xDfmInitializeForLocalUse(), a dummy value for DeviceID is used in the uploaded alerts and
  replaced in the Receiver tool by the DEVICE_ID argument. This way, you don't need to specify
  a Device ID when configurating the DFM library. If the DFM library is using a different
  Device ID's (not the dummy value), it is not changed by this option.

The start script assumes that the device log file is being written by the serial terminal
and read by receiver in real time. Therefore, the receiver will keep waiting
for more data when reaching the end of the file (quit using Ctrl-C). 

If you like to process files that are already finished (not being updated), you can change the 
argument in the script from "--eof wait" to "--eof exit". With this setting, the receiver exits
when reaching the end of the file.

NOTE: If the device library (DFM) has been initialized using xDfmInitializeForLocalUse(), the
current host time is used as SessionID. This avoids the need to implement a unique SessionID
in DFM. However, if running this tool multiple times on the same log file, you will get
duplicated alert files with different identifiers. So make sure to start the receiver tool
with a fresh log file, not containing any previously processed alerts.

For questions and assistance, please contact Percepio at 
 
     https://percepio.com/contact-us/

Copyright (c), Percepio AB, 2025
https://percepio.com

    
