Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: FIWARE-TECH-HELP
-
Labels:
Description
Created question in FIWARE Q/A platform on 11-07-2022 at 15:07
Please, ANSWER this question AT https://stackoverflow.com/questions/72941258/error-when-invoke-a-patch-command-to-orion-context-broker
Question:
Error when invoke a PATCH command to Orion Context Broker
Description:
We're trying to invoke commands from Orion to IoT Device using PATCH and POST requests, but we're always having the following error:
Error [MANDATORY_PARAMS_NOT_FOUND] handing request:
Some of the mandatory params weren't found in the request: ["API Key","Device Id","Payload"]
Steps:
Create a "Device Entity" in Orion Context Broker
Provisioning a new Device
Create a Service in IoT JSON Agent
{
"services": [
{
"apikey": "my_api_key",
"protocol": [
"IoTA-JSON"
],
"cbroker": "orion:1026",
"entity_type": "Device",
"resource": "/iot/json"
}
]
}
Send a POST request to http://iot-agent-host:4041/v2/op/update to execute a command, via gateway, into the IoT Device (Works OK):
{
"actionType": "update",
"entities": [
{
"id": "shelly-1pm-test",
"type": "Device",
"cmd": {
"type": "command",
"value": {
"turn": "off",
"idDevice": "device001"
}
}
}
]
}
Send a PATCH request to http://context-broker-host:1026/v2/entities/entity-name/attrs to execute a command, via Orion CB, into the IoT Device, getting 204 in the response:
{
"cmd": {
"type": "command",
"value": {
"turn": "off",
"idDevice": "98cdac2e6101"
}
}
}
The command is not executed. Viewing the IoT JSON Agent logfile we can see:
[MANDATORY_PARAMS_NOT_FOUND] handing request: Some of the mandatory params weren't found in the request: ["API Key","Device Id","Payload"]
Any ideas?
Thanks in advance
Activity
- All
- Comments
- History
- Activity
- Transitions