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

[fiware-stackoverflow] Actives do it perfectly but can´t interact with Lazies and Commands from the Broker

    Details

    • Type: Monitor
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: FIWARE-TECH-HELP
    • Labels:

      Description

      Created question in FIWARE Q/A platform on 12-03-2019 at 15:03
      Please, ANSWER this question AT 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" }

      }
      ]
      }

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2019-03-12 18:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-03-12 18:05|CREATED monitor | # answers= 0, accepted answer= False

          People

          • Assignee:
            fermin Fermín Galán
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: