在Wirecloud mashup中创建NGSI Source订阅

时间:2019-05-03 11:47:11

标签: fiware fiware-orion fiware-wirecloud

我必须承认我在为wirecloud mashup创建NGSI Source订阅时遗漏了一些要点。我尝试了Wirecloud基本历史记录信息教程,尝试了自己部署的Orion CB实例,尝试为曼彻斯特和埃因霍温城市的Orion端点创建订阅,但实际上无济于事:这是我为每种情况所做的尝试:

  1. Wirecloud用户指南基本教程(历史信息-设置如here所述):

NGSI服务器URL: http://orion.lab.fiware.org:1026/

NGSI代理URL: https://ngsiproxy.lab.fiware.org

使用用户的FIWARE凭据:已启用

使用工作区所有者的FIWARE凭据:已禁用

NGSI租户/服务:为空

NGSI范围: /

NGSI实体类型:节点,AMMS,调节器

ID模式:为空

受监控的NGSI属性:纬度,经度,存在度,电池电量,照度,有功功率,无功功率,电势,电流

不幸的是,在将NGSI实体添加到PoI并按照指南中的说明创建设置后,PoI不会像在指南上那样显示在地图上。相反,我收到以下错误(NGSI Source操作员日志):

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

2。自己的Orion CB实例: 向NGSI Source运算符添加了以下设置(注意:我的Orion实例由server ip 193.136.xx.xx托管):

NGSI服务器URL: http://193.136.xx.xx:53149/

NGSI代理URL: https://ngsiproxy.lab.fiware.org

固件服务: urbansense

FIWARE-SERvicePath: / basic

NGSI实体类型:天气观测

受监控的NGSI属性:位置,温度,相对湿度

然后我也会收到以下错误消息:

Error creating subscription in the context broker server: Connection Error

请问我到底在做什么错?


编辑:使用自己的NGSI代理实例:

NGSI服务器ULR http://193.136.29.17:53149/

NGSI代理URL: http://127.0.0.1:3000

FIWARE服务 urbansense

FIWARE-ServicePath / basic

NGSI实体类型“天气观测”

受监控的NGSI属性位置,温度,相对湿度

但是,错误仍然存​​在:

Error creating subscription in the context broker server: Connection Error

检查实体/属性可用性:

$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代理日志:

$ 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错误日志(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 个答案:

答案 0 :(得分:2)

只要您在选定的具有该租户ID(FIWARE服务)的Context Broker和该服务路径上存在这样的实体类型,您就不会做错任何事情。

但是连接错误不是由于您的Context Broker实例(您自己的一个或FIWARE实验室中的公共实例)引起的,而是由于NGSI代理引起的。 NGSI-proxy(https://ngsiproxy.lab.fiware.org)的FIWARE Lab实例似乎无法正常工作。报告并重新生成它后,您可以按照以下说明尝试自己的NGSI代理实例:https://github.com/conwetlab/ngsi-proxy

请记住,NGSI-Source运算符(我假设您正在使用它)使用NGSI-Proxy来接收订阅通知(该运算符订阅监视的NGSI属性中的任何更改),并且代理无法正常工作,则订阅失败。

最诚挚的问候