Details
-
Type: extRequest
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Fix Version/s: 2021
-
Component/s: FIWARE-GENERAL-HELP
-
Labels:None
Description
Hi
I am having issues with the Fiware time series data tutorial not behaving as the tutorial states.
I am following this tutorial:
https://fiware-tutorials.readthedocs.io/en/latest/time-series-data/index.html#time-series-data-queries-quantumleap-api
using these docker containers (very latest cloned):
https://github.com/FIWARE/tutorials.Time-Series-Data/tree/a1b9e289a89695491635d05cb1faff2455366799
First, I followed the tutorial sequentially. Tutorial section: "QuantumLeap API - List the first N Sampled Values - 4 Request" returned a result but tutorial section: "QuantumLeap API - List N Sampled Values at an Offset - 5 request" failed returning:
{ "description": "No records were found for such query.", "error": "Not Found" }So, I stopped and started the docker services to clear things and started troubleshooting at what point things failed. As far as I can tell, the point it fails is that it doesn't create a table in CrateDB for Motion when creating a subscription whereas creating a subscription for Lamp does create a table in CrateDB. I do not know why, and I have not been able to find any documentation on how to troubleshoot further and figure out why. My steps to reproduce:
Before creating a subscription for Motion, I check the crateDB schemas (tutorial section: CrateDB API - Checking Data persistence-> 12 Request):
$ curl -iX POST 'http://localhost:4200/_sql' -H 'Content-Type: application/json' -d '
'
{"cols":["schema_name"],"rows":[["blob"],["doc"],["information_schema"],["pg_catalog"],["sys"]],"rowcount":5,"duration":123.18835}and the tables (tutorial section: CrateDB API - Checking Data persistence-> 13 Request):
$ curl -X POST 'http://localhost:4200/_sql' -H 'Content-Type: application/json' -d '
'
{"cols":["table_name"],"rows":[],"rowcount":0,"duration":41.81386}As expected - no tables.
I subscribe to Motion (tutorial section: Aggregate Motion Sensor Count Events -> 1 Request):
$ curl -iX POST \
'http://localhost:1026/v2/subscriptions/' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
-d '{
"description": "Notify QuantumLeap of count changes of any Motion Sensor",
"subject": {
"entities": [
],
"condition":
},
"notification": {
"http":
,
"attrs": [
"count"
],
"metadata": ["dateCreated", "dateModified"]
},
"throttling": 1
}'
HTTP/1.1 201 Created
Connection: Keep-Alive
Content-Length: 0
Location: /v2/subscriptions/6023b32d944ff95b637d9cbd
Fiware-Correlator: 738ed596-6b89-11eb-94e7-0242c0a86007
Date: Wed, 10 Feb 2021 10:19:25 GMT
check the subscription (tutorial section: Checking Subscriptions for QuantumLeap - 3 Request):
$ curl -X GET 'http://localhost:1026/v2/subscriptions/' -H 'fiware-service: openiot' -H 'fiware-servicepath: /'
[{"id":"6023b32d944ff95b637d9cbd","description":"Notify QuantumLeap of count changes of any Motion Sensor","status":"active","subject":{"entities":[
],"condition":{"attrs":["count"]}},"notification":{"timesSent":1,"lastNotification":"2021-02-10T10:19:25.000Z","attrs":["count"],"onlyChangedAttrs":false,"attrsFormat":"normalized","http":
{"url":"http://quantumleap:8668/v2/notify"},"metadata":["dateCreated","dateModified"],"lastSuccess":"2021-02-10T10:19:25.000Z","lastSuccessCode":200},"throttling":1}]
check for tables again:
$ curl -X POST 'http://localhost:4200/_sql' -H 'Content-Type: application/json' -d '
'
{"cols":["table_name"],"rows":[],"rowcount":0,"duration":6.013363}no new tables have been created.
So, I subscribe to Lamp Luminosity (tutorial section: Aggregate Motion Sensor Count Events -> 2 Request):
$ curl -iX POST \
'http://localhost:1026/v2/subscriptions/' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
-d '{
"description": "Notify QuantumLeap on luminosity changes on any Lamp",
"subject": {
"entities": [
],
"condition":
},
"notification": {
"http":
,
"attrs": [
"luminosity", "location"
],
"metadata": ["dateCreated", "dateModified"]
},
"throttling": 1
}'
HTTP/1.1 201 Created
Connection: Keep-Alive
Content-Length: 0
Location: /v2/subscriptions/6023b16df285be8854aeb2aa
Fiware-Correlator: 682f63ba-6b88-11eb-8e86-0242c0a85005
Date: Wed, 10 Feb 2021 10:11:57 GMT
check the subscriptions:
$ curl -X GET 'http://localhost:1026/v2/subscriptions/' -H 'fiware-service: openiot' -H 'fiware-servicepath: /'
[{"id":"6023b32d944ff95b637d9cbd","description":"Notify QuantumLeap of count changes of any Motion Sensor","status":"active","subject":{"entities":[
],"condition":{"attrs":["count"]}},"notification":{"timesSent":1,"lastNotification":"2021-02-10T10:19:25.000Z","attrs":["count"],"onlyChangedAttrs":false,"attrsFormat":"normalized","http":
{"url":"http://quantumleap:8668/v2/notify"},"metadata":["dateCreated","dateModified"],"lastSuccess":"2021-02-10T10:19:25.000Z","lastSuccessCode":200},"throttling":1},
{"id":"6023b499944ff95b637d9cbe","description":"Notify QuantumLeap on luminosity changes on any Lamp","status":"active","subject":{"entities":[
],"condition":{"attrs":["luminosity","location"]}},"notification":{"timesSent":1,"lastNotification":"2021-02-10T10:25:29.000Z","attrs":["luminosity","location"],"onlyChangedAttrs":false,"attrsFormat":"normalized","http":
{"url":"http://quantumleap:8668/v2/notify"},"metadata":["dateCreated","dateModified"],"lastSuccess":"2021-02-10T10:25:31.000Z","lastSuccessCode":200},"throttling":1}]
and check the tables again:
$ curl -X POST 'http://localhost:4200/_sql' -H 'Content-Type: application/json' -d '
'
{"cols":["table_name"],"rows":[["etlamp"],["md_ets_metadata"]],"rowcount":2,"duration":6.791097}and can clearly see a new table "etlamp" has been created.
So why has the Motion table not been created?
I am new to CrateDB and intend to use TimescaleDB but it is important to follow the tutorial to get a feel for how it works as TimescaleDB is not well documented for FIWARE use yet. However, I found a crate-db log (gc.log) and looked for "etlamp", "lamp", "motion" but find no reference. I haven't located logs in the quantum leap container - so I'm at a loss as to how to troubleshoot further. Please can you advise?
Thank you
Kind regards
Taz
Taz Lodder
IT Lösningsspecialist och Förvaltningsledare Stöd till Forskning & Nyttiggörande | Chalmers IT-Avdelningen
Technical Solution Specialist and Project Manager to Research & Utilisation | Chalmers IT Office
taz@chalmers.se<taz@chalmers.se>
Internal: 6636
External: +46(0)31 772 6636
Chalmers Tekniska Högskola | Chalmers University of Technology
SE-412 96 Göteborg, Sweden
http://www.chalmers.se
__________________________________________________________________________________________
You can get more information about our cookies and privacy policies on the following links:
fiware-general-help mailing list
fiware-general-help@lists.fiware.org
To unsubscribe from fiware-general-help mailing list, go to the information page of the list at:
https://lists.fiware.org/listinfo/fiware-general-help
[Created via e-mail received from: Taz Lodder <taz@chalmers.se>]