Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Enabler:IDAS
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": [
],
"lazy": [],
"commands": [
],
"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": [
]
}
],
"updateAction": "UPDATE"
}'
and I receive the following error response:
{
"errorCode":
}
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 | ]
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
Field | Original Value | New Value |
---|---|---|
Component/s | FIWARE-TECH-HELP [ 10278 ] |
Assignee | Jose Manuel Cantera [ jmcantera ] |
Assignee | Jose Manuel Cantera [ jmcantera ] | Jose Gato Luis [ josegato ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Answered [ 10104 ] |
Resolution | Done [ 10000 ] | |
Status | Answered [ 10104 ] | Closed [ 6 ] |
HD-Enabler | IDAS [ 10884 ] | |
Description |
Created question in FIWARE Q/A platform on 20-10-2018 at 19:10 {color: red}Please, ANSWER this question AT{color} 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 #). |
Created question in FIWARE Q/A platform on 20-10-2018 at 19:10
{color: red}Please, ANSWER this question AT{color} 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 #). |
Fix Version/s | 2021 [ 12600 ] |