diff --git a/examples/TimeSeriesData/aas/TimeSeriesDemo.aasx b/examples/TimeSeriesData/aas/TimeSeriesDemo.aasx index bb91664..0fe743f 100644 Binary files a/examples/TimeSeriesData/aas/TimeSeriesDemo.aasx and b/examples/TimeSeriesData/aas/TimeSeriesDemo.aasx differ diff --git a/examples/TimeSeriesData/basyx/aas-env.properties b/examples/TimeSeriesData/basyx/aas-env.properties index 3d3d08d..c0d4bc8 100644 --- a/examples/TimeSeriesData/basyx/aas-env.properties +++ b/examples/TimeSeriesData/basyx/aas-env.properties @@ -6,3 +6,5 @@ basyx.cors.allowed-methods=GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD basyx.aasrepository.feature.registryintegration=http://aas-registry:8080 basyx.submodelrepository.feature.registryintegration=http://sm-registry:8080 basyx.externalurl=http://localhost:8081 +spring.servlet.multipart.max-file-size=128MB +spring.servlet.multipart.max-request-size=128MB diff --git a/examples/TimeSeriesData/docker-compose.yaml b/examples/TimeSeriesData/docker-compose.yaml index 9f0d80e..66f781a 100644 --- a/examples/TimeSeriesData/docker-compose.yaml +++ b/examples/TimeSeriesData/docker-compose.yaml @@ -1,5 +1,5 @@ -version: '3' services: + # Time Series Database influxdb: image: influxdb:2 @@ -39,15 +39,13 @@ services: - '1883:1883' volumes: - ./mosquitto:/mosquitto - restart: always healthcheck: - test: - - CMD-SHELL - - mosquitto_sub -p 1883 -t 'topic' -C 1 -E -i probe -W 3 + test: ["CMD-SHELL", mosquitto_sub -p 1883 -t 'topic' -C 1 -E -i probe -W 3] interval: 5s timeout: 10s start_period: 1s retries: 3 + restart: always # MQTT Publisher (for testing) mqtt-publisher: @@ -57,9 +55,8 @@ services: - mosquitto restart: always - # AAS Environment aas-env: - image: eclipsebasyx/aas-environment:2.0.0-milestone-02 + image: eclipsebasyx/aas-environment:2.0.0-SNAPSHOT container_name: aas-env volumes: - ./aas:/application/aas @@ -72,30 +69,24 @@ services: condition: service_healthy sm-registry: condition: service_healthy - - # AAS Registry aas-registry: - image: eclipsebasyx/aas-registry-log-mem:2.0.0-milestone-02 + image: eclipsebasyx/aas-registry-log-mem:2.0.0-SNAPSHOT container_name: aas-registry ports: - '8082:8080' volumes: - ./basyx/aas-registry.yml:/workspace/config/application.yml restart: always - - # Submodel Registry sm-registry: - image: eclipsebasyx/submodel-registry-log-mem:2.0.0-milestone-02 + image: eclipsebasyx/submodel-registry-log-mem:2.0.0-SNAPSHOT container_name: sm-registry ports: - '8083:8080' volumes: - ./basyx/sm-registry.yml:/workspace/config/application.yml restart: always - - # AAS Web UI aas-web-ui: - image: eclipsebasyx/aas-gui:v2-240327 + image: eclipsebasyx/aas-gui:v2-241006 container_name: aas-ui ports: - '3000:3000' diff --git a/examples/TimeSeriesData/mqtt-publisher/publisher.py b/examples/TimeSeriesData/mqtt-publisher/publisher.py index 75078f8..380bc68 100644 --- a/examples/TimeSeriesData/mqtt-publisher/publisher.py +++ b/examples/TimeSeriesData/mqtt-publisher/publisher.py @@ -2,47 +2,30 @@ import random import paho.mqtt.client as mqtt -# Function to handle incoming messages - - -def on_message(client, userdata, message): - print( - f"Received message '{str(message.payload.decode('utf-8'))}' on topic '{message.topic}'") - - # MQTT settings broker_address = "mosquitto" port = 1883 -base_topic = "DemoValues/" -static_topic = "StaticStringValue" +base_topic = "EnvironmentalSensor/" # Connect to MQTT Broker client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2, "Client") -client.on_message = on_message client.connect(broker_address, port) -# Subscribe to the static values topic -client.subscribe(static_topic) - # Start the network loop in a separate thread client.loop_start() try: - # Publish a test message to static topic - client.publish(static_topic, "test") - + while True: # Generate different types of dynamic data - int_value = random.randint(0, 100) - double_value = random.uniform(0.0, 100.0) - bool_value = random.choice([True, False]) - string_value = random.choice(["Hello", "World", "Test", "MQTT"]) + temperatureValue = random.uniform(0, 30) + humidityValue = random.uniform(0.0, 100.0) + airQualityValue = random.uniform(0.0, 1000.0) # Publish dynamic data to respective subtopics - client.publish(base_topic + "temperature", int_value) - client.publish(base_topic + "speed", double_value) - client.publish(base_topic + "boolProp", bool_value) - client.publish(base_topic + "stringProp", string_value) + client.publish(base_topic + "Temperature", temperatureValue) + client.publish(base_topic + "Humidity", humidityValue) + client.publish(base_topic + "AirQuality", airQualityValue) # Wait for a short period before publishing the next set of values time.sleep(1) diff --git a/examples/TimeSeriesData/telegraf/telegraf.conf b/examples/TimeSeriesData/telegraf/telegraf.conf index 1fe3c35..61336cb 100644 --- a/examples/TimeSeriesData/telegraf/telegraf.conf +++ b/examples/TimeSeriesData/telegraf/telegraf.conf @@ -139,7 +139,9 @@ ## Topics that will be subscribed to. topics = [ - "DemoValues/speed", + "EnvironmentalSensor/Temperature", + "EnvironmentalSensor/Humidity", + "EnvironmentalSensor/AirQuality", ] ## The message topic will be stored in a tag specified by this value. If set @@ -207,45 +209,3 @@ ## Value supported is int, float, unit # [[inputs.mqtt_consumer.topic.types]] # key = type - -## 2. integer -[[inputs.mqtt_consumer]] - ## Broker URLs for the MQTT server or cluster. - servers = ["mqtt://mosquitto:1883"] - - ## Topics that will be subscribed to. - topics = [ - "DemoValues/temperature", - ] - ## Data format to consume. - data_format = "value" - data_type = "integer" - name_override = "int_metric" - -## 3. boolean -[[inputs.mqtt_consumer]] - ## Broker URLs for the MQTT server or cluster. - servers = ["mqtt://mosquitto:1883"] - - ## Topics that will be subscribed to. - topics = [ - "DemoValues/boolProp", - ] - ## Data format to consume. - data_format = "value" - data_type = "boolean" - name_override = "bool_metric" - -## 4. string -[[inputs.mqtt_consumer]] - ## Broker URLs for the MQTT server or cluster. - servers = ["mqtt://mosquitto:1883"] - - ## Topics that will be subscribed to. - topics = [ - "DemoValues/stringProp", - ] - ## Data format to consume. - data_format = "value" - data_type = "string" - name_override = "string_metric"