PelionIoT / mbed-edge

Edge Core
https://izumanetworks.com
Apache License 2.0
25 stars 32 forks source link

device deregistration is not working #22

Open adioanca-rpma opened 4 years ago

adioanca-rpma commented 4 years ago

Hi,

Using pt-example or simple-js-examples/simple-pt-example.js from https://github.com/ARMmbed/mbed-edge-examples, will not make devices deregistered in Pelion Portal.

Here is a screenshot for simple-pt-example device: events-log As you can see there's only one Device deregistered, and that's 1h after the first one, probably because:

#define MBED_CLOUD_CLIENT_LIFETIME 3600

The same stands true for pt-examples 3 devices.

JanneKiiskila commented 4 years ago

Hi @adioanca-rpma ,

please see the documentation at; https://www.pelion.com/docs/device-management-edge/0.11/developer-guide/protocol-translator-development.html - look for chapter entitled "Deregistering a device from Device Management".

It's true that the device will not be deregistered until the Edge lifetime end up, the cloud is informed of the de-registered devices in the update register message, which occurs with the lifetime interval. So, it's behaving as documented as far as I can tell.

Please confirm you agree.

adioanca-rpma commented 4 years ago

Hi @JanneKiiskila ,

https://github.com/ARMmbed/mbed-cloud-client-example/blob/master/main.cpp#L162

de-registers the device in Device Management Portal.

So, the plain client has support for this, and it works. Edge does not do it. Why?

We need to keep live tracking of our devices in our Webapp, and querying Pelion portal is the way to go, in my opinion. Since this is not working in Edge, the workaround would be to send a heartbeat, at a few seconds interval, to know if a/every device is active or not. This would consume(/bill) Pelion Portal transactions, which is not convenient.

ciarmcom commented 4 years ago

ARM Internal Ref: IOTGW-1071