PelionIoT / simple-mbed-cloud-client

Simple interface for Mbed Cloud Client - deprecated
Apache License 2.0
7 stars 21 forks source link

Does not retain device ID between flashes #35

Closed janjongboom closed 5 years ago

janjongboom commented 6 years ago

In the 2.0.0 branch you get a new Device ID every time you flash a new version; even though ROT is set statically. Not sure what is going on.

asanchezdelc commented 6 years ago

I'm having the same issue with https://github.com/ARMmbed/mbed-cloud-client-example without any flashes. Every time the device comes online it creates a new device id on Pelion.

MarceloSalazar commented 6 years ago

In the 2.0.0 branch you get a new Device ID every time you flash a new version

@janjongboom if the device gets a new Device ID every time you flash it, it's because you're overwriting the SOTP region that contains the key to R/W the SD card, when you program a new binary. If you're using the K64 and the latest DAPLink, it shouldn't happen, as it supports (afaik) partial erase sectors. A workaround is to put the SOTP region in the last erase sector (as we do for ST Nucleo platforms)

I'm having the same issue with https://github.com/ARMmbed/mbed-cloud-client-example without any flashes.

@asanchezdelc this is not good; the device shouldn't have a new Device ID after reset when not re-programming. I suspect the SOTP region is being overwritten, or the SD card (or other storage) is being reformated every time. Which platform/application are you using? FYI you can find here a list of apps that are known to work well: https://cloud.mbed.com/quick-start

asanchezdelc commented 6 years ago

@MarceloSalazar I followed the Raspberry Pi 3 guide.

janjongboom commented 6 years ago

@asanchezdelc thanks for reporting, I've pinged core team.

janjongboom commented 6 years ago

@MarceloSalazar Yes, but because the ROT is fixed in developer mode now this should no longer matter.

teetak01 commented 6 years ago

Hi @asanchezdelc Which version of mbed-cloud-client-example are you using? For. ex. running mbed ls will list the full component listing from the application directory. Which board are you using?

The hardcoded RoT for developer-flow was introduced in 1.5.0 version, but the credentials have been preserved between soft-reboots since first release. If you have problems there, could you recompile the application with mbed-trace.enable set to 1 (https://github.com/ARMmbed/mbed-cloud-client-example/blob/master/mbed_app.json#L18). This will printout all the debug information and would give use better idea if something is going wrong.

If you are using https://github.com/ARMmbed/mbed-cloud-client-example you should be using for. ex. https://cloud.mbed.com/docs/current/connecting/mbed-os.html documentation for Mbed OS.

If you instead want to use Raspberry Pi3, you should start with https://cloud.mbed.com/docs/current/connecting/linux-on-raspberry-pi-3.html

and use https://github.com/ARMmbed/mbed-cloud-client-yocto-setup repository as base.

teetak01 commented 6 years ago

Also make sure that you have not compiled the application with -DRESET_STORAGE or similar flag which will format the storage with every reboot.

janjongboom commented 5 years ago

Fixed in 2.0.1 at least for simple client.