[Backlogmanager] [FIWARE-JIRA] (HELP-15560) [fiware-stackoverflow] Actives do it perfectly but can´ t interact with Lazies and Commands from the Broker

Fernando Lopez (JIRA) jira-help-desk at jira.fiware.org
Fri Apr 5 10:31:00 CEST 2019


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

Fernando Lopez reassigned HELP-15560:
-------------------------------------

    Assignee: Fermín Galán  (was: Jose Gato Luis)

> [fiware-stackoverflow] Actives do it perfectly but can´t interact with Lazies and Commands from the Broker
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: HELP-15560
>                 URL: https://jira.fiware.org/browse/HELP-15560
>             Project: Help-Desk
>          Issue Type: Monitor
>          Components: FIWARE-TECH-HELP
>            Reporter: Backlog Manager
>            Assignee: Fermín Galán
>              Labels: fiware
>
> Created question in FIWARE Q/A platform on 12-03-2019 at 15:03
> {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/55124106/actives-do-it-perfectly-but-can%c2%b4t-interact-with-lazies-and-commands-from-the-bro
> +Question:+
> Actives do it perfectly but can´t interact with Lazies and Commands from the Broker
> +Description:+
> As for what I think "not answered question " in Fiware IotAgent: can't send command to a device, I tried to implement the example in https://fiware-iotagent-lwm2m.readthedocs.io/en/latest/deviceProvisioning/index.html but, I am not being able to interact with both Lazy and Command attributes from the Broker. I tried with Orion V1 and V2 querying both from Postman and .sh files and the error code below remains.
> {
> "errorCode": {
>     "code": "404",
>     "reasonPhrase": "No context element found"
> }
> }
> The readings work just perfectly. Hence, I can see the updated active attributes values in Broker when running a series of SET > in the LwM2M client.js.
> Both Fiware GEs (Agent and Broker) are running in the same VMWare Workstation/Fiware Instance.
> Following I have the main configurations I am using and can share more details if needed. Any help will be more than welcome!
> *1) docker-compose.yml *
> version: '2'
> services:
>  mongodb:
>     image: fiware/tutorials.tourguide-app.restaurant-data:20161011
>     hostname: mongodb
>     container_name: mongodb
>     ports:
>       - "27017:27017"
>     expose:
>     - '27017'
>     command: --smallfiles
>     logging:
>        options:
>          max-size: 50m
>  orionunified:
>     image: fiware/orion:2.1.0
>     hostname: orionunified
>     container_name: orionunified
>     links:
>     - mongodb
>     expose:
>     - '1026'
>     ports:
>     - 9014:1026
>     command: -dbhost mongodb
>     logging:
>        options:
>          max-size: 50m
>  idaslwm2m:
>     image: telefonicaiot/lightweightm2m-iotagent:latest
>     hostname: idaslwm2m
>     container_name: idaslwm2m
>     restart: on-failure
>     links:
>     - orionunified
>     - mongodb:mongo
>     expose:
>     - '5684'
>     - '4041'
>     ports:
>     - 9008:4041
>     - 9009:5684
>     volumes:
>     - ./configurations/IdasLWM2M/config.js:/opt/iota-lwm2m/config.js
>     logging:
>        options:
>          max-size: 50m
> 2) ./configurations/IdasLWM2M/config.js:/opt/iota-lwm2m/config.js EQUALS to lightweightm2m-iotagent/config.js
> var config = {};
> config.lwm2m = {
>     logLevel: 'DEBUG',
>     port: 5684,
>     defaultType: 'Robot',
>     ipProtocol: 'udp4',
>     serverProtocol: 'udp4',
>     delayedObservationTimeout: 50,
>     formats: [
>         {
>             name: 'application-vnd-oma-lwm2m/text',
>             value: 1541
>         },
>         {
>             name: 'application-vnd-oma-lwm2m/tlv',
>             value: 1542
>         },
>         {
>             name: 'application-vnd-oma-lwm2m/json',
>             value: 1543
>         },
>         {
>             name: 'application-vnd-oma-lwm2m/opaque',
>             value: 1544
>         }
>     ],
>     writeFormat: 'application-vnd-oma-lwm2m/text',
>     types: [ ]
> };
> config.ngsi = {
>     logLevel: 'DEBUG',
>     contextBroker: {
>         host: 'orionunified',
>         port: '1026'
>     },
>     server: {
>         port: 4041
>     },
>     deviceRegistry: {
>         //type: 'memory'
>         type: 'mongodb'
>     },
>     mongodb: {
>         host: 'mongo',
>         port: '27017',
>         db: 'iotagentlm2m'
>         //replicaSet: ''
>     },
>     types: { },
>     service: 'factory',
>     subservice: '/robots',
>     providerUrl: 'http://idaslwm2m:4041',
>     deviceRegistrationDuration: 'P1Y',
>     defaultType: 'Robot'
> };
> module.exports = config;
> *3) Device created in Agent *
> {
>     "count": 1,
>     "devices": [
>         {
>             "device_id": "robot1",
>             "service": "factory",
>             "service_path": "/robots",
>             "entity_name": "Robot:robot1",
>             "entity_type": "Robot",
>             "attributes": [
>                 {
>                     "object_id": "Battery",
>                     "name": "Battery",
>                     "type": "number"
>                 }
>             ],
>             "lazy": [
>                 {
>                     "object_id": "Message",
>                     "name": "Message",
>                     "type": "string"
>                 }
>             ],
>             "commands": [
>                 {
>                     "object_id": "Position",
>                     "name": "Position",
>                     "type": "location"
>                 }
>             ],
>             "static_attributes": [],
>             "internal_attributes": {
>                 "lwm2mResourceMapping": {
>                     "Battery": {
>                         "objectType": 7392,
>                         "objectInstance": 0,
>                         "objectResource": 1
>                     },
>                     "Message": {
>                         "objectType": 7392,
>                         "objectInstance": 0,
>                         "objectResource": 2
>                     },
>                     "Position": {
>                         "objectType": 7392,
>                         "objectInstance": 0,
>                         "objectResource": 3
>                     }
>                 }
>             }
>         }
>     ]
> }
> *4) Entity created in the Broker, with an updated Active attribute reading *
> {
>     "contextResponses": [
>         {
>             "contextElement": {
>                 "type": "Robot",
>                 "isPattern": "false",
>                 "id": "Robot:robot1",
>                 "attributes": [
>                     {
>                         "name": "Battery",
>                         "type": "number",
>                         "value": "1200"
>                     },
>                     {
>                         "name": "Position_info",
>                         "type": "commandResult",
>                         "value": " "
>                     },
>                     {
>                         "name": "Position_status",
>                         "type": "commandStatus",
>                         "value": "UNKNOWN"
>                     }
>                 ]
>             },
>             "statusCode": {
>                 "code": "200",
>                 "reasonPhrase": "OK"
>             }
>         }
>     ]
> }



--
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