This example demonstrates the use of Apama to average temperature sensor values over a 10 second window. If the average temperature exceeds a threshold (80 in this example) then an alert is sent to the cloud and a shutdown is initiated.
Copyright (c) 2022-2023 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG
Follow the setup and configuration instructions in the README file in the parent directory before running this sample.
Ensure that the thin-edge device has Python 3 installed, that it is on your $path
,
and that you have installed the paho-mqtt Python library:
sudo apt-get install python3
pip3 install paho-mqtt
Zip the project located in the LowLatencyCommandAndControl
directory of this repository. Note that you must use the zip format and not some other compression utility. Then use your tenant to deploy the zipped project to your thin-edge device by following these steps:
test_publisher.py
script in the LowLatencyCommandAndControl
directory to the
/etc/tedge/apama/project
directory on the thin-edge device. Execute the script to send some fake
temperature measurements to the Apama application.'sensors/temperature'
. tedge mqtt sub 'alerts/temperature'
.'device/operations'
to trigger shutdown operation whenever average temperature in last 10 seconds window
exceeds threshold temperature.