Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[leshan-dev] Firmware updates using LWM2M / Leshan

Hi,

I've got a basic client / server up and running using Leshan and can read write basic values and execute standalone operations (ex: rebooting a device).

What I would like to do now is the following : Update the firmware of a device that is running the lwm2m client (java based leshan client) 

Am i correct in saying that I need to do the following :

  • Set a correct value for Package URI (/5/0/1), representing a URI that will be used by the client during the firmware update. (ex: a URL where the firmware is located)
  • Execute the actual firmware update (/5/0/2). The LWM2M client needs to read the Package URI to download the new firmware and do what it needs to do to install the new firmware on the device.

I was looking at the LeshanClientExample (https://github.com/jvermillard/leshan/blob/master/leshan-client-example/src/main/java/org/eclipse/leshan/client/example/LeshanClientExample.java) and I can intercept the firmware update action using an ExecutableResource.

From within the ExecutableResource (/5/0/2) handleExecute method, I suppose I need to retrieve the Package URI ? Does Leshan provide a way to read that resource, do I need to execute a Coap call myself ? 

Are there some code samples out there that show how to do this ?

Thanks.




Back to the top