Skip to main content
Version: 3.6.0

Simulated Source

The Tributech Simulated Source allows us to simulate a data source for testing purposes.

Setup

The Tributech Simulated Source image can be started without any dependencies but will not be functional without a valid Twin Configuration or MessageBroker connect to the Tributech Agent. The TwinConfiguration can be provided via the Tributech Node (recommended) or MessageBroker (see Source Integration). The Simulated Source will automatically connect to the Tributech Agent if the Tributech Agent is running and the Simulated Source is configured with the correct MessageBroker settings. In the following section we will describe the setup of a Tributech Simulated Source:

  • Setup the docker environment by creating a .env file with the following content and replace the placeholder values with your values:
.env
AGENT_TAG=3.6.1
AGENT_ID=00000000-0000-0000-0000-000000000007
SOURCE_TAG=3.6.0
  • Setup the docker-compose.yml file by creating a docker-compose.yml file with the following content in the same folder as the .env file:
docker-compose.yml
version: "3.6"

services:
source-simulated:
image: ${DOCKER_REGISTRY-tributech.azurecr.io/}tributech-source-simulated:${SOURCE_TAG:-latest}
depends_on:
- mosquitto-server-simulated
- tributech-agent-simulated
environment:
- Logging__LogLevel__Default=Trace
- Logging__Console__FormatterName=simple
- MqttOptions__MQTTHost=mosquitto-server-simulated
networks:
- simulated-net
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "2m"
max-file: "5"

tributech-agent-simulated:
image: ${DOCKER_REGISTRY-tributech.azurecr.io/}tributech-agent:${AGENT_TAG:-latest}
depends_on:
- mosquitto-server-simulated
environment:
- Logging__LogLevel__Default=Trace
- Logging__Console__FormatterName=simple
- MqttOptions__MQTTHost=mosquitto-server-simulated
- EdgeDeviceOptions__AgentID=${AGENT_ID:?"The variable AGENT_ID needs to be configured in the .env file."}
ports:
- "5000:80"
networks:
- simulated-net
volumes:
- ./volumes/simulated/agent/:/app/data # volume mapping for permanent storage of keys and datatwin file
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "2m"
max-file: "5"

mosquitto-server-simulated:
image: eclipse-mosquitto:${MQTT_TAG:-1.6}
networks:
- simulated-net
# ports:
# - '1883:1883' # MQTT
# - "127.0.0.1:9001:9001" # web-socket
restart: unless-stopped

networks:
simulated-net:

Configuration

**Configure agent**

Right click the Edge Device and add a Simulated Source:

**Simulated Source Add**

Right click the newly added Simulated Source and add a Simulated Stream:

**Simulated Stream Add**

Adjust the Stream settings to your needs and save the settings by clicking Save in workspace:

**Apply Stream Settings**

Repeat this step for every stream you need.

After saving all streams in the workspace we can send the configuration to the Tributech Agent and update currently running Tributech Source configuration by clicking Apply configuration **Save Simulated Source0**

Value Change Options (VCO) Handling

The basic handling of VCO can be found in Source Integration. This section contains the concrete handling of the Step (Delta) for the simulated source. The following list contains the description for each supported Stream Data Encoding where X represents the value for Step (Delta):

  • Double, Int32, Long, Float: defines the minimum difference between values to be submitted, the change is always compared to the last successful submitted value, e.g. if X= 3 if the double values 1, 2, 5, 8, 10, 11, 14 are received by the Tributech Source only 1, 5, 8, 11, 14 will be submitted.
  • Byte Array: will only be submitted if the current and last submitted value are not equal
  • String UTF 8: will only be submitted if the current and last submitted value are not equal
  • Boolean: will only be submitted if the current and last submitted value are not equal