Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContextBroker Node not created #17

Open
karikolehmainen opened this issue Apr 28, 2021 · 5 comments
Open

ContextBroker Node not created #17

karikolehmainen opened this issue Apr 28, 2021 · 5 comments

Comments

@karikolehmainen
Copy link

Installing the latest component to with latest NodeRED seems not create ContextBroker node. Only Nodes visible are NGSI Entity, NGSI Dataset, NGSI Update, NGSI Subscription and NGSI v2toLD. ContextBroker is referred in details of NGSI Subscription but such entity is not visible on design view. It is possible to set ContextBroker settings via Subscription node, but deploying Subscription node does not make subscription to Orion so I am thinking that ContextBorker node actually does not get deployed. Any idea what could be wrong, is there something in latest NodeRED that brakes compatibility and if so, what is the latest compatible versions?

@fisuda
Copy link
Contributor

fisuda commented Apr 28, 2021

According to the following source code, the Context-Broker node is defined as a configuration node. Please see https://nodered.org/docs/creating-nodes/config-nodes.

};
RED.nodes.registerType('Context-Broker',{
category: 'config',
defaults: {

contextbroke-node

@karikolehmainen
Copy link
Author

karikolehmainen commented Apr 29, 2021

Thanks for the reply, that explains why it is not visible. Still I am struggling to understand how to get context change events to NodeRED. I do not seem to be able to get any subscriptions registered at Orion nor do I see any traffic at debug view I deploy the flow. I have defined NGSI Subscribe Node as follows:
Screenshot 2021-04-29 at 9 31 53
Screenshot 2021-04-29 at 9 31 28
This is an example of an entity I have at Orion:
`
{

    "id": "urn:ngsi-ld:NodeSensor:nodeC8-B3-C6-C5-92-B1",
    "type": "NodeSensor",
    "TimeInstant": { "type": "DateTime", "value": "2021-04-29T08:57:43.312Z", "metadata": {}  },
    "humidity": {
        "type": "Number",
        "value": 187,
        "metadata": { "TimeInstant": { "type": "DateTime", "value": "2021-04-29T08:57:43.312Z"  }  }
    },
    "refHome": {
        "type": "Relationship",
        "value": "urn:ngsi-ld:Refinery:001",
        "metadata": { "TimeInstant": { "type": "DateTime", "value": "2021-04-29T08:57:43.312Z"  }  }
    },
    "signal": {
        "type": "Number",
        "value": -44,
        "metadata": {  "TimeInstant": {  "type": "DateTime", "value": "2021-04-29T08:57:43.312Z"  }  }
    },
    "temperature": {
        "type": "Number",
        "value": 206,
        "metadata": {  "TimeInstant": { "type": "DateTime",  "value": "2021-04-29T08:57:43.312Z"   }  }
    }
}`

That was retrieved with command:
curl -X GET 'http://localhost:1026/v2/entities' -H 'fiware-service: openiot' -H 'fiware-servicepath: /' | python3 -mjson.tool

Note that entities are NGSI v2 but entity IDs are given with NGSI-LD notation as per FIWARE examples.

@kosgobakis
Copy link
Contributor

Check my pull request. The issue is that you need to add the fiware-servicepath when you declare the Context Broker
https://github.com/FIWARE/node-red-contrib-FIWARE_official/pull/20

@jason-fox
Copy link
Member

The PR has been merged - does this solve the issue?

@johncaipa
Copy link

It has not worked for me, it only works with security enabled?
image
image
My example flow:
[{"id":"e2524373.a31728","type":"NGSI-Entity","z":"f6f2187d.f17ca8","name":"","endpoint":"68a1e9ee.287918","protocol":"v2","ldContext":"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld","mode":"keyValues","mimeType":"application/ld+json","attrs":"","x":490,"y":240,"wires":[["6e92558d.758ed4"]]},{"id":"94a57f7a.74bbf","type":"inject","z":"f6f2187d.f17ca8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"urn:ngsi-ld:Store:001","payloadType":"str","x":270,"y":240,"wires":[["e2524373.a31728"]]},{"id":"6e92558d.758ed4","type":"debug","z":"f6f2187d.f17ca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":680,"y":240,"wires":[]},{"id":"68a1e9ee.287918","type":"Context-Broker","name":"","endpoint":"http://localhost:1026","service":"openiot","servicepath":"/","idmEndpoint":""}]
on postman the test are working
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants