We use proprietary and third party´s cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy
Ask Your Question
0

Cygnus tutorial - not working

asked 2018-06-06 11:08:34 +0200

Raffa87 gravatar image

Dear Fiware User, I am trying to complete the example on Cygnus available at http://fiware-cygnus.readthedocs.io/e...startguide/index.html

I have a working Context Broker available at localhost. However, when I try to run the notification.sh script written according to tutorial, this is the error that I get:

$ ./notification.sh http://localhost:5050/notify

  • About to connect() to localhost port 5050 (#0)

  • Trying ::1... Connection refused

  • Trying 127.0.0.1... Connection refused

  • couldn't connect to host

  • Closing connection #0

curl: (7) couldn't connect to host

Can you please support me? Thak you very much

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2018-06-09 16:11:50 +0200

The notification.sh appears to be a simulation of the result of an Orion Subscription - and therefore needs to be posted to the port Cygnus is listening on - which is usually localhost:5050 - assuming you are running Cygnus on localhost.

Your couldn't connect to host message indicates that either you have not started Cygnus on localhost or you have configured an alternate port. Ensure you have used the environment variable CYGNUS_API_PORT=5080 somewhere or the agent.conf file holds a line cygnus-ngsi.sources.http-source.port = 5050

The subscription it is simulating is supposed to be something along the lines of When X occurs send a notification to cygnus - Therefore I'm guessing that localhost:5050 is the location where Cygnus is supposed to be listening.

When setting up a REAL subscription and running Orion it needs to be something like:

curl -X POST \ 'http://{{orion:port}}/v2/subscriptions/' \ -H 'Content-Type: application/json' \ -d '{ "description": "Notify Cygnus of all context changes", "subject": { "entities": [ { "idPattern": ".*" } ] }, "notification": { "http": { "url": "http://{{cygnus:port}}/notify" }, "attrsFormat": "legacy" }, "throttling": 5 }'

Replace {{orion:port}} and {{cyngnus:port}} as necessary (this assumes you are not using a fiware-header or fiware-servicepath yet...)

You can then update an existing entity with the PATCH command:

curl -X PATCH \ 'http://{{orion}}/v2/entities/<entity-id>/attrs' \ -H 'Content-Type: application/json' \ -d ' { "price":{"type":"Integer", "value": 89} }'

Obviously replace <entity-id> and the -d payload with your data.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-06-06 11:08:34 +0200

Seen: 28 times

Last updated: Jun 06