Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-19101

FIWARE.Question.Tech.Orion-LD issues no notification send to subscription.

    Details

      Description

      Created question in FIWARE Q/A platform on 05-01-2022 at 07:01
      Please, ANSWER this question AT https://stackoverflow.com/questions/70588960/orion-ld-issues-no-notification-send-to-subscription

      Question:
      Orion-LD issues no notification send to subscription

      Description:
      My setup is:

      The Things Network (LoraWAN)
      IoT Agent for LoraWAN supporting TTN and NGSI-LD GitHub
      Orion-LD
      Quantumleap + cratedb

      Provision of the sensor to the IoT Agent
      curl -iL -X POST \
      localhost:4041/iot/devices \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'fiware-service: openiot' \
      -H 'fiware-servicepath: /' \
      -d '{
      "devices": [
      {
      "device_id": "eui-70b3d57ed004a537",
      "entity_name": "urn:ngsi-ld:TemperatureSensor:temperaturesensor001",
      "entity_type": "LoraDevice",
      "timezone": "Europe/Athens",
      "attributes": [
      {
      "object_id": "temperature_3",
      "name": "temperatureCh3",
      "type": "Float",
      "metadata": {"unitCode": {"type": "Property","value": "CEL"}}
      },
      {
      "object_id": "temperature_5",
      "name": "temperatureCh5",
      "type": "Float",
      "metadata": {"unitCode": {"type": "Property","value": "CEL"}}
      }
      ],
      "internal_attributes": {
      "lorawan": {
      "application_server":

      { "host": "eu1.cloud.thethings.network", "username": "XXXX@ttn", "password": "XXXX", "provider": "TTN" }

      ,
      "dev_eui": "XXXXX",
      "app_eui": "XXXXXX",
      "application_id": "XXXXXX@ttn",
      "application_key": "XXXXXX",
      "data_model": "application_server"
      }
      },
      "protocol": "LORAJSON"
      }
      ]
      }'

      I successfully receive data from the TTN Network (Simulation of sensor at TTN->IoTAgent->Orion-LD)
      curl -X GET 'http://localhost:1026/ngsi-ld/v1/entities/?type=LoraDevice' \
      -H 'fiware-service: openiot' \
      -H 'fiware-servicepath: /' \
      -H 'Link: <http://context/ngsi-context.jsonld&gt;; rel="http://www.w3.org/ns/json-ld#context&quot;; type="application/ld+json"' \
      -H 'Accept: application/json' |jq .

      [
      {
      "id": "urn:ngsi-ld:TemperatureSensor:temperaturesensor001",
      "type": "LoraDevice",
      "temperatureCh3":

      { "type": "Property", "value": 27.2, "observedAt": "2022-01-04T18:54:14.447Z", "unitCode": "CEL" }

      ,
      "temperatureCh5":

      { "type": "Property", "value": 25.5, "observedAt": "2022-01-04T18:54:14.447Z", "unitCode": "CEL" }

      }
      ]

      I use the following curl to create a new subscription to the Orion-LD
      curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/subscriptions/' \
      -H 'Content-Type: application/ld+json' \
      -H 'NGSILD-Tenant: openiot' \
      --data-raw '{
      "description": "Notify me of all changes",
      "type": "Subscription",
      "entities": [

      {"type": "LoraDevice"}

      ],
      "notification": {
      "attributes": ["temperatureCh3"],
      "format": "normalized",
      "endpoint":

      { "uri": "http://quantumleap:8668/v2/notify", "accept": "application/json" }

      },
      "@context": "http://context/ngsi-context.jsonld&quot;
      }'

      and verify that i have create the subscription
      curl -X GET 'http://localhost:1026/ngsi-ld/v1/subscriptions/' \
      -H 'NGSILD-Tenant: openiot'|jq .

      {
      "id": "urn:ngsi-ld:Subscription:61d53fc5fb688acae04cd92f",
      "type": "Subscription",
      "description": "Notify me of all changes",
      "entities": [

      { "type": "LoraDevice" }

      ],
      "notification": {
      "attributes": [
      "temperatureCh3"
      ],
      "format": "normalized",
      "endpoint":

      { "uri": "http://quantumleap:8668/v2/notify", "accept": "application/json" }

      },
      "@context": "http://context/ngsi-context.jsonld&quot;
      }
      ]

      Send new measurement (Orion-LD log: Servicing NGSI-LD request 006: POST /ngsi-ld/v1/entityOperations/upsert/), check that the Orion-LD has the new data, but no notification send to the quantumleap
      [
      {
      "id": "urn:ngsi-ld:TemperatureSensor:temperaturesensor001",
      "type": "LoraDevice",
      "temperatureCh3":

      { "type": "Property", "value": 27.3, "observedAt": "2022-01-05T06:53:17.572Z", "unitCode": "CEL" }

      ,
      "temperatureCh5":

      { "type": "Property", "value": 25.5, "observedAt": "2022-01-05T06:53:17.572Z", "unitCode": "CEL" }

      }
      ]

      I have spend some time changing the subscription request but with no success.
      Is something wrong with my subscription request?
      Using MongoDB Compass here is the context of the DB
      orion-openiot.entities
      {
      "_id":

      { "id": "urn:ngsi-ld:TemperatureSensor:temperaturesensor001", "type": "https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#loraSensors", "servicePath": "/" }

      ,
      "attrNames": &quot;https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#temperature1&quot;, &quot;https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#temperature2&quot;,
      "attrs": {
      "https://ngsi-ld-tutorials=readthedocs=io/en/latest/datamodels=html#temperature1&quot;: {
      "value": 27.3,
      "type": "Property",
      "md": {
      "unitCode":

      { "value": "CEL" }

      ,
      "observedAt":

      { "value": 1641365597.572 }

      },
      "mdNames": ["unitCode", "observedAt"],
      "creDate": 1641365539.6579854,
      "modDate": 1641365597.5791261
      },
      "https://ngsi-ld-tutorials=readthedocs=io/en/latest/datamodels=html#temperature2&quot;: {
      "value": 25.5,
      "type": "Property",
      "md": {
      "unitCode":

      { "value": "CEL" }

      ,
      "observedAt":

      { "value": 1641365597.572 }

      },
      "mdNames": ["unitCode", "observedAt"],
      "creDate": 1641365539.6579854,
      "modDate": 1641365597.5791261
      }
      },
      "creDate": 1641365441.9127274,
      "modDate": 1641365597.5791261,
      "lastCorrelator": ""
      }

      orion-openiot.csubs
      {
      "_id": "urn:ngsi-ld:Subscription:61d53fc5fb688acae04cd92f",
      "expiration": 2147483647,
      "reference": "http://quantumleap:8668/v2/notify&quot;,
      "custom": false,
      "mimeType": "application/json",
      "throttling": 0,
      "servicePath": "/",
      "description": "Notify me of all changes",
      "status": "active",
      "entities": [

      { "id": "", "isPattern": "", "type": "https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#loraSensors", "isTypePattern": false }

      ],
      "attrs": &quot;https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#temperature1&quot;,
      "metadata": [],
      "blacklist": false,
      "ldContext": "http://context/ngsi-context.jsonld&quot;,
      "createdAt": 1641365445.068897,
      "modifiedAt": 1641365445.068897,
      "conditions": [],
      "expression":

      { "q": "", "mq": "", "geometry": "", "coords": "", "georel": "", "geoproperty": "" }

      ,
      "format": "normalized"
      }

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        2h 3m 1 Fernando Lopez 06/Jan/22 8:35 AM
        In Progress In Progress Answered Answered
        2s 1 Fernando Lopez 06/Jan/22 8:35 AM
        Answered Answered Closed Closed
        53d 35m 1 Jason Fox 28/Feb/22 9:11 AM

          People

          • Assignee:
            jason.fox Jason Fox
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: