Skip to content

Commit de07861

Browse files
committed
Split IoT Devices and Tutorial Web-App
1 parent 768d33a commit de07861

File tree

3 files changed

+39
-25
lines changed

3 files changed

+39
-25
lines changed

docker-compose/common.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,40 +88,51 @@ services:
8888
healthcheck:
8989
interval: 30s
9090

91-
# Tutorial acts as a series of dummy IoT Sensors over HTTP
91+
# A series of dummy IoT Sensors over HTTP
92+
iot-sensors:
93+
labels:
94+
org.fiware: 'tutorial'
95+
image: quay.io/fiware/tutorials.iot-devices
96+
hostname: iot-sensors
97+
container_name: fiware-iot-devices
98+
networks:
99+
- default
100+
expose:
101+
- "${TUTORIAL_DUMMY_DEVICE_PORT}"
102+
ports:
103+
- "${TUTORIAL_DUMMY_DEVICE_PORT}:${TUTORIAL_DUMMY_DEVICE_PORT}" # localhost:3001
104+
environment:
105+
- DEBUG=devices:*
106+
- WEB_APP_HOST=tutorial
107+
- WEB_APP_PORT=${TUTORIAL_APP_PORT} # Port used by the content provider proxy and web-app for viewing data
108+
- IOTA_HTTP_HOST=iot-agent
109+
- IOTA_HTTP_PORT=${IOTA_SOUTH_PORT}
110+
111+
# Tutorial acts as a Farm Management Information System
92112
tutorial:
93113
labels:
94114
org.fiware: 'tutorial'
95115
image: quay.io/fiware/tutorials.ngsi-ld
96-
hostname: iot-sensors
116+
hostname: tutorial
97117
container_name: fiware-tutorial
98118
depends_on:
99119
- mongo-db
100120
networks:
101-
default:
102-
aliases:
103-
- tutorial
104-
- context-provider
121+
- default
105122
expose:
106123
- "${TUTORIAL_APP_PORT}"
107-
- "${TUTORIAL_DUMMY_DEVICE_PORT}"
108124
ports:
109125
- "${TUTORIAL_APP_PORT}:${TUTORIAL_APP_PORT}" # localhost:3000
110-
- "${TUTORIAL_DUMMY_DEVICE_PORT}:${TUTORIAL_DUMMY_DEVICE_PORT}" # localhost:3001
111126
environment:
112127
- DEBUG=tutorial:*
113128
- WEB_APP_PORT=${TUTORIAL_APP_PORT} # Port used by the content provider proxy and web-app for viewing data
114129
- IOTA_HTTP_HOST=iot-agent
115130
- IOTA_HTTP_PORT=${IOTA_SOUTH_PORT}
116-
- OPENWEATHERMAP_KEY_ID=<ADD_YOUR_KEY_ID>
117-
- TWITTER_CONSUMER_KEY=<ADD_YOUR_CONSUMER_KEY>
118-
- TWITTER_CONSUMER_SECRET=<ADD_YOUR_CONSUMER_SECRET>
131+
- DUMMY_DEVICES=http://iot-sensors:3001
119132
- MONGO_URL=mongodb://mongo-db:27017
120133
- IOTA_JSON_LD_CONTEXT=http://context/user-context.jsonld
121134
- NGSI_LD_TENANT=openiot
122135

123-
124-
125136
networks:
126137
default:
127138
labels:

provision-devices

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ curl -s -o /dev/null -X POST \
205205
"entity_name": "urn:ngsi-ld:Device:water001",
206206
"entity_type": "Water",
207207
"apikey": "112903447",
208-
"endpoint": "http://tutorial:3001/iot/water001",
208+
"endpoint": "http://iot-sensors:3001/iot/water001",
209209
"static_attributes": [
210210
{"name": "controlledAsset", "type": "Relationship","value": "urn:ngsi-ld:Building:barn001"}
211211
]
@@ -215,7 +215,7 @@ curl -s -o /dev/null -X POST \
215215
"entity_name": "urn:ngsi-ld:Device:filling001",
216216
"entity_type": "FillingLevelSensor",
217217
"apikey": "854782081",
218-
"endpoint": "http://tutorial:3001/iot/filling001",
218+
"endpoint": "http://iot-sensors:3001/iot/filling001",
219219
"static_attributes": [
220220
{"name": "controlledAsset", "type": "Relationship","value": "urn:ngsi-ld:Building:farm001"}
221221
]
@@ -225,7 +225,7 @@ curl -s -o /dev/null -X POST \
225225
"entity_name": "urn:ngsi-ld:Device:tractor001",
226226
"entity_type": "Tractor",
227227
"apikey": "1067386313",
228-
"endpoint": "http://tutorial:3001/iot/tractor001",
228+
"endpoint": "http://iot-sensors:3001/iot/tractor001",
229229
"static_attributes": [
230230
{"name": "controlledAsset", "type": "Relationship","value": "urn:ngsi-ld:Building:farm001"}
231231
]
@@ -260,7 +260,7 @@ curl -s -o /dev/null -X POST \
260260
"entity_name": "urn:ngsi-ld:Device:water002",
261261
"entity_type": "Water",
262262
"apikey": "112903447",
263-
"endpoint": "http://tutorial:3001/iot/water002",
263+
"endpoint": "http://iot-sensors:3001/iot/water002",
264264
"static_attributes": [
265265
{"name": "controlledAsset", "type": "Relationship","value": "urn:ngsi-ld:Building:barn002"}
266266
]
@@ -270,7 +270,7 @@ curl -s -o /dev/null -X POST \
270270
"entity_name": "urn:ngsi-ld:Device:filling002",
271271
"entity_type": "FillingLevelSensor",
272272
"apikey": "854782081",
273-
"endpoint": "http://tutorial:3001/iot/filling002",
273+
"endpoint": "http://iot-sensors:3001/iot/filling002",
274274
"static_attributes": [
275275
{"name": "controlledAsset", "type": "Relationship","value": "urn:ngsi-ld:Building:farm002"}
276276
]
@@ -280,7 +280,7 @@ curl -s -o /dev/null -X POST \
280280
"entity_name": "urn:ngsi-ld:Device:tractor002",
281281
"entity_type": "Tractor",
282282
"apikey": "1067386313",
283-
"endpoint": "http://tutorial:3001/iot/tractor002",
283+
"endpoint": "http://iot-sensors:3001/iot/tractor002",
284284
"static_attributes": [
285285
{"name": "controlledAsset", "type": "Relationship","value": "urn:ngsi-ld:Building:farm002"}
286286
]
@@ -315,7 +315,7 @@ curl -s -o /dev/null -X POST \
315315
"entity_name": "urn:ngsi-ld:Device:water003",
316316
"entity_type": "Water",
317317
"apikey": "112903447",
318-
"endpoint": "http://tutorial:3001/iot/water003",
318+
"endpoint": "http://iot-sensors:3001/iot/water003",
319319
"static_attributes": [
320320
{"name": "controlledAsset", "type": "Relationship","value": "urn:ngsi-ld:Building:barn003"}
321321
]
@@ -325,7 +325,7 @@ curl -s -o /dev/null -X POST \
325325
"entity_name": "urn:ngsi-ld:Device:filling003",
326326
"entity_type": "FillingLevelSensor",
327327
"apikey": "854782081",
328-
"endpoint": "http://tutorial:3001/iot/filling003",
328+
"endpoint": "http://iot-sensors:3001/iot/filling003",
329329
"static_attributes": [
330330
{"name": "controlledAsset", "type": "Relationship","value": "urn:ngsi-ld:Building:farm003"}
331331
]
@@ -335,7 +335,7 @@ curl -s -o /dev/null -X POST \
335335
"entity_name": "urn:ngsi-ld:Device:tractor003",
336336
"entity_type": "Tractor",
337337
"apikey": "1067386313",
338-
"endpoint": "http://tutorial:3001/iot/tractor003",
338+
"endpoint": "http://iot-sensors:3001/iot/tractor003",
339339
"static_attributes": [
340340
{"name": "controlledAsset", "type": "Relationship","value": "urn:ngsi-ld:Building:farm003"}
341341
]
@@ -371,7 +371,7 @@ curl -s -o /dev/null -X POST \
371371
"entity_name": "urn:ngsi-ld:Device:water004",
372372
"entity_type": "Water",
373373
"apikey": "112903447",
374-
"endpoint": "http://tutorial:3001/iot/water004",
374+
"endpoint": "http://iot-sensors:3001/iot/water004",
375375
"static_attributes": [
376376
{"name": "controlledAsset", "type": "Relationship","value": "urn:ngsi-ld:Building:barn004"}
377377
]
@@ -381,7 +381,7 @@ curl -s -o /dev/null -X POST \
381381
"entity_name": "urn:ngsi-ld:Device:filling004",
382382
"entity_type": "FillingLevelSensor",
383383
"apikey": "854782081",
384-
"endpoint": "http://tutorial:3001/iot/filling004",
384+
"endpoint": "http://iot-sensors:3001/iot/filling004",
385385
"static_attributes": [
386386
{"name": "controlledAsset", "type": "Relationship","value": "urn:ngsi-ld:Building:farm004"}
387387
]
@@ -391,7 +391,7 @@ curl -s -o /dev/null -X POST \
391391
"entity_name": "urn:ngsi-ld:Device:tractor004",
392392
"entity_type": "Tractor",
393393
"apikey": "1067386313",
394-
"endpoint": "http://tutorial:3001/iot/tractor004",
394+
"endpoint": "http://iot-sensors:3001/iot/tractor004",
395395
"static_attributes": [
396396
{"name": "controlledAsset", "type": "Relationship","value": "urn:ngsi-ld:Building:farm004"}
397397
]

services

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ case "${command}" in
223223
echo -e "- \033[1;34mOrion\033[0m is the context broker"
224224
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the UltraLight Protocol"
225225
echo -e "- \033[1mTutorial\033[0m displays a web app to manipulate the context directly"
226+
echo -e "- \033[1mIoT Devices\033[0m acts as a series of dummy IoT Sensors over HTTP"
226227
echo -e "- Data models \033[1m@context\033[0m (Smart Farm) is supplied externally"
227228
echo ""
228229
${dockerCmd} -f docker-compose/common.yml -f docker-compose/orion-ld.yml up -d --remove-orphans --renew-anon-volumes
@@ -241,6 +242,7 @@ case "${command}" in
241242
echo -e "- \033[1;34mScorpio\033[0m is the context broker"
242243
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the UltraLight Protocol"
243244
echo -e "- \033[1mTutorial\033[0m displays a web app to manipulate the context directly"
245+
echo -e "- \033[1mIoT Devices\033[0m acts as a series of dummy IoT Sensors over HTTP"
244246
echo -e "- Data models \033[1m@context\033[0m (Smart Farm) is supplied externally"
245247
echo ""
246248
${dockerCmd} -f docker-compose/common.yml -f docker-compose/scorpio.yml up -d --remove-orphans --renew-anon-volumes
@@ -259,6 +261,7 @@ case "${command}" in
259261
echo -e "- \033[1;34mStellio\033[0m is the context broker"
260262
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the UltraLight Protocol"
261263
echo -e "- \033[1mTutorial\033[0m displays a web app to manipulate the context directly"
264+
echo -e "- \033[1mIoT Devices\033[0m acts as a series of dummy IoT Sensors over HTTP"
262265
echo -e "- Data models \033[1m@context\033[0m (Smart Farm) is supplied externally"
263266
echo ""
264267
${dockerCmd} -f docker-compose/common.yml -f docker-compose/stellio.yml up -d --remove-orphans --renew-anon-volumes

0 commit comments

Comments
 (0)