# Executing this version

Check the following examples for executing your agent.

TIP

In the following examples, the binary version of the agent is used. However, if you use the agent's Docker image, you can use the same inputs when executing your container.

# Input parameters

You can obtain a complete list of the available input parameters by executing:

./coap --help

# Version

You can easily check the version, the target operating system, architecture, and extra information about this agent by executing:

./coap --version

# Default

The basic command for running your agent is as follows:

./coap --id 2 \
  --gateway 127.0.0.1:9090 \
  --token 44049908-de2d-4811-add7-0608b9f18538

This command will set your agent as follows:

  • It will identify the agent with id 2 and token 44049908-de2d-4811-add7-0608b9f18538 when connecting to the IoTHub
  • It will connect the agent with the IoTHub Gateway module running at the address 127.0.0.1 port 9090
  • It will disable the internal debug mode by logging only info, warnings, and error messages

# Enable debug

For enabling the internal debug mode and log also debug messages you can execute your agent as follows:

./coap --id 2 \
  --gateway 127.0.0.1:9090 \
  --token 44049908-de2d-4811-add7-0608b9f18538 \
  --debug true

# Custom multicast

For specifying a custom multicast address you can execute your agent as follows:

./coap --id 2 \
  --gateway 127.0.0.1:9090 \
  --token 44049908-de2d-4811-add7-0608b9f18538 \
  --debug true \
  --multicast 224.0.1.187:5683

# Config file

You can also specify a YAML file with your input settings.

id: 2
token: 44049908-de2d-4811-add7-0608b9f18538
gateway: 127.0.0.1:9090
debug: true
multicast: 224.0.1.187:5683

Then, you can input this configuration file into your agent as follows:

./coap --config-file /path/to/config.yml
Last Updated: 1/26/2022, 3:40:03 PM