[ https://jira.fiware.org/browse/HELP-14844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jose Manuel Cantera reassigned HELP-14844:
------------------------------------------
Assignee: Jose Gato Luis (was: Jose Manuel Cantera)
> [fiware-stackoverflow] Command doesn't forward from FIWARE JSON Agent toward the Broker MQTT
> ------------------------------------------------------------------------------------------------
>
> Key: HELP-14844
> URL: https://jira.fiware.org/browse/HELP-14844
> Project: Help-Desk
> Issue Type: Monitor
> Components: FIWARE-TECH-HELP
> Reporter: Backlog Manager
> Assignee: Jose Gato Luis
> Labels: fiware, fiware-orion, iot, mqtt
>
> 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 at 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 at 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 at xerus-1 |
> iotstack_agent-json.1.xyz at xerus-1 | {
> iotstack_agent-json.1.xyz at xerus-1 | "contextElements": [
> iotstack_agent-json.1.xyz at xerus-1 | {
> iotstack_agent-json.1.xyz at xerus-1 | "type": "Device",
> iotstack_agent-json.1.xyz at xerus-1 | "isPattern": "false",
> iotstack_agent-json.1.xyz at xerus-1 | "id": "t3",
> iotstack_agent-json.1.xyz at xerus-1 | "attributes": [
> iotstack_agent-json.1.xyz at xerus-1 | {
> iotstack_agent-json.1.xyz at xerus-1 | "name": "c",
> iotstack_agent-json.1.xyz at xerus-1 | "type": "Command",
> iotstack_agent-json.1.xyz at xerus-1 | "value": "100"
> iotstack_agent-json.1.xyz at xerus-1 | }
> iotstack_agent-json.1.xyz at xerus-1 | ]
> iotstack_agent-json.1.xyz at xerus-1 | }
> iotstack_agent-json.1.xyz at xerus-1 | ],
> iotstack_agent-json.1.xyz at xerus-1 | "updateAction": "UPDATE"
> iotstack_agent-json.1.xyz at xerus-1 | }
> iotstack_agent-json.1.xyz at xerus-1 |
> iotstack_agent-json.1.xyz at xerus-1 | | comp=IoTAgent
> iotstack_agent-json.1.xyz at 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 #).
--
This message was sent by Atlassian JIRA
(v6.4.1#64016)
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy