Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-19818

FIWARE.Question.Tech.Error when invoke a PATCH command to Orion Context Broker.

    Details

      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

        backlogmanager Backlog Manager created issue -
        Hide
        backlogmanager Backlog Manager added a comment -

        2022-07-12 05:31|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2022-07-12 05:31|CREATED monitor | # answers= 0, accepted answer= False
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        fla Fernando Lopez made changes -
        Assignee Jason Fox [ jason.fox ]
        fla Fernando Lopez made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        fla Fernando Lopez made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        jason.fox Jason Fox made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        backlogmanager Backlog Manager made changes -
        Summary [fiware-stackoverflow] Error when invoke a PATCH command to Orion Context Broker FIWARE.Question.Tech.Error when invoke a PATCH command to Orion Context Broker.
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        3h 8m 1 Fernando Lopez 12/Jul/22 10:40 AM
        In Progress In Progress Answered Answered
        2s 1 Fernando Lopez 12/Jul/22 10:40 AM
        Answered Answered Closed Closed
        34d 2h 13m 1 Jason Fox 15/Aug/22 12:53 PM

          People

          • Assignee:
            jason.fox Jason Fox
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: