you can use as starting point the WMS_example from the git project.
WMS_example only exemplifies how to use the subscription feature or of the IoT platform though.. you will probably need more than that . E.g. consuming data from the historical API
All the doc for consuming data can be found in the SDKv1 and SDKv2
Getting a 400 Bad Request when using nginx endpoints (http://126.96.36.199/time-series-api or http://188.8.131.52/context-api )
If you get the folliwing message trying to query APIs
<html><head> <title>400 Bad Request</title></head><body> <center> <h1>400 Bad Request</h1> </center> <hr> <center>nginx/1.19.1</center></body></html>
then you are probably generating HTTP requests without HOST header, which is a mandatory HTTP v1.1 header, please add one or configure your HTTP client to use one by default
How to we integrate our AI/WMS/GUI module to the IoT platform?
you can either:
push the code to the git repo (different branch from master) and provide the Dockerfile describing how to build and run the service then the operator of the platform (SIMAVI) will add it to the docker-compose which handle all internal services
push directly the docker image to dockerhub same procedure as 1 for the operation of the service
you run your AI module from ourside the IoT platform (in your own server)
for all of the above options, the interface between the modules and the platform should be the context manager API and the historical data API
How do I create an entity and push historical records to the historical API?
CHOOSE entity id, it should follow the conventions:
CREATE entity, use script example named watering_01_create_entity.sh
SUBSCRIBE - send to context manager (Orion) subscription to start tracking a certain entity (start saving records in historic DB)
please use as template script historic_01_set_up.sh, you will need to update the description and the type as minimal modifications
please use as template script historic_02_api_query.sh
Historical API query returns empty responses, why?
check the examples provided above (dots 3 and 4) .sh examples
remember to include the corresponding pilot headers in the request:
if you are getting an error description like "TypeError: unsupported type for timedelta " from the API call
if you find the logs of QuantumLeap the following error message:
ERROR:root:Something went wrong with QL. Error: unsupported type for timedelta milliseconds component: strTraceback (most recent call last): File "/src/ngsi-timeseries-api/src/reporter/query_1T1ENA.py", line 57, in query_1T1ENA geo_query=geo_query) File "/src/ngsi-timeseries-api/src/translators/crate.py", line 700, in query last_n) File "/src/ngsi-timeseries-api/src/translators/crate.py", line 803, in _format_response v = self._get_isoformat(v) File "/src/ngsi-timeseries-api/src/translators/crate.py", line 134, in _get_isoformat d = timedelta(milliseconds=ms_since_epoch)TypeError: unsupported type for timedelta milliseconds component: str
Then that's probably due to the fact that some data has been pushed to the historical API with wrong date format.
No simple solution has been found for this, you need to delete that entry from the database manually.
The simple (violent) solution is to drop that table of records and start again: