When provisioning the Robot example device, the entities are getting created with position_info and position_status attributes but the update Position attribute in Orion is giving an error
{"code": "404", "reasonPhrase": "No context element found", "details": "error forwarding update" }
Device provision req:
curl --location --request POST 'localhost:4041/iot/devices' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'fiware-service: factory' \
--header 'fiware-servicepath: /robots' \
--data-raw '{
"devices": [
{
"device_id": "robot1",
"entity_type": "Robot",
"entity_name": "robot01",
"endpoint": "http://iot-sensors:3001/iot/robot",
"attributes": [
{
"name": "Battery",
"type": "number"
}
],
"lazy": [
{
"name": "Message",
"type": "string"
}
],
"commands": [
{
"name": "Position",
"type": "location"
}
],
"internal_attributes": {
"lwm2mResourceMapping": {
"Battery" : {
"objectType": 7392,
"objectInstance": 0,
"objectResource": 1
},
"Message" : {
"objectType": 7392,
"objectInstance": 0,
"objectResource": 2
},
"Position" : {
"objectType": 7392,
"objectInstance": 0,
"objectResource": 3
}
}
}
}
]
}'
And Update context request:
curl --location --request POST 'http://localhost:1026/v1/updateContext' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'fiware-service: factory' \
--header 'fiware-servicepath: /robots' \
--data-raw '{
"contextElements": [
{
"type": "Robot",
"isPattern": "false",
"id": "Robot:robot1",
"attributes": [
{
"name": "Position",
"type": "location",
"value": "[18,3]"
}
]
}
],
"updateAction": "UPDATE"
}'
As per the documentation, This action should trigger an Execute action in the client. It should also update the "_status" field of the entity with the "PENDING" value, stating the execution is pending of the client result.
I also tried to update the Position attribute using v2 but not working:
curl --location --request PATCH
'http://localhost:1026/v2/entities/robot01/attrs/' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'fiware-service: factory' \
--header 'fiware-servicepath: /robots' \
-d '{
"Position": {
"type" : "location",
"value" : "[18,3]"
}
}'