Unable to do FOTA using leshan LWM2M
응답
18. 5. 23 오전 6:55

Hello Everyone,

      I'm trying to update the firmware on the XDK using FOTA. I am using leshan LWM2M server to do the work and to host the bin file using the Californium CoAP server. Both servers are running on diffrent ports but on same machine. What I achieved is as follows:

1. Whenever I'm trying to write the file I get error  Unable to write resource / 5/0/1

2. But if I check the SD card on XDK I see one file named FIRMAWAREUPDATE.BIN, whos size is not equal to the size of the file I am updating.

3. As I try to update the firmware XDK crashesh.

Please gide ,

Best Regards,

Kedar 

0 (0 투표)
RE: Unable to do FOTA using leshan LWM2M
응답
18. 5. 23 오후 12:10 as a reply to Kedar Dahivale.
Hello Kedar,

could you tell me whether the CoAP server from which you provide the binary is supporting blockwise transfer?

If I may quote the part of the specification of the Lwm2m Object Firmware Update :
A LwM2M Server MUST support block-wise transfer

Also, could you tell me what exactly you are writing to resource 5/0/1?

Again, quoting the specification for resource 5/0/1:
The URI format is defined in RFC 3986. For example, coaps://example.org/firmware is a syntactically valid URI. The URI scheme determines the protocol to be used. For CoAP this endpoint MAY be a LwM2M Server but does not necessarily need to be. A CoAP server implementing block-wise transfer is sufficient as a server hosting a firmware repository and the expectation is that this server merely serves as a separate file server making firmware images available to LwM2M Clients.

And finally, what is the size of the file FIRMWAREUPDATE.bin on your SD Card?

Please tell me if this was helpful, and do not hesitate to ask further questions.

Kind regards,
Alex
0 (0 투표)
RE: Unable to do FOTA using leshan LWM2M
응답
18. 5. 25 오후 2:37 as a reply to Alexander Sawtschuk.

Hello Sir,

  Sorry for the late reply.

I am using the Californium CoAP server, I’ve some update on issue.

Now I am able to download full bin file on the sd card throiugh the same server., but now issue is I am unable to flash the file on the XDK. I think I am using the wrong bin file to flash. Can u please tell me which file(bin file) I should host in CoAP server and from where I will get that file?

Best Regards,

Kedar Dahivale

0 (0 투표)
RE: Unable to do FOTA using leshan LWM2M
응답
18. 5. 28 오후 1:58 as a reply to Kedar Dahivale.
Hello Kedar,

FOTA is a feature that is available with XDK Bootloader versions 1.0.0 and higher.

Does your XDK have the correct bootloader? The Bootloader Version is shown in the Devices View in the XDK-Workbench on your device. If the version is below 1.0.0, then you can not use FOTA.

If the version is correct, then the following lines should be printed in the console when you build the application:
 
INFO | Creating Firmware Over the Air (FOTA) Container
INFO | Binary File: /home/alexander/XDK-Workspace/MyProject/debug/MyProject.bin
INFO | Header Version: 0100
INFO | Product Class: 0010
INFO | Product Variant: 0000
INFO | Firmware Version: 00000000


The second line tells you the location of the binary as well.

If that is not printed, then the XDK-Workbench is not building for Bootloader version 1.1.0. Usually, the XDK-Workbench warns you, if you are using mismatched bootloader versions and the XDK would most likely not even start the application after flashing. In any case, if your XDK has bootloader version 1.1.0, then you can let the XDK-Workbench build for XDK-Workbench 1.1.0 by selecting Window > Preferences in the top menu bar.

In the new window that popped up, go to XDK > Bootloader and FOTA. There, select Bootloader version 1.1.0.

If everything is correct and the correct binary is downloaded, then FOTA should be applied correctly.

Please tell me if this was helpful, and do not hesitate to ask further questions.

Kind regards,
Alex
0 (0 투표)
RE: Unable to do FOTA using leshan LWM2M
응답
18. 5. 28 오후 2:56 as a reply to Alexander Sawtschuk.

Hello Sir,

     I have bootloader version 1.1.0 and selected correctely for the project. As per your suggestion I’ve checked the after build result and it looks fine(attaching the screenshot).

It seems that previously also I was using the correct bin file, the path is as per follow.

 INFO | Binary File: /root/XDKWorkspace/BoschXDKCloudConnectivity/debug/BoschXDKCloudConnectivity.bin

Another isssue I am facing now is, now whenever I am trying to write the file from leshan server on XDk, leshan server is unable to send the request to CoAP(Californium Server) which is hosting the bin file. Attaching the screenshot of leshan CoAP messages. I am new to CoAP so unable to understand the issue. 

As you mentioned in your last comment about applying FOTA correctly, can you please elaborate on the same?

Thanking You,

Kedar Dahivale

0 (0 투표)