简体   繁体   English

在Fiware中检查从Orion到物联网代理的命令

[英]checking command from orion to iot agent in Fiware

I've used the FIWARE Orion Context Broker and IoTAgent-UL in my project. 我在项目中使用了FIWARE Orion上下文代理和IoTAgent-UL。 I've registered a virual device by sending a Json message carrying the device attributes, the command attributes, device endpoint address and the used protocol (UL2.0). 我已经通过发送Json消息注册了一个虚拟设备,该消息中包含设备属性,命令属性,设备端点地址和使用的协议(UL2.0)。

If I update the command attribute of the device entity in Orion Context Broker, how can i check that the command is sent to the IoTAgent successfully before it is forwarded to the device virtual device itself? 如果我在Orion Context Broker中更新了设备实体的命令属性,那么在将命令转发到设备虚拟设备本身之前,如何检查该命令是否已成功发送到IoTAgent?

Moreover, can I make the IP address of a Raspberrypi the endpoint itself and assign a port to a device connected to the Raspberrypi? 此外,我可以将Raspberrypi的IP地址作为端点本身,并为连接到Raspberrypi的设备分配端口吗? And how could this be done? 怎么做呢?

Finally, in case I have no physical device could I consider the IoTAgent's address an endpoint to check whether any update on the command attribute in the context broker will be forwarded to that endpoint? 最后,如果我没有物理设备,我可以考虑将IoTAgent的地址作为终结点,以检查是否将上下文代理中command属性的任何更新转发给该终结点吗?

Thanks 谢谢

There are three ways of checking the update context/command has been sent to the agent, and from the agent or the device: 有三种检查更新上下文/命令已发送到代理以及从代理或设备发送的方法:

  • Check Orion or agent logs. 检查Orion或代理日志。
  • Check the MQTT broker logs, if you are using MQTT transport. 如果您正在使用MQTT传输,请检查MQTT代理日志。
  • Check the device itself. 检查设备本身。 If the command was received, you'll be able to see the effects of the command. 如果收到该命令,您将能够看到该命令的效果。

Regarding the place a Raspberry Pi may play in an architecture using IoT agents, typically it is used to replace the agent :) I mean, if having a device such as a Raspberry Pi, the usual scenario is to connect to the R-Pi all your sensors and actuators, as if it was a gateway, and then let the R-Pi connect directly to Orion Context Broker by implementing a NGSI client running in the R-Pi. 关于Raspberry Pi在使用IoT代理的体系结构中可能扮演的角色,通常用它来代替该代理:)我的意思是,如果拥有Raspberry Pi之类的设备,通常的情况是将R-Pi全部连接到您的传感器和执行器,就好像它是网关一样,然后通过实现在R-Pi中运行的NGSI客户端,使R-Pi直接连接到Orion Context Broker。 Schematically: 示意图:

Orion <---> R-Pi + NGSI client <---> sensor/actuator

Nevertheless, I guess you can use the R-Pi as if it was a final device (sensor or actuator) in order to test IoT agents. 不过,我想您可以将R-Pi当作最终设备(传感器或执行器)使用,以测试IoT代理。 Regarding how to emulate the final device itself, I guess you'll have to run certain logic in the R-Pi in order to accept the UL messages from the IoT agent/MQTT broker. 关于如何模拟最终设备本身,我想您必须在R-Pi中运行某些逻辑才能接受来自IoT代理/ MQTT代理的UL消息。 A simple netcat could help you; 一个简单的netcat可以帮助您; more complex emulation services could be run, of course. 当然,可以运行更复杂的仿真服务。 Schematically: 示意图:

Orion <----> UL agent <---> R-Pi + netcat 

Anyway, please observe always a final device (sensor or actuator) is required, either real, either simulated (running netcat or similar in a R-Pi/server), since the UL agent must have an endpoint where to send the UL payloads. 无论如何,请注意始终需要最终设备(传感器或执行器),无论是真实设备,还是仿真设备(在R-Pi /服务器中运行netcat或类似设备),因为UL代理必须具有用于发送UL有效负载的端点。

Orion <---> UL agent <---> R-Pi + netcat OR server + netcat OR real sensor/actuator

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

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