简体   繁体   English

如何在 iotagent-ul helmchart 中启用 NGSIv2?

[英]How to enable NGSIv2 in iotagent-ul helmchart?

I received {"name":"BAD_REQUEST","message":"Request error connecting to the Context Broker: 501"} error when when I send a POST to iotagent-ul deployed via iotagent-ul helm chart.当我向通过 iotagent-ul helm chart 部署的 iotagent-ul 发送 POST 时,我收到{"name":"BAD_REQUEST","message":"Request error connecting to the Context Broker: 501"}错误。

time=2022-10-08T09:03:18.182Z | lvl=DEBUG | corr=d7ed414d-a132-45ea-b4a3-38ee14a828dc | trans=d7ed414d-a132-45ea-b4a3-38ee14a828dc | op=IoTAgentNGSI.Request | from=n/a | srv=openiot | subsrv=/ | msg=Response {
    "error": "NotImplemented",
    "description": "Only NGSIv1-based forwarding supported at the present moment. Set explictely legacyForwarding to true"
}

Following the iotagent-ul documentation to enable NGSIv2, it must be set ngsiVersion in contextBroker:按照iotagent-ul 文档启用 NGSIv2,必须在 contextBroker 中设置 ngsiVersion:

{
    host: '192.168.56.101',
    port: '1026',
    ngsiVersion: 'v2'
}

Since I am using the official fiware helm-chart, I have updated the configmap.yaml to include the ngsiVersion由于我使用的是官方 fiware helm-chart,因此我更新了 configmap.yaml 以包含 ngsiVersion

    contextBroker: {
    /**
     * Host where the Context Broker is located.
     */
    host: '{{ .Values.iota.contextBroker.host }}',

    /**
     * Port where the Context Broker is listening.
     */
    port: '{{ .Values.iota.contextBroker.port }}',

    /**
     * ngsiVersion supported by the Context Broker.
     */
    ngsiVersion: '{{ .Values.iota.contextBroker.ngsiVersion }}'
}

Now, I get this error :现在,我收到此error

time=2022-10-08T18:17:24.614Z | lvl=ERROR | corr=841d2b61-463e-42ff-acd7-d0f4b867b7b3 | trans=841d2b61-463e-42ff-acd7-d0f4b867b7b3 | op=IoTAgentNGSI.DeviceService | srv=openiot | subsrv=/ | msg=Registration error connecting to the Context Broker: {"code":"400","reasonPhrase":"Bad Request","details":"missing isDomain value for registration attribute"} | comp=IoTAgent

According to comments on the question, you are using Orion-LD instead of official Orion.根据对该问题的评论,您使用的是 Orion-LD 而不是官方 Orion。 The Orion-LD support to NGSIv2 is limited, so I'd suggest to change your context broker to official Orion newest version (3.7.0 at the moment of writing this). Orion-LD 对 NGSIv2 的支持是有限的,所以我建议将您的上下文代理更改为官方 Orion 最新版本(在撰写本文时为3.7.0 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM