Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Chapter:IoT
-
HD-Enabler:IDAS
Description
Created question in FIWARE Q/A platform on 30-11-2015 at 18:11
Please, ANSWER this question AT http://stackoverflow.com/questions/34004222/fiware-iotagent-cant-send-command-to-a-device
Question:
Fiware IotAgent: can't send command to a device
Description:
I approvisionned my device like this:
curl -X POST http://192.168.1.110:80/iot/devices \
-i \
-H "Content-Type: application/json" \
-H "Fiware-Service: egmsmartcity" \
-H "Fiware-ServicePath: /egmsmartcitypath" \
-d ' { "devices": [ { "device_id": "test",
"entity_name": "sensors:test",
"entity_type": "sensors",
"protocol": "PDI-IoTA-MQTT-UltraLight",
"timezone": "Europe/Paris",
"endpoint": "notUsed",
"commands": [
] } ] }'
It is successufl registered in the context Broker:
GET on: http://192.168.1.77:1026/v1/contextEntities/sensors:test
with headers:
Accept: application/json
Fiware-Service: egmsmartcity
Fiware-ServicePath: /egmsmartcitypath
I got the following response:
{
contextElement: {
type: "sensors"
isPattern: "false"
id: "sensors:test"
attributes: [1]
0: {
name: "TimeInstant"
type: "ISO8601"
value: "2015-11-30T16:53:45.556269Z"
}-
-
}-
statusCode: {
code: "200"
reasonPhrase: "OK"
}-
}
and then when I try to update the command like this:
curl -X POST http://192.168.1.77:1026/v1/updateContext \
-i \
-H "Content-Type: application/json" \
-H "Fiware-Service: egmsmartcity" \
-H "Fiware-ServicePath: /egmsmartcitypath" \
-d ' {"updateAction":"UPDATE","contextElements":[{"id":"sensors:test","type":"sensors","isPattern":"false","attributes":[
]} ]}'
I got this response:
HTTP/1.1 200 OK
Content-Length: 157
Content-Type: application/xml
Date: Mon, 30 Nov 2015 17:05:11 GMT
<updateContextResponse>
<errorCode>
<code>404</code>
<reasonPhrase>No context element found</reasonPhrase>
</errorCode>
</updateContextResponse>
why is it returning "No context element found" ? What have I missed ?
Thanks in advance for your help!
2015-11-30 21:05|CREATED monitor | # answers= 0, accepted answer= False