Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active attributes are not correctly observed #112

Open
dcalvoalonso opened this issue Jan 17, 2018 · 11 comments
Open

Active attributes are not correctly observed #112

dcalvoalonso opened this issue Jan 17, 2018 · 11 comments

Comments

@dcalvoalonso
Copy link
Contributor

dcalvoalonso commented Jan 17, 2018

We have been doing some integration tests with real devices and the agent is not able to observe active attributes.

I think that this problem is related to telefonicaid/lwm2m-node-lib#110 and telefonicaid/lwm2m-node-lib#111.

@dcalvoalonso
Copy link
Contributor Author

@fgalan Can you tell us something about this issue? Are you guys supporting https://github.com/telefonicaid/lwm2m-node-lib? @FRDavid @jgato

@fgalan
Copy link
Member

fgalan commented Feb 22, 2018

Not at the present moment... but of course we will be more than happy to review any PR fixing this issue :)

@dcalvoalonso
Copy link
Contributor Author

If I am not wrong, there is an open PR to solve telefonicaid/lwm2m-node-lib#110: telefonicaid/lwm2m-node-lib#111

@fgalan
Copy link
Member

fgalan commented Feb 22, 2018

Thanks for pointing it out! I didn't remember that PR (maybe because if was casted before I start looking to IOTAs stuff :)

So you mean that PR telefonicaid/lwm2m-node-lib#111 solves both issues telefonicaid/lwm2m-node-lib#110 and the present one (#112) isn't it?

@fgalan
Copy link
Member

fgalan commented Feb 22, 2018

(Btw, I have provided feedback on PR telefonicaid/lwm2m-node-lib#111 . As soon as the comment put there gets addressed -very minor- it will be merged)

@fgalan
Copy link
Member

fgalan commented Feb 23, 2018

@dcalvoalonso now that PR telefonicaid/lwm2m-node-lib#111 has been merged (and consecuently telefonicaid/lwm2m-node-lib#110 has been closed), should the present issue be closed?

@dcalvoalonso
Copy link
Contributor Author

Thanks @fgalan. I will do some tests and let you know if it is working now.

@letavia
Copy link

letavia commented Apr 24, 2019

What is the status of this? I tried but still CB does not read the active attributes sent by the client (device).

@fgalan
Copy link
Member

fgalan commented Apr 24, 2019

@letavia could you provide more detail on the test you are doing so that information can be used to reproduce and debug the issue, please?

@letavia
Copy link

letavia commented Apr 25, 2019

I followed the instructions for device provisioning.

Here is my device configuration:

fiware-service: factory 
fiware-servicepath: /robots

payload:

{
  "devices": [
      {
        "device_id": "robot1",
        "entity_type": "Robot",
        "entity_name": "robot01",
        "attributes": [
          {
            "name": "Battery",
            "type": "number"
          }
        ],
        "lazy": [
          {
            "name": "Message",
            "type": "string"
          }
        ],
        "commands": [
          {
            "name": "Position",
            "type": "location"
          }
        ],
      "internal_attributes": {
        "lwm2mResourceMapping": {
          "Battery" : {
            "objectType": 7392,
            "objectInstance": 0,
            "objectResource": 1
          },
          "Message" : {
            "objectType": 7392,
            "objectInstance": 0,
            "objectResource": 2
          },
          "Position" : {
            "objectType": 7392,
            "objectInstance": 0,
            "objectResource": 3
          }
        }
      }
    }
  ]
}

Then I ran iotagent-lwm2m-client.js with all the suggested commands.

I checked the result in context broker:

http://orion:1026/v2/entities/robot01

{
"id": "robot01",
"type": "Robot",
"Battery": {
  "type": "number",
  "value": " ",
  "metadata": {}
},
"Position_info": {
  "type": "commandResult",
  "value": " ",
  "metadata": {}
},
"Position_status": {
  "type": "commandStatus",
  "value": "UNKNOWN",
  "metadata": {}
},
"TimeInstant": {
  "type": "DateTime",
  "value": "2019-04-24T01:48:14.00Z",
  "metadata": {}
},
"Message": {
  "type": "string",
  "value": "First robot here",
  "metadata": {}
},
"Position": {
  "type": "string",
  "value": "[0, 0]",
  "metadata": {}
}
}

The value for Battery attribute was not updated.

LWM2M Client also showed only lazy and command attributes were read.

LWM2M-Client>
Value read:
--------------------------------
-> ObjectType: 7392
-> ObjectId: 0
-> ResourceId: 2
-> Read Value: First robot here
LWM2M-Client>
Value read:
--------------------------------
-> ObjectType: 7392
-> ObjectId: 0
-> ResourceId: 3
-> Read Value: [0, 0]

Whereas the "attributes" is correctly mapped to "active" in IoT Agent database:

{ "_id" : ObjectId("5cbfc05f1c422f001159da73"), "lazy" : [ { "name" : "Message", "type" : "string", "object_id" : "Message" } ], "active" : [ { "name" : "Battery", "type" : "number", "object_id" : "Battery" } ], "commands" : [ { "name" : "Position", "type" : "location", "object_id" : "Position" } ], "subscriptions" : [ ], "creationDate" : ISODate("2019-04-24T01:48:15.351Z"), "id" : "robot1", "type" : "Robot", "name" : "robot01", "service" : "factory", "subservice" : "/robots", "registrationId" : "5cbfc05e75c52beb3d046835", "internalId" : null, "internalAttributes" : { "lwm2mResourceMapping" : { "Battery" : { "objectType" : 7392, "objectInstance" : 0, "objectResource" : 1 }, "Message" : { "objectType" : 7392, "objectInstance" : 0, "objectResource" : 2 }, "Position" : { "objectType" : 7392, "objectInstance" : 0, "objectResource" : 3 } } }, "__v" : 0 }

Let me know if you need more info.

@letavia
Copy link

letavia commented May 6, 2019

any advice on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants