2

我正在开发一个Fiware系统,但我不知道如何通过IDAS iot-agent.

我正在运行 Orion 和 Cygnus,但我将带有 servlet 的措施直接发送到 Orion,我想将进程切换到IDAS iot-agent.

我已经正确创建了服务和设备,但我被从设备到 iot-agent 的 POST 卡住了。

我的设备创建如下:

{“device_id”:“0010”,“entity_name”:“0010”,“entity_type”:“xxxxx”,“时区”:“欧洲/马德里”,“属性”:[{“object_id”:“0010”,“ name”:“fecha”,“type”:“timestamp”,“name”:“coord_x”,“type”:“double”,“name”:“coord_y”,“type”:“double”,“name” :“编码器”,“类型”:“字符串”,“名称”:“s_temp”,“类型”:“双”,“名称”:“s_hum”,“类型”:“双”,“名称”:“ num_sat”,“类型”:“int”,“名称”:“voltaje”,“类型”:“双”,“名称”:“inicio”,“类型”:“int”}],“服务”:“xxxxx”,“service_path”:“/xxxxx”}

来自设备的 POST 将如何发送措施?

谢谢。

编辑:

我尝试从命令行进行 POST 测试,如下所示:

curl -X POST xxxxxxxxxxxx:8080/iot/d?i=0010 \ -i \ -H "Content-Type: application/text" \ -H "Fiware-Service: xxxxxx" \ -H "Fiware-ServicePath: /xxxxxx " \ -d "s_temp|25"

这是回应:

HTTP/1.1 415 Connection: close Content-Length: 88 {"reason": "Unsupported Media Type (only support application/xml and application/json)"}

现在的问题是……如果我安装了 iot-agent-base 和 iot-agent-ul,为什么我无法发布文本?我错过了一些配置吗?

编辑

我可以将值发送到此 url:

http://xxxxxxxx:8080/iot/xx?k=xxxxxxx&i=xxxxxxxx#fecha|1#coord_x|1#coord_y|1#coderr|1#s_temp|1#s_hum|1#s_temp|1#num_sat|1#voltaje|1#inicio|1

这就是回应

DEBUG - Accept: */*
DEBUG - End filters status 200
DEBUG - Proccessing in handle /iot
DEBUG - iota::AdminService::error_response 0
DEBUG - finish connection 2
DEBUG - Get statistics /iot/ngsi Counters 0
INFO - Agent Activity {"statistics":[{"resource":"/iot/ngsi","data":[]}]}

但猎户座什么也得不到

编辑:

这是一个版本问题,现在我安装了带有 UltraLight 模块和设备的最新版本的 iot-agent,带有“协议”:“PDI-IoTA-UltraLight”,并且协议本身正在运行。

但我不知道从设备发布措施的正确网址是什么。有什么帮助吗?

4

1 回答 1

4

您是否尝试过之前尝试过的相同 URL,但使用 -H "Content-Type: application/json" ?

即使正文是 UL2.0,内容类型也应设置为 JSON。

让我知道这是否能解决您的问题。感谢您使用 IDAS!

于 2015-08-27T07:48:17.660 回答