ARMmbed / mbed-os-example-lorawan-fuota

Mbed OS 5 Firmware update over LoRaWAN example application
Apache License 2.0
71 stars 31 forks source link

apply_delta_update fails on unexpected patch file data #4

Closed snelson-senet closed 5 years ago

snelson-senet commented 5 years ago

Applying delta update fails with this error logged

Expected ESC but got EF Positions are, source=0 patch=1 new=0 [WARN][LWUC]: apply_deltaupdate failed 1

I've tracked down the issue to bad format of the diff returned by the fota-lorawan-signing-tool. Looking at the implementation, the diff is in the stdout returned by spawnSync(jdiff.js) and for some reason it's not correct; However, when the jdiff command is run with the outfile option set, the diff in the outfile is correct.

I changed the tool to pass jdiff an outfile, and to get the diff from the file. With this change, delta updates are now working for me.

snelson-senet commented 5 years ago

Ah, I should have posted this to the fota-lorawan-signing-tool repository. Moving it now