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

[fiware-stackoverflow] Command doesn't forward from FIWARE JSON Agent toward the Broker MQTT

    Details

      Description

      Created question in FIWARE Q/A platform on 20-10-2018 at 19:10
      Please, ANSWER this question AT https://stackoverflow.com/questions/52908085/command-doesnt-forward-from-fiware-json-agent-toward-the-broker-mqtt

      Question:
      Command doesn't forward from FIWARE JSON Agent toward the Broker MQTT

      Description:
      I've deployed the iot stack with docker. These are the used containers:

      fiware/orion:1.13.0
      fiware/iotagent-json:1.8.0
      eclipse-mosquitto:1.4.12
      [other containers not involved in the issue ...]

      I've registered the following device on the agent:

      {
      "device_id": "t3",
      "service": "lmobile",
      "service_path": "/lmobile_Industry",
      "entity_name": "t3",
      "entity_type": "Device",
      "endpoint": "tcp://<mqttborker_publicip>:<port>",
      "transport": "MQTT",
      "attributes": [

      { "object_id": "led", "name": "led", "type": "text" }

      ],
      "lazy": [],
      "commands": [

      { "object_id": "c", "name": "c", "type": "Command" }

      ],
      "static_attributes": [
      ....
      ],
      "protocol": "JSON"
      }

      and the corresponding entity has been properly created on the OCB and when I publish a new measure on the mqttbroker, under the topic /<apikey>/t3/attrs the measure is properly forward toward the OCB.

      In order to send the command c to the device I send the following updateContext on OCB:

      curl -s -X POST http://:1026/v1/updateContext
      -H 'accept: application/json'
      -H 'cache-control: no-cache'
      -H 'content-type: application/json'
      -H 'fiware-service: lmobile'
      -H 'fiware-servicepath: /lmobile_Industry'
      -d '{
      "contextElements": [
      {
      "type": "Device",
      "isPattern": "false",
      "id": "t3",
      "attributes": [

      { "name":"c", "type":"Command", "value":100 }

      ]
      }
      ],
      "updateAction": "UPDATE"
      }'

      and I receive the following error response:

      {
      "errorCode":

      { "code": "404", "reasonPhrase": "No context element found", "details": "invalid context provider response" }

      }

      In the OCB Log I can see the following WARNING Message:
      time=Thursday 18 Oct 08:55:54 2018.431Z | lvl=WARN | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=postQueryContext.cpp[169]:queryForward | msg=Other Error (context provider response to QueryContext is empty).
      Anyway, the updateContext is properly forwarded to the Agent.

      In the Agent Log (in DEBUG) I can see the followings:

      iotstack_agent-json.1.xyz@xerus-1 | time=2018-10-18T09:02:33.975Z | lvl=DEBUG | corr=8d2864ec-d2b4-11e8-b445-02420aff0161 | trans=de5680e7-0727-4577-ac44-ddeb59df1f31 | op=IoTAgentNGSI.GenericMiddlewares | srv=lmobile | subsrv=/lmobile_Industry | msg=Request for path [/updateContext] from [<agent_publicip>:<port>] | comp=IoTAgent
      iotstack_agent-json.1.xyz@xerus-1 | time=2018-10-18T09:02:33.976Z | lvl=DEBUG | corr=8d2864ec-d2b4-11e8-b445-02420aff0161 | trans=de5680e7-0727-4577-ac44-ddeb59df1f31 | op=IoTAgentNGSI.GenericMiddlewares | srv=lmobile | subsrv=/lmobile_Industry | msg=Body:
      iotstack_agent-json.1.xyz@xerus-1 |
      iotstack_agent-json.1.xyz@xerus-1 | {
      iotstack_agent-json.1.xyz@xerus-1 | "contextElements": [
      iotstack_agent-json.1.xyz@xerus-1 | {
      iotstack_agent-json.1.xyz@xerus-1 | "type": "Device",
      iotstack_agent-json.1.xyz@xerus-1 | "isPattern": "false",
      iotstack_agent-json.1.xyz@xerus-1 | "id": "t3",
      iotstack_agent-json.1.xyz@xerus-1 | "attributes": [
      iotstack_agent-json.1.xyz@xerus-1 |

      { iotstack_agent-json.1.xyz@xerus-1 | "name": "c", iotstack_agent-json.1.xyz@xerus-1 | "type": "Command", iotstack_agent-json.1.xyz@xerus-1 | "value": "100" iotstack_agent-json.1.xyz@xerus-1 | }

      iotstack_agent-json.1.xyz@xerus-1 | ]
      iotstack_agent-json.1.xyz@xerus-1 | }
      iotstack_agent-json.1.xyz@xerus-1 | ],
      iotstack_agent-json.1.xyz@xerus-1 | "updateAction": "UPDATE"
      iotstack_agent-json.1.xyz@xerus-1 | }
      iotstack_agent-json.1.xyz@xerus-1 |
      iotstack_agent-json.1.xyz@xerus-1 | | comp=IoTAgent
      iotstack_agent-json.1.xyz@xerus-1 | time=2018-10-18T09:02:33.978Z | lvl=DEBUG | corr=8d2864ec-d2b4-11e8-b445-02420aff0161 | trans=de5680e7-0727-4577-ac44-ddeb59df1f31 | op=IoTAgentNGSI.DomainControl | srv=lmobile | subsrv=/lmobile_Industry | msg=response-time: 6 | comp=IoTAgent

      Here I don't see warnings or errors but no commands are forwarded to the MQTT Broker on any topic (I'm subscribed both to the specific topic for commands /<apikey>/t3/cmd and to all topics by using the wildcard #).

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2018-10-20 21:06|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2018-10-20 21:06|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2018-10-23 15:06|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2018-10-23 15:06|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2018-10-23 18:06|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2018-10-23 18:06|UPDATED status: transition Answered| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2018-10-30 21:05|UPDATED status: transition Finish| # answers= 2, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2018-10-30 21:05|UPDATED status: transition Finish| # answers= 2, accepted answer= True

          People

          • Assignee:
            josegato Jose Gato Luis
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: