Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
N
naiades-platform-poc
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • CI / CD Analytics
    • Repository Analytics
    • Value Stream Analytics
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • naiades
  • naiades-platform-poc
  • Wiki
  • IoT Platform FAQ

IoT Platform FAQ

Last edited by Federico Sismondi Dec 09, 2020
Page history

What is the SDK provided by UDGA?

The SDK is a package found online composed of

  1. code (mostly docker files, configuration files and a folder/files project structure )
  2. tutorials and docs for interacting with the platform
  3. tutorials and docs for running an IoT platform

You should not try to install the platform (3) if you just want to act as a client of the platform (GUI, AI module, etc..).

Where can I find the spec of the IoT Platform APIs ?

You can find Orions API spec here:

  • Orion API spec (context broker)
  • QuantumLeap API spec (historic API)

How to build a AI module for the platform?

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://5.53.108.182/time-series-api or http://5.53.108.182/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

related: https://serverfault.com/questions/740597/nginx-allow-requests-without-a-host-header

Is there a API wrapper for facilitating use of the API

There is no official wrapper, but given we use ngsi-v2 you can build your own with swagger auto code gen using this: https://fiware.github.io/specifications/OpenAPI/ngsiv2/ngsiv2-openapi.json

Please check https://fiware-tutorials.readthedocs.io/en/latest/accessing-context/index.html#generating-ngsi-api-clients

How to we integrate our AI/WMS/GUI module to the IoT platform?

you can either:

  1. 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
  2. push directly the docker image to dockerhub same procedure as 1 for the operation of the service
  3. 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?

  1. CHOOSE entity id, it should follow the conventions: udn:ngsi-ld:<dataType>:<string> e.g urn:ngsi-ld:WaterQualityObserved:fountain-1

  2. CREATE entity, use script example named watering_01_create_entity.sh

  3. 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

  4. test it 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:
   --header "Fiware-Service: carouge"
   --header "Fiware-ServicePath: /"

Fail to consume data from historical API

if you are getting an error description like "TypeError: unsupported type for timedelta " from the API call

or

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: str
Traceback (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:

e.g.:

curl --location --request DELETE 'http://5.53.108.182:8668/v2/types/WaterQualityObserved' \
--header 'Fiware-Service: carouge'

Known limitations of the implementation

please see: https://fiware-orion.readthedocs.io/en/master/user/ngsiv2_implementation_notes/index.html

Clone repository
  • API client examples (curl and python scripts)
  • Carouge Watering Use Case
  • IoT Platform FAQ
  • IoT Platform operations
  • NAIADES IoT Platform installation
  • Pushing Data from pilots to IoT Platform
  • Home
  • rewriting history
  • securing API with PEP proxy
More Pages