[ https://jira.fiware.org/browse/HELP-19101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=115499#comment-115499 ] Jason Fox commented on HELP-19101: ---------------------------------- Possible Orion-LD Bug - https://github.com/FIWARE/context.Orion-LD/pull/983/files#diff-921fc6ab850278cc281e7662f6170be2e3474f95a800000779c1dd9c6c377dd6R1 > [fiware-stackoverflow] Orion-LD issues no notification send to subscription > --------------------------------------------------------------------------- > > Key: HELP-19101 > URL: https://jira.fiware.org/browse/HELP-19101 > Project: Help-Desk > Issue Type: Monitor > Components: FIWARE-TECH-HELP > Reporter: Backlog Manager > Assignee: Jason Fox > Labels: fiware, fiware-orion > > Created question in FIWARE Q/A platform on 05-01-2022 at 07:01 > {color: red}Please, ANSWER this question AT{color} 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 at ttn", > "password": "XXXX", > "provider": "TTN" > }, > "dev_eui": "XXXXX", > "app_eui": "XXXXXX", > "application_id": "XXXXXX at 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>; rel="http://www.w3.org/ns/json-ld#context"; 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" > }' > 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" > } > ] > 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": ["https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#temperature1", "https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#temperature2"], > "attrs": { > "https://ngsi-ld-tutorials=readthedocs=io/en/latest/datamodels=html#temperature1": { > "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": { > "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", > "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": ["https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#temperature1"], > "metadata": [], > "blacklist": false, > "ldContext": "http://context/ngsi-context.jsonld", > "createdAt": 1641365445.068897, > "modifiedAt": 1641365445.068897, > "conditions": [], > "expression": { > "q": "", > "mq": "", > "geometry": "", > "coords": "", > "georel": "", > "geoproperty": "" > }, > "format": "normalized" > } -- This message was sent by Atlassian JIRA (v6.4.1#64016)
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy