【问题标题】:Error in subscribeContext订阅上下文中的错误
【发布时间】:2015-12-10 16:16:49
【问题描述】:

我目前正在尝试使用配置管理器 (NECongMan) 和 Fiware Orion 作为上下文生成器来配置 Fiware IoT 代理。我遇到了 NGSI10 subscribeContext 操作的问题。

这是发送到 IoT 代理的请求:

<?xml version="1.0"?>
<subscribeContextRequest>
  <entityIdList>
    <entityId type="Room" isPattern="false">
      <id>Room1</id>
    </entityId>
  </entityIdList>
  <attributeList>
    <attribute>temperature</attribute>
  </attributeList>
  <reference>http://localhost:1028/accumulate</reference>
  <duration>PT1H</duration>
  <notifyConditions>
    <notifyCondition>
      <type>ONCHANGE</type>
      <condValueList>
        <condValue>pressure</condValue>
      </condValueList>
    </notifyCondition>
  </notifyConditions>
  <throttling>PT5S</throttling>
</subscribeContextRequest>

IoTBroker 尝试联系 Orion 发出 subscribeContextRequest 但持续时间字符串已更改:

<subscribeContextRequest>
    <entityIdList>
        <entityId
            type="Room"
            isPattern="false">
            <id>
                Room1
                </id>
            </entityId>
        </entityIdList>
    <attributeList>
        <attribute>
            temperature
            </attribute>
        </attributeList>
    <reference>
        http://192.168.16.178:8080/ngsi10/notify
        </reference>
    <duration>
        P0Y0M0DT0H59M58.157S
        </duration>
    <notifyConditions>
        <notifyCondition>
            <type>
                ONCHANGE
                </type>
            <condValueList>
                <condValue>
                    pressure
                    </condValue>
                </condValueList>
            </notifyCondition>
        </notifyConditions>
    <throttling>
        PT5S
        </throttling>
    </subscribeContextRequest>

但是 Orion 给出了一个错误(无效的负载:持续时间字符串中的语法错误)。你知道如何解决这个问题吗?

【问题讨论】:

    标签: fiware fiware-orion


    【解决方案1】:

    对于一小时,Duration 参数可能是 P1H 而不是 PT1H,根据ISO 8601 标准格式,似乎 PT 仅用于避免 P1M 一个月和 PT1M 一分钟之间的歧义强>。

    希望对你有帮助

    【讨论】:

      【解决方案2】:

      Orion 0.26.1(撰写本文时的最后一个版本)不支持持续时间字符串中秒的十进制值(如 58.157)。我们已经创建了an issue about that,我们的计划是在下一个版本 (0.27.0) 之前解决它。

      不确定修改 IoTBroker 的行为方式(以便在发送到 Orion 的请求中将秒数向上/向下舍入为整数)是否是一种有效的解决方法...我不知道有关 IoTBroker 的详细信息。

      编辑: 支持秒字段中小数的修复刚刚在 Orion 的开发分支中实现,因此它将在下一个 Orion 版本 (0.27.0) 中可用。或者,您可以下载源代码并构建代码以立即获得修复。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-10-20
        • 1970-01-01
        • 1970-01-01
        • 2013-01-27
        • 2017-07-25
        相关资源
        最近更新 更多