Skip to content

Commit ecbe9bd

Browse files
committed
Switch to JSON IoT Agent
1 parent ab64925 commit ecbe9bd

5 files changed

Lines changed: 14 additions & 17 deletions

.gitpod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ports:
2020
port: 4041
2121
onOpen: ignore
2222
- name: IoT Agent (South Port)
23-
description: Ultralight HTTP measures
23+
description: JSON HTTP measures
2424
port: 7896
2525
onOpen: ignore
2626
- name: MongoDB

FIWARE Querying Time Series Data (QuantumLeap).postman_collection.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docker-compose.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,14 @@ services:
8181
- IOTA_LOG_LEVEL=INFO # The log level of the IoT Agent
8282
- IOTA_TIMESTAMP=true # Supply timestamp information with each measurement
8383
- IOTA_CB_NGSI_VERSION=v2 # use NGSIv2 when sending updates for active attributes
84-
- IOTA_AUTOCAST=true # Ensure Ultralight number values are read as numbers not strings
84+
- IOTA_AUTOCAST=true # Ensure JSON number values are read as numbers not strings
8585
- IOTA_MONGO_URI=mongodb://mongo-db:${MONGO_DB_PORT}/iotagentjson # The name of the database used in mongoDB
8686
- IOTA_HTTP_PORT=${IOTA_SOUTH_PORT} # The port used for device traffic over HTTP
8787
- IOTA_PROVIDER_URL=http://iot-agent:${IOTA_NORTH_PORT}
88+
- IOTA_DEFAULT_RESOURCE=/iot/json
8889
- IOTA_MULTI_CORE=true
8990
- IOTA_AMQP_DISABLED=true
9091
- IOTA_MQTT_DISABLED=true
91-
healthcheck:
92-
interval: 5s
9392

9493

9594
# Tutorial acts as a series of dummy IoT Sensors over HTTP
@@ -119,7 +118,6 @@ services:
119118
- "WEB_APP_PORT=${TUTORIAL_APP_PORT}" # Port used by the content provider proxy and web-app for viewing data
120119
- "IOTA_HTTP_HOST=iot-agent"
121120
- "IOTA_HTTP_PORT=${IOTA_SOUTH_PORT}"
122-
- "IOTA_DEFAULT_RESOURCE=/iot/json"
123121
- "DUMMY_DEVICES_PORT=${TUTORIAL_DUMMY_DEVICE_PORT}" # Port used by the dummy IOT devices to receive commands
124122
- "DUMMY_DEVICES_TRANSPORT=HTTP" # Default transport used by dummy Io devices
125123
- "DUMMY_DEVICES_PAYLOAD=JSON"

provision-devices

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

121121
curl -s -o /dev/null -X POST \
122-
"http://iot-agent:$IOTA_NORTH_PORT/iot/jsonevices" \
122+
"http://iot-agent:$IOTA_NORTH_PORT/iot/devices" \
123123
-H 'Content-Type: application/json' \
124124
-H 'fiware-service: openiot' \
125125
-H 'fiware-servicepath: /' \
@@ -149,7 +149,7 @@ curl -s -o /dev/null -X POST \
149149
"entity_name": "Door:001",
150150
"entity_type": "Door",
151151
"apikey": "3089326",
152-
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/jsonoor001"'",
152+
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/door001"'",
153153
"static_attributes": [
154154
{"name": "refStore", "type": "Relationship","value": "urn:ngsi-ld:Store:001"}
155155
]
@@ -180,7 +180,7 @@ curl -s -o /dev/null -X POST \
180180
#
181181

182182
curl -s -o /dev/null -X POST \
183-
"http://iot-agent:$IOTA_NORTH_PORT/iot/jsonevices" \
183+
"http://iot-agent:$IOTA_NORTH_PORT/iot/devices" \
184184
-H 'Content-Type: application/json' \
185185
-H 'fiware-service: openiot' \
186186
-H 'fiware-servicepath: /' \
@@ -210,7 +210,7 @@ curl -s -o /dev/null -X POST \
210210
"entity_name": "Door:002",
211211
"entity_type": "Door",
212212
"apikey": "3089326",
213-
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/jsonoor002"'",
213+
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/door002"'",
214214
"static_attributes": [
215215
{"name": "refStore", "type": "Relationship","value": "urn:ngsi-ld:Store:002"}
216216
]
@@ -244,7 +244,7 @@ curl -s -o /dev/null -X POST \
244244
#
245245

246246
curl -s -o /dev/null -X POST \
247-
"http://iot-agent:$IOTA_NORTH_PORT/iot/jsonevices" \
247+
"http://iot-agent:$IOTA_NORTH_PORT/iot/devices" \
248248
-H 'Content-Type: application/json' \
249249
-H 'fiware-service: openiot' \
250250
-H 'fiware-servicepath: /' \
@@ -274,7 +274,7 @@ curl -s -o /dev/null -X POST \
274274
"entity_name": "Door:003",
275275
"entity_type": "Door",
276276
"apikey": "3089326",
277-
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/jsonoor003"'",
277+
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/door003"'",
278278
"static_attributes": [
279279
{"name": "refStore", "type": "Relationship","value": "urn:ngsi-ld:Store:003"}
280280
]
@@ -307,7 +307,7 @@ curl -s -o /dev/null -X POST \
307307
#
308308

309309
curl -s -o /dev/null -X POST \
310-
"http://iot-agent:$IOTA_NORTH_PORT/iot/jsonevices" \
310+
"http://iot-agent:$IOTA_NORTH_PORT/iot/devices" \
311311
-H 'Content-Type: application/json' \
312312
-H 'fiware-service: openiot' \
313313
-H 'fiware-servicepath: /' \
@@ -337,7 +337,7 @@ curl -s -o /dev/null -X POST \
337337
"entity_name": "Door:004",
338338
"entity_type": "Door",
339339
"apikey": "3089326",
340-
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/jsonoor004"'",
340+
"endpoint": "'"http://iot-sensors:$TUTORIAL_DUMMY_DEVICE_PORT/iot/door004"'",
341341
"static_attributes": [
342342
{"name": "refStore", "type": "Relationship","value": "urn:ngsi-ld:Store:004"}
343343
]

services

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ waitForOrion () {
112112

113113
waitForIoTAgent () {
114114
echo -e "\n⏳ Waiting for \033[1;36mIoT-Agent\033[0m to be available\n"
115-
while ! [ `docker inspect --format='{{.State.Health.Status}}' fiware-iot-agent` == "healthy" ]
116-
115+
while [ `curl -s -o /dev/null -w %{http_code} 'http://localhost:4041/version'` != "200" ]
117116
do
118117
echo -e "IoT Agent HTTP state: " `curl -s -o /dev/null -w %{http_code} 'http://localhost:4041/version'` " (waiting for 200)"
119118
sleep 1
@@ -134,7 +133,7 @@ case "${command}" in
134133
echo -e "- \033[1;34mOrion\033[0m is the context broker"
135134
echo -e "- \033[1;34mQuantumLeap\033[0m will write to CrateDB"
136135
echo -e "- \033[1mGrafana\033[0m will read from CrateDB"
137-
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the UltraLight Protocol"
136+
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the JSON Protocol"
138137
echo -e "- \033[1mTutorial\033[0m acts as a series of dummy IoT Sensors over HTTP"
139138
echo ""
140139
${dockerCmd} up -d --remove-orphans

0 commit comments

Comments
 (0)