Skip to content

Commit fa37c4e

Browse files
authoredFeb 3, 2025
Merge pull request #7 from judehung/update-app-service-template
fix: Update app-service-template/README.md to reflect changes made in edgex-compose
2 parents fa58ee5 + 9aeef9d commit fa37c4e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed
 

‎app-service-template/README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@ This sample application service--**app-new-service**--is configured with default
77
Follow the instructions below to try this sample application service:
88

99
1. Prepare your local development environment with following dependencies:
10-
- python 3.10 or above
10+
- python 3.10
1111
- docker
1212
- make
1313
- git
1414

1515
2. As the app service will use default Message Bus trigger to consume events from EdgeX MessageBus, we have to run up EdgeX core services and device-virtual service to simulate the EdgeX events in your local environment. The easiest way to run up EdgeX services is through script available from https://github.com/edgexfoundry/edgex-compose:
1616
- `git clone https://github.com/edgexfoundry/edgex-compose.git`
1717
- switch into the `edgex-compose/compose-builder` directory
18-
- `make run no-secty ds-virtual mqtt-bus keeper`
18+
- `make run no-secty ds-virtual`
1919

2020
3. By the completion of above step, you will have EdgeX core services, device-virtual service, and an MQTT broker running as docker container in your local environment, and you can examine their running status by using command: `docker ps -a`. Note that the running device-virtual service will periodically generate EdgeX events and publish them to EdgeX message bus, and you can observe those EdgeX events by using following command:
2121
- `docker exec edgex-mqtt-broker mosquitto_sub -v -t 'edgex/events/#'`
2222

2323
4. Now we have EdgeX services up and running, the next step is to copy contents of this repository to your local environment by using following command:
24-
- `git clone https://github.com/IOTechSystems/app-functions-sdk-python.git`
24+
- `git clone https://github.com/edgexfoundry/app-functions-sdk-python.git`
2525

2626
5. Switch into the `app-functions-sdk-python` directory
2727

2828
6. Examine the code of `app-service-template/main.py` to understand how to write a custom application service using the App Functions Python SDK.
2929

30-
7. Create a virtual environment in the root of the repository in your local environment:
31-
- `python3 -m venv venv`
30+
7. Create a virtual environment based on python3.10 in the root of the repository in your local environment:
31+
- `python3.10 -m venv venv`
3232

3333
8. Switch to the virtual environment:
3434
- `source ./venv/bin/activate`
@@ -45,5 +45,10 @@ Follow the instructions below to try this sample application service:
4545

4646
12. Once the app-new-service is running, it will consume EdgeX events from the EdgeX message bus, filter for events coming from **Random-Integer-Device**, and then re-publish the events to an external MQTT broker **test.mosquitto.org** via **test_topic** topic. To observe those events being published to **test.mosquitto.org**, you can use following command:
4747
- `docker exec edgex-mqtt-broker mosquitto_sub -v -t 'test_topic' -h test.mosquitto.org`
48+
```shell
49+
test_topic {"id": "247a70e3-2aa1-42be-88e5-82d6e9bf1041", "deviceName": "Random-Integer-Device", "profileName": "Random-Integer-Device", "sourceName": "Int8", "origin": 1738569195201797427, "readings": [{"id": "37286bf5-82f5-45bb-b93b-db1ff64a6644", "origin": 1738569195201797427, "deviceName": "Random-Integer-Device", "resourceName": "Int8", "profileName": "Random-Integer-Device", "valueType": "Int8", "value": "-2", "units": "", "binaryValue": null, "objectValue": null, "tags": {}, "mediaType": ""}], "tags": {}}
50+
test_topic {"id": "bbe07061-86e2-4703-bc85-a471bd03ec31", "deviceName": "Random-Integer-Device", "profileName": "Random-Integer-Device", "sourceName": "Int16", "origin": 1738569195201861388, "readings": [{"id": "2c59a79b-8d37-4f5a-8267-99902ab4b6d3", "origin": 1738569195201861388, "deviceName": "Random-Integer-Device", "resourceName": "Int16", "profileName": "Random-Integer-Device", "valueType": "Int16", "value": "-2295", "units": "", "binaryValue": null, "objectValue": null, "tags": {}, "mediaType": ""}], "tags": {}}
51+
test_topic {"id": "4de8c1a9-08fa-4a95-935f-7c0fa81cbca9", "deviceName": "Random-Integer-Device", "profileName": "Random-Integer-Device", "sourceName": "Int32", "origin": 1738569195201918924, "readings": [{"id": "2bf5e926-bbe3-4468-91e0-0e8d2cb6d67c", "origin": 1738569195201918924, "deviceName": "Random-Integer-Device", "resourceName": "Int32", "profileName": "Random-Integer-Device", "valueType": "Int32", "value": "509211916", "units": "", "binaryValue": null, "objectValue": null, "tags": {}, "mediaType": ""}], "tags": {}}
52+
```
4853

4954
13. To stop the app-new-service, you can press `Ctrl+C` to stop the running process.

0 commit comments

Comments
 (0)