gpt4 book ai didi

fiware - 向不存在的设备发送措施时创 build 备 - IoTAgent-UL

转载 作者:行者123 更新时间:2023-12-02 04:34:20 27 4
gpt4 key购买 nike

我们在 IoT Agent Ultralight 中发现了一个错误。

如果我们尝试向不存在的设备发送测量值,我们将收到 404 - DEVICE_NOT_FOUND 错误,但同时将在 IoTA 和 Orion CB 中创建没有任何属性的设备数据库。

当我说没有任何属性的设备时,我指的是以下内容:

{
"device_id": "test",
"service": "MyService",
"service_path": "/MyServicePath",
"entity_name": "MyEntity:test",
"entity_type": "MyEntity",
"attributes": [],
"lazy": [],
"commands": [],
"static_attributes": []
}

这是一个非常重要的错误,因为创建任意数量的设备非常简单,而且可能会占用我们的数据库空间。

有人知道怎么解决吗?

最佳答案

  • 您使用的是哪个版本的 IotAgent-ul 和外部组件(Fiware OCB 和 MongoDB)?强烈建议使用最新的。
  • 这是使用 docker 镜像运行 OCB 和 MongoDB 的好方法
  • 您能否向我们提供您用于发送测量的命令/代码?

我自己测试了它,效果很好:

用于发送测量值的 Curl 命令:

#!/usr/local/bin
mosquitto_pub -t /TEF/sensor03/attrs -m 't|45|c|extreme'

来自 IotAgent-ul 的响应:

    {"op":"IOTAUL.Executable","time":"2018-09-21T09:59:17.906Z","lvl":"INFO","msg":"Ultralight 2.0 IoT Agent started"}
time=2018-09-21T09:59:32.679Z | lvl=DEBUG | corr=dbbcd94d-50fc-4062-a05b-bccfa76c52c8 | trans=dbbcd94d-50fc-4062-a05b-bccfa76c52c8 | op=IoTAgentNGSI.MongoDBDeviceRegister | srv=n/a | subsrv=n/a | msg=Looking for device with filter [{"id":"sensor03"}]. | comp=IoTAgent
Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
time=2018-09-21T09:59:32.717Z | lvl=ERROR | corr=dbbcd94d-50fc-4062-a05b-bccfa76c52c8 | trans=dbbcd94d-50fc-4062-a05b-bccfa76c52c8 | op=IOTAUL.IoTUtils | srv=n/a | subsrv=n/a | msg=MEASURES-001: Couldn't find device data for APIKey [TEF] and DeviceId[sensor03] | comp=IoTAgent
time=2018-09-21T09:59:32.717Z | lvl=ERROR | corr=dbbcd94d-50fc-4062-a05b-bccfa76c52c8 | trans=dbbcd94d-50fc-4062-a05b-bccfa76c52c8 | op=IOTAUL.Common.Binding | srv=n/a | subsrv=n/a | msg=MEASURES-005: Error before processing device measures [/TEF/sensor03/attrs] | comp=IoTAgent
time=2018-09-21T10:09:51.484Z | lvl=DEBUG | corr=dbbcd94d-50fc-4062-a05b-bccfa76c52c8 | trans=dbbcd94d-50fc-4062-a05b-bccfa76c52c8 | op=IoTAgentNGSI.MongoDBDeviceRegister | srv=n/a | subsrv=n/a | msg=Looking for device with filter [{"id":"sensor03"}]. | comp=IoTAgent
time=2018-09-21T10:09:51.504Z | lvl=ERROR | corr=dbbcd94d-50fc-4062-a05b-bccfa76c52c8 | trans=dbbcd94d-50fc-4062-a05b-bccfa76c52c8 | op=IOTAUL.IoTUtils | srv=n/a | subsrv=n/a | msg=MEASURES-001: Couldn't find device data for APIKey [TEF] and DeviceId[sensor03] | comp=IoTAgent
time=2018-09-21T10:09:51.509Z | lvl=ERROR | corr=dbbcd94d-50fc-4062-a05b-bccfa76c52c8 | trans=dbbcd94d-50fc-4062-a05b-bccfa76c52c8 | op=IOTAUL.Common.Binding | srv=n/a | subsrv=n/a | msg=MEASURES-005: Error before processing device measures [/TEF/sensor03/attrs] | comp=IoTAgent

显示来自 MongoDB 的数据

    root@727724bdd3d9:/# mongo --shell
MongoDB shell version: 3.2.21
connecting to: test
type "help" for help
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
> show dbs
iotagentul 0.000GB
local 0.000GB
orion 0.000GB

在我看来,您的配置设置有问题。请在评论之前向我们提供所有要点,以便后续跟进,您可以在 Github 网站上打开它吗? IotAgent-UL站在那里

谢谢,

Fernando Méndez - 研究初级软件工程师

关于fiware - 向不存在的设备发送措施时创 build 备 - IoTAgent-UL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45086461/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com