1
votes

I must admit I'm missing some points in creating an NGSI Source subscription for a wirecloud mashup. I tried the Wirecloud Basic History Info tutorial, tried my own deployed instance of Orion CB, tried creating subscription for both Manchester and Eindhoven cities' orion endpoint but nothing actually work: Here's the attempts I made for each case:

  1. Wirecloud User Guide Basic Tutorial (History Info -settings created as described here):

NGSI server URL: http://orion.lab.fiware.org:1026/

NGSI proxy URL: https://ngsiproxy.lab.fiware.org

Use the FIWARE credentials of the user: Enabled

Use the FIWARE credentials of the workspace owner: Disabled

NGSI tenant/service: Emtpy

NGSI scope: /

NGSI entity types: Node, AMMS, Regulator

Id pattern: Empty

Monitored NGSI attributes: Latitud, Longitud, presence, batteryCharge, illuminance, ActivePower, ReactivePower, electricPotential, electricalCurrent

Unfortunately, after adding the NGSI Entity to PoI and creating settings as described in the Guide, PoI are not displayed on map as it is on the guide. Instead, I get the following error (NGSI Source operator logs):

Error creating subscription in the context broker server: Unexpected response from WireCloud's proxy 

2. Own instance of Orion CB: Added the following settings to the NGSI Source operator (NB: my orion instance is hosted by server ip 193.136.xx.xx):

NGSI server URL: http://193.136.xx.xx:53149/

NGSI proxy URL: https://ngsiproxy.lab.fiware.org

FIWARE-Service: urbansense

FIWARE-SERvicePath: /basic

NGSI Entity types: WeatherObserved

Monitored NGSI Attributes: location, temperature, relativeHumidity

I then get following error as well:

Error creating subscription in the context broker server: Connection Error

What exactly am i doing wrong here please?


EDIT: Using own instance of the NGSI-proxy:

NGSI server ULR http://193.136.29.17:53149/

NGSI proxy URL: http://127.0.0.1:3000

FIWARE-Service urbansense

FIWARE-ServicePath /basic

NGSI entity types WeatherObserved

Monitored NGSI attributes location, temperature, relativeHumidity

Howver, the error still remains:

Error creating subscription in the context broker server: Connection Error

Checking entities/attributes availability:

$curl -H 'fiware-service: urbansense' -H 'fiware-servicepath: /basic' http://193.136.29.17:53149/v2/entities

[{"id":"001","type":"WeatherObserved","dateObserved":{"type":"Text","value":"2014-06-05T21:47:06+01:00","metadata":{}},"illuminance":{"type":"Number","value":2.80323,"metadata":{}},"location":{"type":"StructuredValue","value":{"coordinates":[-8.594765,41.178296]},"metadata":{}},"name":{"type":"Text","value":"FEUP I322 Shannon","metadata":{}},"relativeHumidity":{"type":"None","value":null,"metadata":{}},"temperature":{"type":"None","value":null,"metadata":{}}},{"id":"003","type":"AirQualityObserved","O3":{"type":"Number","value":2.48661,"metadata":{}},"dateObserved":{"type":"Text","value":"2014-06-05T20:34:06+01:00","metadata":{}},"location":{"type":"StructuredValue","value":{"coordinates":[-8.594765,41.178296]},"metadata":{}},"name":{"type":"Text","value":"FEUP I322 Shannon","metadata":{}},"particles":{"type":"None","value":null,"metadata":{}}},{"id":"002","type":"NoiseLevelObserved","dateObserved":{"type":"Text","value":"2016-05-27T07:28:44+01:00","metadata":{}},"location":{"type":"StructuredValue","value":{"coordinates":[-8.590856,41.162781]},"metadata":{}},"measurand":{"type":"Number","value":67.7,"metadata":{}},"name":{"type":"Text","value":"Testbed Velasquez","metadata":{}},"sonometerClass":{"type":"Number","value":1,"metadata":{}}}]

NGSI-proxy log:

$ ngsi-proxy 
ngsi-proxy server listening on port 3000
::ffff:127.0.0.1 - - [23/May/2019:10:58:26 +0000] "OPTIONS /eventsource HTTP/1.1" 204 - "http://193.136.xx.xx:53152/arilwan/urbansense-history-info" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
Created connection with id: b0eb3540-7d49-11e9-8abb-f5559f5e609e
::ffff:127.0.0.1 - - [23/May/2019:10:58:26 +0000] "POST /eventsource HTTP/1.1" 201 135 "http://193.136.xx.xx:53152/arilwan/urbansense-history-info" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
::ffff:127.0.0.1 - - [23/May/2019:10:58:26 +0000] "OPTIONS /callbacks HTTP/1.1" 204 - "http://193.136.xx.xx:53152/arilwan/urbansense-history-info" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
Created callback with id: b1039f40-7d49-11e9-8abb-f5559f5e609e
::ffff:127.0.0.1 - - [23/May/2019:10:58:26 +0000] "POST /callbacks HTTP/1.1" 201 131 "http://193.136.xx.xx:53152/arilwan/urbansense-history-info" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
::ffff:127.0.0.1 - - [23/May/2019:10:58:57 +0000] "OPTIONS /callbacks/b1039f40-7d49-11e9-8abb-f5559f5e609e HTTP/1.1" 204 - "http://193.136.xx.xx:53152/arilwan/urbansense-history-info" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
Deleting callback b1039f40-7d49-11e9-8abb-f5559f5e609e
Deleted callback with id: b1039f40-7d49-11e9-8abb-f5559f5e609e
::ffff:127.0.0.1 - - [23/May/2019:10:58:57 +0000] "DELETE /callbacks/b1039f40-7d49-11e9-8abb-f5559f5e609e HTTP/1.1" 204 - "http://193.136.xx.xx:53152/arilwan/urbansense-history-info" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"

NGINX error log(nginx_logs/error.log):

2019/05/23 10:57:04 [warn] 6#6: *171 upstream sent more data than specified in "Content-Length" header while reading upstream, client: 193.136.38.232, server: , request: "GET /showcase/media/CoNWeT/map-viewer/2.6.2/index.html?entrypoint=true&v=31cb4ca4c8751f6d04c4242d0b52b176a2c7bc9b&theme=wirecloud.defaulttheme HTTP/1.1", upstream: "http://192.168.224.10:8000/showcase/media/CoNWeT/map-viewer/2.6.2/index.html?entrypoint=true&v=31cb4ca4c8751f6d04c4242d0b52b176a2c7bc9b&theme=wirecloud.defaulttheme", host: "193.136.xx.xx:53152", referrer: "http://193.136.xx.xx:53152/arilwan/urbansense-history-info"
2019/05/23 10:57:34 [error] 6#6: *179 upstream prematurely closed connection while reading response header from upstream, client: 193.136.38.232, server: , request: "POST /cdp/http/193.136.xx.xx:53149/v2/subscriptions HTTP/1.1", upstream: "http://192.168.224.10:8000/cdp/http/193.136.xx.xx:53149/v2/subscriptions", host: "193.136.xx.xx:53152", referrer: "http://193.136.xx.xx:53152/arilwan/urbansense-history-info"
1

1 Answers

2
votes

You're not making anything wrong, provided that on the chosen Context Broker, with that tenant ID (FIWARE-Service) and on that Service Path, there exist such Entity Types.

But the connection error is not due to your Context Broker instances (your own one or the public instance on FIWARE lab), but to the NGSI-proxy. The FIWARE Lab instance of NGSI-proxy (https://ngsiproxy.lab.fiware.org) seems not to be working properly. While it is reported and respawned, you can try your own instancce of an NGSI-proxy by following instructions here: https://github.com/conwetlab/ngsi-proxy.

Bear in mind that the NGSI-Source operator (I assume you're using it) uses the NGSI-Proxy for the reception of the notifications on subscriptions (the operator subscribes for any change in the monitored NGSI Attributes), and since the proxy is not working properly, the subscription fails.

Best regards