【发布时间】:2015-08-24 07:28:27
【问题描述】:
我正在开发一个Fiware 系统,但我不知道如何通过IDASiot-agent 从设备发送测量值。
我正在运行 Orion 和 Cygnus,但我将带有 servlet 的度量直接发送到 Orion,我想将进程切换到 IDAS iot-agent。
我已经正确地创建了服务和设备,但是我被从设备到 iot-agent 的 POST 卡住了。
我的设备创建如下:
{ “device_id”:“0010”,“entity_name”:“0010”,“entity_type”: “xxxxx”、“时区”:“欧洲/马德里”、“属性”:[ { “object_id” :“0010”,“名称”:“fecha”,“类型”:“时间戳”,“名称”:“coord_x”, “类型”:“双”,“名称”:“coord_y”,“类型”:“双”,“名称”: “coderr”,“type”:“string”,“name”:“s_temp”,“type”:“double”, “名称”:“s_hum”,“类型”:“双”,“名称”:“num_sat”,“类型”: “int”,“name”:“voltaje”,“type”:“double”,“name”:“inicio”, “类型”:“int”}],“服务”:“xxxxx”,“service_path”:“/xxxxx”}
设备的 POST 如何发送测量值?
谢谢。
编辑:
我尝试从命令行进行 POST 测试,如下所示:
curl -X POST xxxxxxxxxxxx:8080/iot/d?i=0010 \ -一世 \ -H“内容类型:应用程序/文本”\ -H "Fiware-服务: xxxxxx" \ -H "Fiware-ServicePath: /xxxxxx" \ -d "s_temp|25"
下面是回复:
HTTP/1.1 415 连接:关闭 Content-Length: 88 {"reason": "Unsupported Media Type (only support application/xml and application/json)"}
现在的问题是……如果我安装了 iot-agent-base 和 iot-agent-ul,为什么我无法发布文本?我错过了一些配置吗?
编辑:
我可以将值发送到这个网址:
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":[]}]}
但猎户座什么也得不到
编辑:
这是一个版本问题,现在我安装了最新版本的 iot-agent 和 UltraLight 模块和设备,带有“protocol”:“PDI-IoTA-UltraLight”,并且协议本身正在运行。
但我不知道从设备发布措施的正确网址是什么。有什么帮助吗?
【问题讨论】:
标签: fiware fiware-cygnus