Skip to content

Commit 8ee7bf9

Browse files
committed
Switch to JSON IoT Agent
1 parent 10d5928 commit 8ee7bf9

9 files changed

Lines changed: 35 additions & 42 deletions

.gitpod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ports:
3232
port: 4041
3333
onOpen: ignore
3434
- name: IoT Agent (South Port)
35-
description: Ultralight HTTP measures
35+
description: JSON HTTP measures
3636
port: 7896
3737
onOpen: ignore
3838
- name: MongoDB

FIWARE PEP Proxy.postman_collection.json

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

docker-compose/northport-wilma.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ services:
6161
- IOTA_LOG_LEVEL=DEBUG # The log level of the IoT Agent
6262
- IOTA_TIMESTAMP=true # Supply timestamp information with each measurement
6363
- IOTA_CB_NGSI_VERSION=v2 # use NGSIv2 when sending updates for active attributes
64-
- IOTA_AUTOCAST=true # Ensure Ultralight number values are read as numbers not strings
64+
- IOTA_AUTOCAST=true # Ensure JSON number values are read as numbers not strings
6565
- IOTA_MONGO_URI=mongodb://mongo-db:${MONGO_DB_PORT}/iotagentjson # The host name of MongoDB
6666
- IOTA_HTTP_PORT=${IOTA_SOUTH_PORT} # The port used for device traffic over HTTP
6767
- IOTA_PROVIDER_URL=http://iot-agent:${IOTA_NORTH_PORT}
68+
- IOTA_DEFAULT_RESOURCE=/iot/json
6869
- IOTA_AUTH_ENABLED=true
6970
- IOTA_AUTH_TYPE=oauth2
7071
- IOTA_AUTH_HEADER=Authorization
@@ -187,7 +188,6 @@ services:
187188
- "WEB_APP_PORT=${TUTORIAL_APP_PORT}" # Port used by the content provider proxy and web-app for viewing data
188189
- "IOTA_HTTP_HOST=iot-agent"
189190
- "IOTA_HTTP_PORT=7896"
190-
- "IOTA_DEFAULT_RESOURCE=/iot/json"
191191
- "DUMMY_DEVICES_PORT=${TUTORIAL_DUMMY_DEVICE_PORT}" # Port used by the dummy IOT devices to receive commands
192192
- "DUMMY_DEVICES_TRANSPORT=HTTP" # Default transport used by dummy Io devices
193193
- "DUMMY_DEVICES_PAYLOAD=JSON"

docker-compose/orion-kong.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,11 @@ services:
6161
- IOTA_LOG_LEVEL=DEBUG # The log level of the IoT Agent
6262
- IOTA_TIMESTAMP=true # Supply timestamp information with each measurement
6363
- IOTA_CB_NGSI_VERSION=v2 # use NGSIv2 when sending updates for active attributes
64-
- IOTA_AUTOCAST=true # Ensure Ultralight number values are read as numbers not strings
64+
- IOTA_AUTOCAST=true # Ensure JSON number values are read as numbers not strings
6565
- IOTA_MONGO_URI=mongodb://mongo-db:${MONGO_DB_PORT}/iotagentjson # The host name of MongoDB
6666
- IOTA_HTTP_PORT=${IOTA_SOUTH_PORT} # The port used for device traffic over HTTP
6767
- IOTA_PROVIDER_URL=http://iot-agent:${IOTA_NORTH_PORT}
68-
healthcheck:
69-
interval: 15s
68+
- IOTA_DEFAULT_RESOURCE=/iot/json
7069

7170

7271
# Keyrock is an Identity Management Front-End
@@ -163,7 +162,6 @@ services:
163162
- "WEB_APP_PORT=${TUTORIAL_APP_PORT}" # Port used by the content provider proxy and web-app for viewing data
164163
- "IOTA_HTTP_HOST=iot-agent"
165164
- "IOTA_HTTP_PORT=${IOTA_SOUTH_PORT}"
166-
- "IOTA_DEFAULT_RESOURCE=/iot/json"
167165
- "DUMMY_DEVICES_PORT=${TUTORIAL_DUMMY_DEVICE_PORT}" # Port used by the dummy IOT devices to receive commands
168166
- "DUMMY_DEVICES_TRANSPORT=HTTP" # Default transport used by dummy Io devices
169167
- "DUMMY_DEVICES_PAYLOAD=JSON"

docker-compose/orion-wilma.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,14 @@ services:
6161
- IOTA_LOG_LEVEL=DEBUG # The log level of the IoT Agent
6262
- IOTA_TIMESTAMP=true # Supply timestamp information with each measurement
6363
- IOTA_CB_NGSI_VERSION=v2 # use NGSIv2 when sending updates for active attributes
64-
- IOTA_AUTOCAST=true # Ensure Ultralight number values are read as numbers not strings
64+
- IOTA_AUTOCAST=true # Ensure JSON number values are read as numbers not strings
6565
- IOTA_MONGO_URI=mongodb://mongo-db:${MONGO_DB_PORT}/iotagentjson # The host name of MongoDB
6666
- IOTA_HTTP_PORT=${IOTA_SOUTH_PORT} # The port used for device traffic over HTTP
6767
- IOTA_PROVIDER_URL=http://iot-agent:${IOTA_NORTH_PORT}
68+
- IOTA_DEFAULT_RESOURCE=/iot/json
6869
- IOTA_MULTI_CORE=true
6970
- IOTA_AMQP_DISABLED=true
7071
- IOTA_MQTT_DISABLED=true
71-
healthcheck:
72-
interval: 15s
7372

7473

7574
# Keyrock is an Identity Management Front-End
@@ -177,7 +176,6 @@ services:
177176
- "WEB_APP_PORT=${TUTORIAL_APP_PORT}" # Port used by the content provider proxy and web-app for viewing data
178177
- "IOTA_HTTP_HOST=iot-agent"
179178
- "IOTA_HTTP_PORT=${IOTA_SOUTH_PORT}"
180-
- "IOTA_DEFAULT_RESOURCE=/iot/json"
181179
- "DUMMY_DEVICES_PORT=${TUTORIAL_DUMMY_DEVICE_PORT}" # Port used by the dummy IOT devices to receive commands
182180
- "DUMMY_DEVICES_TRANSPORT=HTTP" # Default transport used by dummy Io devices
183181
- "DUMMY_DEVICES_PAYLOAD=JSON"

docker-compose/southport-wilma.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,14 @@ services:
6161
- IOTA_LOG_LEVEL=DEBUG # The log level of the IoT Agent
6262
- IOTA_TIMESTAMP=true # Supply timestamp information with each measurement
6363
- IOTA_CB_NGSI_VERSION=v2 # use NGSIv2 when sending updates for active attributes
64-
- IOTA_AUTOCAST=true # Ensure Ultralight number values are read as numbers not strings
64+
- IOTA_AUTOCAST=true # Ensure JSON number values are read as numbers not strings
6565
- IOTA_MONGO_URI=mongodb://mongo-db:${MONGO_DB_PORT}/iotagentjson # The host name of MongoDB
6666
- IOTA_HTTP_PORT=${IOTA_SOUTH_PORT} # The port used for device traffic over HTTP
6767
- IOTA_PROVIDER_URL=http://iot-agent:${IOTA_NORTH_PORT}
68+
- IOTA_DEFAULT_RESOURCE=/iot/json
6869
- IOTA_MULTI_CORE=true
6970
- IOTA_AMQP_DISABLED=true
7071
- IOTA_MQTT_DISABLED=true
71-
healthcheck:
72-
interval: 5s
7372

7473

7574
# Keyrock is an Identity Management Front-End
@@ -212,7 +211,6 @@ services:
212211
- "WEB_APP_PORT=${TUTORIAL_APP_PORT}" # Port used by the content provider proxy and web-app for viewing data
213212
- "IOTA_HTTP_HOST=iot-agent-proxy"
214213
- "IOTA_HTTP_PORT=7897"
215-
- "IOTA_DEFAULT_RESOURCE=/iot/json"
216214
- "DUMMY_DEVICES_PORT=${TUTORIAL_DUMMY_DEVICE_PORT}" # Port used by the dummy IOT devices to receive commands
217215
- "DUMMY_DEVICES_TRANSPORT=HTTP" # Default transport used by dummy Io devices
218216
- "DUMMY_DEVICES_PAYLOAD=JSON"

provision-devices

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ curl -s -o /dev/null -X POST \
121121
#
122122

123123
curl -s -o /dev/null -X POST \
124-
"http://iot-agent:$IOTA_NORTH_PORT/iot/jsonevices" \
124+
"http://iot-agent:$IOTA_NORTH_PORT/iot/devices" \
125125
-H 'Content-Type: application/json' \
126126
-H 'fiware-service: openiot' \
127127
-H 'fiware-servicepath: /' \
@@ -151,7 +151,7 @@ curl -s -o /dev/null -X POST \
151151
"entity_name": "Door:001",
152152
"entity_type": "Door",
153153
"apikey": "3089326",
154-
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/jsonoor001"'",
154+
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/door001"'",
155155
"static_attributes": [
156156
{"name": "refStore", "type": "Relationship","value": "urn:ngsi-ld:Store:001"}
157157
]
@@ -177,7 +177,7 @@ curl -s -o /dev/null -X POST \
177177
#
178178

179179
curl -s -o /dev/null -X POST \
180-
"http://iot-agent:$IOTA_NORTH_PORT/iot/jsonevices" \
180+
"http://iot-agent:$IOTA_NORTH_PORT/iot/devices" \
181181
-H 'Content-Type: application/json' \
182182
-H 'fiware-service: openiot' \
183183
-H 'fiware-servicepath: /' \
@@ -207,7 +207,7 @@ curl -s -o /dev/null -X POST \
207207
"entity_name": "Door:002",
208208
"entity_type": "Door",
209209
"apikey": "3089326",
210-
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/jsonoor002"'",
210+
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/door002"'",
211211
"static_attributes": [
212212
{"name": "refStore", "type": "Relationship","value": "urn:ngsi-ld:Store:002"}
213213
]
@@ -237,7 +237,7 @@ curl -s -o /dev/null -X POST \
237237
#
238238

239239
curl -s -o /dev/null -X POST \
240-
"http://iot-agent:$IOTA_NORTH_PORT/iot/jsonevices" \
240+
"http://iot-agent:$IOTA_NORTH_PORT/iot/devices" \
241241
-H 'Content-Type: application/json' \
242242
-H 'fiware-service: openiot' \
243243
-H 'fiware-servicepath: /' \
@@ -267,7 +267,7 @@ curl -s -o /dev/null -X POST \
267267
"entity_name": "Door:003",
268268
"entity_type": "Door",
269269
"apikey": "3089326",
270-
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/jsonoor003"'",
270+
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/door003"'",
271271
"static_attributes": [
272272
{"name": "refStore", "type": "Relationship","value": "urn:ngsi-ld:Store:003"}
273273
]
@@ -296,7 +296,7 @@ curl -s -o /dev/null -X POST \
296296
#
297297

298298
curl -s -o /dev/null -X POST \
299-
"http://iot-agent:$IOTA_NORTH_PORT/iot/jsonevices" \
299+
"http://iot-agent:$IOTA_NORTH_PORT/iot/devices" \
300300
-H 'Content-Type: application/json' \
301301
-H 'fiware-service: openiot' \
302302
-H 'fiware-servicepath: /' \
@@ -326,7 +326,7 @@ curl -s -o /dev/null -X POST \
326326
"entity_name": "Door:004",
327327
"entity_type": "Door",
328328
"apikey": "3089326",
329-
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/jsonoor004"'",
329+
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/door004"'",
330330
"static_attributes": [
331331
{"name": "refStore", "type": "Relationship","value": "urn:ngsi-ld:Store:004"}
332332
]

provision-groups

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ printf "⏳ Provisioning IoT Service Groups "
1111

1212

1313
#
14-
# Create a service groups for all UltraLight IoT devices
14+
# Create a service groups for all JSON IoT devices
1515
#
1616

1717
curl -s -o /dev/null -X POST \
@@ -26,7 +26,7 @@ curl -s -o /dev/null -X POST \
2626
"cbroker": "http://orion:1026",
2727
"entity_type": "Motion",
2828
"resource": "/iot/d",
29-
"protocol": "PDI-IoTA-UltraLight",
29+
"protocol": "PDI-IoTA-JSON",
3030
"transport": "HTTP",
3131
"timezone": "Europe/Berlin",
3232
"attributes": [
@@ -36,7 +36,7 @@ curl -s -o /dev/null -X POST \
3636
{"name": "category", "type":"Text", "value": ["sensor"]},
3737
{"name": "controlledProperty", "type": "Text", "value": "motion"},
3838
{"name": "function", "type": "Text", "value":["sensing"]},
39-
{"name": "supportedProtocol", "type": "Text", "value": ["ul20"]},
39+
{"name": "supportedProtocol", "type": "Text", "value": ["json"]},
4040
{"name": "supportedUnits", "type": "Text", "value": "C62"}
4141
]
4242
},
@@ -45,7 +45,7 @@ curl -s -o /dev/null -X POST \
4545
"cbroker": "http://orion:1026",
4646
"entity_type": "Bell",
4747
"resource": "/iot/d",
48-
"protocol": "PDI-IoTA-UltraLight",
48+
"protocol": "PDI-IoTA-JSON",
4949
"transport": "HTTP",
5050
"timezone": "Europe/Berlin",
5151
"commands": [
@@ -58,15 +58,15 @@ curl -s -o /dev/null -X POST \
5858
{"name": "category", "type":"Text", "value": ["actuator"]},
5959
{"name": "controlledProperty", "type": "Text", "value": "noiseLevel"},
6060
{"name": "function", "type": "Text", "value":["onOff"]},
61-
{"name": "supportedProtocol", "type": "Text", "value": ["ul20"]}
61+
{"name": "supportedProtocol", "type": "Text", "value": ["json"]}
6262
]
6363
},
6464
{
6565
"apikey": "3314136",
6666
"cbroker": "http://orion:1026",
6767
"entity_type": "Lamp",
6868
"resource": "/iot/d",
69-
"protocol": "PDI-IoTA-UltraLight",
69+
"protocol": "PDI-IoTA-JSON",
7070
"transport": "HTTP",
7171
"timezone": "Europe/Berlin",
7272
"commands": [
@@ -81,7 +81,7 @@ curl -s -o /dev/null -X POST \
8181
{"name": "category", "type":"Text", "value": ["actuator","sensor"]},
8282
{"name": "controlledProperty", "type": "Text", "value": "light"},
8383
{"name": "function", "type": "Text", "value":["onOff", "sensing"]},
84-
{"name": "supportedProtocol", "type": "Text", "value": ["ul20"]},
84+
{"name": "supportedProtocol", "type": "Text", "value": ["json"]},
8585
{"name": "supportedUnits", "type": "Text", "value": "CDL"}
8686
]
8787
},
@@ -90,7 +90,7 @@ curl -s -o /dev/null -X POST \
9090
"cbroker": "http://orion:1026",
9191
"entity_type": "Door",
9292
"resource": "/iot/d",
93-
"protocol": "PDI-IoTA-UltraLight",
93+
"protocol": "PDI-IoTA-JSON",
9494
"transport": "HTTP",
9595
"timezone": "Europe/Berlin",
9696
"commands": [
@@ -106,7 +106,7 @@ curl -s -o /dev/null -X POST \
106106
{"name": "category", "type":"Text", "value": ["actuator", "sensor"]},
107107
{"name": "controlledProperty", "type": "Text", "value": "state"},
108108
{"name": "function", "type": "Text", "value":["openClose", "eventNotification"]},
109-
{"name": "supportedProtocol", "type": "Text", "value": ["ul20"]}
109+
{"name": "supportedProtocol", "type": "Text", "value": ["json"]}
110110
]
111111
}
112112
]

services

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ waitForOrion () {
7575

7676
waitForIoTAgent () {
7777
echo -e "\n⏳ Waiting for \033[1;36mIoT-Agent\033[0m to be available\n"
78-
while ! [ `docker inspect --format='{{.State.Health.Status}}' fiware-iot-agent` == "healthy" ]
79-
78+
while [ `curl -s -o /dev/null -w %{http_code} 'http://localhost:4041/version'` != "200" ]
8079
do
8180
echo -e "IoT Agent HTTP state: " `curl -s -o /dev/null -w %{http_code} 'http://localhost:4041/version'` " (waiting for 200)"
8281
sleep 1
@@ -133,7 +132,7 @@ case "${command}" in
133132
stoppingContainers
134133
echo -e "Starting containers: \033[1;34mOrion\033[0m, \033[1;36mIoT-Agent\033[0m, \033[1;31mKeyrock\033[0m, \033[1;31mWilma\033[0m, \033[1mTutorial\033[0m and \033[1mMongoDB\033[0m and \033[1mMySQL\033[0m databases."
135134
echo -e "- \033[1;34mOrion\033[0m is the context broker"
136-
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the UltraLight Protocol"
135+
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the JSON Protocol"
137136
echo -e "- \033[1mTutorial\033[0m acts as a series of dummy IoT Sensors over HTTP"
138137
echo -e "- \033[1;31mKeyrock\033[0m is an Identity Management Front-End"
139138
echo -e "- \033[1;31mWilma\033[0m is a PEP Proxy around \033[1;34mOrion\033[0m"
@@ -151,7 +150,7 @@ case "${command}" in
151150
stoppingContainers
152151
echo -e "Starting containers: \033[1;34mOrion\033[0m, \033[1;36mIoT-Agent\033[0m, \033[1;31mKeyrock\033[0m, \033[1;31mKong\033[0m, \033[1mTutorial\033[0m and \033[1mMongoDB\033[0m and \033[1mMySQL\033[0m databases."
153152
echo -e "- \033[1;34mOrion\033[0m is the context broker"
154-
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the UltraLight Protocol"
153+
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the JSON Protocol"
155154
echo -e "- \033[1mTutorial\033[0m acts as a series of dummy IoT Sensors over HTTP"
156155
echo -e "- \033[1;31mKeyrock\033[0m is an Identity Management Front-End"
157156
echo -e "- \033[1;31mKong\033[0m is a PEP Proxy around \033[1;34mOrion\033[0m"
@@ -169,7 +168,7 @@ case "${command}" in
169168
stoppingContainers
170169
echo -e "Starting containers: \033[1;34mOrion\033[0m, \033[1;36mIoT-Agent\033[0m, \033[1;31mKeyrock\033[0m, \033[1;31mWilma\033[0m, \033[1mTutorial\033[0m and \033[1mMongoDB\033[0m and \033[1mMySQL\033[0m databases."
171170
echo -e "- \033[1;34mOrion\033[0m is the context broker"
172-
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the UltraLight Protocol"
171+
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the JSON Protocol"
173172
echo -e "- \033[1mTutorial\033[0m acts as a series of dummy IoT Sensors over HTTP"
174173
echo -e "- \033[1;31mKeyrock\033[0m is an Identity Management Front-End"
175174
echo -e "- 2 instances of \033[1;31mWilma\033[0m as a PEP Proxy around \033[1;34mOrion\033[0m and between the Devices and \033[1;36mIoT-Agent\033[0m Southport"
@@ -186,7 +185,7 @@ case "${command}" in
186185
stoppingContainers
187186
echo -e "Starting containers: \033[1;34mOrion\033[0m, \033[1;36mIoT-Agent\033[0m, \033[1;31mKeyrock\033[0m, \033[1;31mWilma\033[0m, \033[1mTutorial\033[0m and \033[1mMongoDB\033[0m and \033[1mMySQL\033[0m databases."
188187
echo -e "- \033[1;34mOrion\033[0m is the context broker"
189-
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the UltraLight Protocol"
188+
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the JSON Protocol"
190189
echo -e "- \033[1mTutorial\033[0m acts as a series of dummy IoT Sensors over HTTP"
191190
echo -e "- \033[1;31mKeyrock\033[0m is an Identity Management Front-End"
192191
echo -e "- \033[1;31mWilma\033[0m as a PEP Proxy between \033[1;34mOrion\033[0m and the \033[1;36mIoT-Agent\033[0m"

0 commit comments

Comments
 (0)