File

As part of the Edge Xpert distribution, IOTech provides a File Device Service. This allows Edge Xpert to export created files from a watched directory.

The File Device Service supports the following key features:

  • Definition of the maximum size of an exported file in bytes

  • Definition of the minimum size of an exported file in bytes

  • Events generated when new files are created in a watched directory, if defined in the [Driver] section of the TOML file

    Note

    Only the defined directory is watched. Any sub-directories of the watched directory are not watched.

  • Deletion of files after export to Edge Xpert, if defined in the [Driver] section of the TOML file

The File Device Service supports the following data types:

  • Binary
  • String

Each file read by the Device Service generates an event with the following:

  • String type containing the filename
  • Binary type containing the file content

The information from the Device Service can be viewed in the Readings pane.

File Examples

The following examples illustrate how the File Device Service can be used:

These examples assume that the Edge Xpert services have been started with at least the --xpert-manager and --device-file parameters. A suitable startup command would be as follows:

edgexpert up --xpert-manager --device-file

Note

You can use a local copy of docker-compose.yml, as described in the Using a Custom docker.compose File section of the Edge Xpert Command Line Interface Tool topic, to do the following:

  • Change the volumes section of the device-file entry
  • Uncomment the type: bind, source:… and target:… lines
  • Change the source value to the directory to be watched