[Backlogmanager] [FIWARE-JIRA] (HELP-16014) [fiware-stackoverflow] LoRaWAN IoT Agent commands not properly forwarded

Fernando Lopez (JIRA) jira-help-desk at jira.fiware.org
Mon Jul 15 12:17:00 CEST 2019


     [ https://jira.fiware.org/browse/HELP-16014?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Lopez reassigned HELP-16014:
-------------------------------------

    Assignee: Jose Gato Luis

> [fiware-stackoverflow] LoRaWAN IoT Agent commands not properly forwarded
> ------------------------------------------------------------------------
>
>                 Key: HELP-16014
>                 URL: https://jira.fiware.org/browse/HELP-16014
>             Project: Help-Desk
>          Issue Type: Monitor
>          Components: FIWARE-TECH-HELP
>            Reporter: Backlog Manager
>            Assignee: Jose Gato Luis
>              Labels: fiware, fiware-orion, lora, lorawan
>
> Created question in FIWARE Q/A platform on 12-07-2019 at 12:07
> {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/57004964/lorawan-iot-agent-commands-not-properly-forwarded
> +Question:+
> LoRaWAN IoT Agent commands not properly forwarded
> +Description:+
> I'm working on WSN prototype using FIWARE to retrieve measurements from sensors and send commands back to actuators.
> I am using Orion as context broker, LoRaWAN IoT Agent for south and north bounds, other components that are not relevant to this issue.
> I am running all components on docker compose.
> I was able to subscribe to MQTT topic and publish data using MQTT.fx to simulate the data traffic coming from the sensors to Orion CB passing by IoT Agent.
> the IoT agent successfully received the message and forwarded it to Orion; I can clearly see the updated value of the attribute in Orion.
> To this point, everything is working just fine, now I want to send commands back to actuators, I have followed this tutorial! step by step I could see the command value being updated in Orion when I update it but I wasn't able to know whether the command was sent back to the actuator through the agent.
> I have registered the agent as a context provider, as explained in the tutorial. 
> curl -iX POST \
>   'http://localhost:1026/v2/registrations' \
>   -H 'Content-Type: application/json' \
>   -H 'fiware-service: agriculture' \
>   -H 'fiware-servicepath: /irrigation' \
>   -d '{
>   "description": "Pump Commands",
>   "dataProvided": {
>     "entities": [
>       {
>         "id": "urn:ngsi-ld:tempHumid:001", 
>         "type": "tempHumid"
>       }
>     ],
>     "attrs": [ "on", "off" ]
>   },
>   "provider": {
>     "http": {"url": "http://orion:1026/v1"},
>     "legacyForwarding": true
>   }
> }'
> and update the value of the command,
> curl -iX PATCH \
>   'http://localhost:1026/v2/entities/urn:ngsi-ld:tempHumid:001/attrs' \
>   -H 'Content-Type: application/json' \
>   -H 'fiware-service: agriculture' \
>   -H 'fiware-servicepath: /irrigation' \
>   -d '{
>   "on": {
>       "type" : "command",
>       "value" : "ONN"
>   }
> }'
> Log from ORION
> fiware-orion   | INFO at 10:26:33  logMsg.h[1874]: Transaction ended
> fiware-orion   | INFO at 10:26:42  logMsg.h[1844]: Starting transaction from 172.18.1.1:57492/v2/entities/urn:ngsi-ld:tempHumid:001/attrs
> fiware-orion   | INFO at 10:26:42  rest.cpp[885]: Service Path 0: '/irrigation'
> fiware-orion   | INFO at 10:26:42  connectionOperations.cpp[239]: Database Operation Successful (count: { _id.id: "urn:ngsi-ld:tempHumid:001", _id.servicePath: { $in: [ /^/irrigation$/ ] } })
> fiware-orion   | INFO at 10:26:42  connectionOperations.cpp[94]: Database Operation Successful (query: { _id.id: "urn:ngsi-ld:tempHumid:001", _id.servicePath: { $in: [ /^/irrigation$/ ] } })
> fiware-orion   | INFO at 10:26:42  connectionOperations.cpp[94]: Database Operation Successful (query: { $or: [ { entities.id: "urn:ngsi-ld:tempHumid:001", $or: [ { entities.type: "tempHumid" }, { entities.type: { $exists: false } } ], entities.isPattern: "false", entities.isTypePattern: { $ne: true }, expiration: { $gt: 1562927202 }, status: { $ne: "inactive" }, servicePath: { $in: [ /^$|^/#$|^/irrigation/#$|^/irrigation$/, null ] } }, { entities.isPattern: "true", entities.isTypePattern: { $ne: true }, expiration: { $gt: 1562927202 }, status: { $ne: "inactive" }, servicePath: { $in: [ /^$|^/#$|^/irrigation/#$|^/irrigation$/, null ] }, $where: function(){for (var i=0; i < this.entities.length; i++) {if (this.enti... }, { entities.isPattern: "false", entities.isTypePattern: true, expiration: { $gt: 1562927202 }, status: { $ne: "inactive" }, servicePath: { $in: [ /^$|^/#$|^/irrigation/#$|^/irrigation$/, null ] }, $where: function(){for (var i=0; i < this.entities.length; i++) {if (this.enti... }, { entities.isPattern: "true", entities.isTypePattern: true, expiration: { $gt: 1562927202 }, status: { $ne: "inactive" }, servicePath: { $in: [ /^$|^/#$|^/irrigation/#$|^/irrigation$/, null ] }, $where: function(){for (var i=0; i < this.entities.length; i++) {if (this.enti... } ] })
> fiware-orion   | INFO at 10:26:42  connectionOperations.cpp[449]: Database Operation Successful (update: <{ _id.id: "urn:ngsi-ld:tempHumid:001", _id.type: "tempHumid", _id.servicePath: { $in: [ /^/irrigation$/ ] } }, { $set: { attrs.on: { value: "ONN", type: "command", mdNames: [], creDate: 1562918839, modDate: 1562927202 }, modDate: 1562927202, lastCorrelator: "8ae2258a-a48f-11e9-baf2-0242ac120106" }, $unset: { location: 1, expDate: 1 } }>)
> fiware-orion   | INFO at 10:26:42  logMsg.h[1874]: Transaction ended
> Querying orion after patch
> {"id":"urn:ngsi-ld:tempHumid:001","type":"tempHumid","TimeInstant":{"type":"DateTime","value":"2019-07-11T18:01:53.00Z","metadata":{}},"deviceState":{"type":"Text","value":" ","metadata":{}},"off_info":{"type":"commandResult","value":" ","metadata":{}},"off_status":{"type":"commandStatus","value":"UNKNOWN","metadata":{}},"on":{"type":"command","value":"ONN","metadata":{}},"on_info":{"type":"commandResult","value":" ","metadata":{}},"on_status":{"type":"commandStatus","value":"UNKNOWN","metadata":{}}}
> nothing was reported in the log of the IoT agent.
> I suppose that I may be able to see something when the command is pushed back to the actuator through the MQTT.fx or in Loraserver as a packet being transmitted.
> Thank you!



--
This message was sent by Atlassian JIRA
(v6.4.1#64016)


More information about the Backlogmanager mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy