# FOTA baseline Legato System

**URL:** https://forum.legato.io/t/fota-baseline-legato-system/4626
**Category:** Legato Application Framework
**Created:** [August 9, 2019, 7:55am UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626 "2019-08-09T07:55:29Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)
#### Post date: [August 9, 2019, 7:55am UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/1 "2019-08-09T07:55:29Z")

</div>

Hi

I’m having trouble installing a new Baseline bundle with my updated legato system. I’m making my own Legato system with a few of my apps included. If I update my apps only, I experience roll backs to the old baseline system at times and that is not an issue with a baseline update.

I tried to upgrade my Legato system to a newer version (from 18.02 → 18.06.4 WP8548) OTA but then I got a **certificate error** next time I try to run a FOTA and they seem locked from installing new updates OTA now!

So sticking with the same legato version but modifying my apps and then build and install this new Legato system seem like the best solution so far. (except the 5-6MB of data it consumes)

But the problem is that Airvantage claims the update failed even tho it works. This is because of the expected Legato version is not the same as the actual legato version. **Unexpected final version [LE=18.06.4]** If I put **revision=“LE18.06.4”** in my **manifest.app** it will not install as my system thinks that it is the same version as the old. If I put **LE=18.06.4\_38ccaf4084e6a259c96ccf8f247dcb0f** it will install but I will get the Unexpected final version error as **GetLegatoVersion()** only responds with **Legato version = 18.06.4, len 7** while writing **legato version** on the command line responds: **18.06.4\_38ccaf4084e6a259c96ccf8f247dcb0f**

Anybody able to help me with this?

---

<div class="post-metadata">

### Author: ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)
#### Post date: [August 13, 2019, 4:10pm UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/2 "2019-08-13T16:10:31Z")

</div>

@nilsa Can you share your manifest file?

---

<div class="post-metadata">

### Author: ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)
#### Post date: [August 14, 2019, 7:00am UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/3 "2019-08-14T07:00:25Z")

</div>

Sure!

```
<?xml version="1.0" encoding="UTF-8"?>
<app:application xmlns:app="http://www.sierrawireless.com/airvantage/application/1.0" name="WP8548_GW_v1.0.0RC1" type="WP8548" revision="LE=18.06.4_38ccaf4084e6a259c96ccf8f247dcb0f">
  <binaries>
    <binary file="legato.cwe"/>
  </binaries>
<application-manager use="LWM2M_AIRPRIME_BUNDLE"/>
</app:application>

```

---

<div class="post-metadata">

### Author: ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)
#### Post date: [August 14, 2019, 11:07am UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/4 "2019-08-14T11:07:36Z")

</div>

Did also try to define LEGATO\_VERSION in buildVars of my sdef file by setting something like

```
buildVars:
{
    LEGATO_VERSION = "18.06.4_GWv1.0.0RC1"
}

```

And then the same revision in my manifest.app but that did not work either…

---

<div class="post-metadata">

### Author: ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)
#### Post date: [August 14, 2019, 4:19pm UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/5 "2019-08-14T16:19:43Z")

</div>

@nilsa, This matches what this document states [https://source.sierrawireless.com/resources/airprime/application\_notes\_and\_code\_samples/airprime\_-_wp\_series_-\_airvantage\_fota\_sota\_guidelines/](https://source.sierrawireless.com/resources/airprime/application_notes_and_code_samples/airprime_-_wp_series_-_airvantage_fota_sota_guidelines/)

I know we had trouble with this and a previous dev worked around it by creating a custom Legato version but I was hoping the above document would have solved this issue and we could dispense with the custom version.

Have you tried posting in the Mangoh forum or contacting Sierra support, if you do manage to get response I’d appreciate it if you could share that with me.

---

<div class="post-metadata">

### Author: ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)
#### Post date: [August 14, 2019, 10:03pm UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/6 "2019-08-14T22:03:48Z")

</div>

Yes have read that document many times now😉

Do you have any more info about this custom version?  
Maybe it works in legato 19.04?

Yes I’m in contact with sierra support and they suggested the buildVars modification…

---

<div class="post-metadata">

### Author: ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)
#### Post date: [August 14, 2019, 11:08pm UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/7 "2019-08-14T23:08:43Z")

</div>

@nilsa The custom version method was definitely a hack and something we moved away from. I was able to successfully FOTA a unit from 18.09.0 to 19.02.0 today. This was a “Full Device image bundle”, \>50MB.

Are you trying to update systems at the same Legato version or are you doing major version updates?

---

<div class="post-metadata">

### Author: ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)
#### Post date: [August 15, 2019, 6:00am UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/8 "2019-08-15T06:00:46Z")

</div>

Ok. Updating systems with different legato versions works but we updated like 10 devices with WP8548 with R15 firmware and legato 18.02 to legato 18.06.4. That worked fine but next time we tried to run FOTA on one of theese devices (App or system or whatever) we get a certificate error and downloading of new update/cwe/spk failes. So we have learned to be carefull when upgrading legato only.

We want to upgrade systems with the same lagato version like 18.06.4 to another 18.06.4 but does not work like it should.

> [@nilsa](#):
>
> But the problem is that Airvantage claims the update failed even tho it works. This is because of the expected Legato version is not the same as the actual legato version. **Unexpected final version [LE=18.06.4]** If I put **revision=“LE18.06.4”** in my **manifest.app** it will not install as my system thinks that it is the same version as the old. If I put **LE=18.06.4\_38ccaf4084e6a259c96ccf8f247dcb0f** it will install but I will get the Unexpected final version error as **GetLegatoVersion()** only responds with **Legato version = 18.06.4, len 7** while writing **legato version** on the command line responds: **18.06.4\_38ccaf4084e6a259c96ccf8f247dcb0f**

---

<div class="post-metadata">

### Author: ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)
#### Post date: [August 15, 2019, 1:45pm UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/9 "2019-08-15T13:45:34Z")

</div>

@dbeckwith have you managed to get an overlay legato system bundle or delta system bundle to work? (with .update file)  
When I try to install a .update bundle I only get:  
**Read operation failure [legato.1.0.3: BAD\_REQUEST,legato.1.0.5: BAD\_REQUEST]** but I have not had the time to explore this further.

---

<div class="post-metadata">

### Author: ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)
#### Post date: [August 15, 2019, 4:09pm UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/10 "2019-08-15T16:09:29Z")

</div>

@nilsa No I haven’t tried an overlay or delta system bundle SOTA because we have seen rollback (even on overlays that are marked good) issues when our device battery voltages get low. At the moment our plan is to only do FOTA’s with either a “Full Device” bundle or a partial device bundle (IE: just the new version of Legato and apps).

We would like to be able to update apps at the same version of Legato but I was thinking of doing this as a partial bundle.

Has Sierra support been able to provide any guidance?

Darren

---

<div class="post-metadata">

### Author: ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)
#### Post date: [August 15, 2019, 6:25pm UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/11 "2019-08-15T18:25:35Z")

</div>

Yeah I see what you are saying ReadLegatoVersion() in osPortDevice.c reads the full Legato version string from the file but then tokenizes it at the ‘\_’ stripping off the hash, which is weird.

---

<div class="post-metadata">

### Author: ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)
#### Post date: [August 16, 2019, 6:20am UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/12 "2019-08-16T06:20:51Z")

</div>

Yes we experience rollbacks on good systems as well but that is to be expected says sierra support as we always have to power down the system in the right manner… That is why we also want to do baseline (FOTA) updates of the complete legato system. But just for testing I wanted to make SOTA or overlay system update work but of course that fails as well.

Yeah I was checking in on osPortDevice.c as well and what is now called ReadLagatoVersion() vas called GetLegatoVersion() in legato 18.08 and older… So there has been some changes to this file but we still just get the stripped legato version string.

---

<div class="post-metadata">

### Author: ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)
#### Post date: [August 19, 2019, 4:31pm UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/13 "2019-08-19T16:31:24Z")

</div>

@nilsa I was able to FOTA a unit from 18.09.0 to 19.02.0 using a partial device image last week. I also tried 19.02.0 to 19.02.0 (the same version and hash). This failed with the version check we are talking about above.

I am planning on reaching out to my Sierra support contacts today as well.

---

<div class="post-metadata">

### Author: ![dbeckwith](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dbeckwith/32/663_2.png) [@dbeckwith](https://forum.legato.io/u/dbeckwith)
#### Post date: [September 26, 2019, 2:53am UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/14 "2019-09-26T02:53:52Z")

</div>

@nilsa

Were you able to make it any further with updating at the same Legato version?

---

<div class="post-metadata">

### Author: ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)
#### Post date: [September 27, 2019, 10:00am UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/15 "2019-09-27T10:00:30Z")

</div>

Well I did not try it but the response from support was to make a custom legato name by adding export LEGATO\_VERSION=“custom name” in the legato makefile and then recompile legato from scratch.

---

<div class="post-metadata">

### Author: ![mehdiALL1](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mehdiALL1](https://forum.legato.io/u/mehdiALL1)
#### Post date: [November 21, 2019, 8:44am UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/16 "2019-11-21T08:44:47Z")

</div>

@nilsa, you modified just the Makefile! your manifest still the same?

---

<div class="post-metadata">

### Author: ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)
#### Post date: [November 21, 2019, 11:34am UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/17 "2019-11-21T11:34:21Z")

</div>

Did not test any further as I use leaf and I ran into problems recompiling legato.

But if anybody does test this I would love to hear about it.

---

<div class="post-metadata">

### Author: ![cchenry](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@cchenry](https://forum.legato.io/u/cchenry)
#### Post date: [November 22, 2019, 7:52am UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/18 "2019-11-22T07:52:52Z")

</div>

Hi nilsa,  
AirVantage determines the uniqueness of a package by comparing the Device Type and the Revision. In newer versions of Legato, only the short form of the version string is passed to AV in the LWM2M message. As you’ve noticed, this means that you can only have a single package with for that Legato version.

To resolve the issue, you have 2 options, but both require re-building Legato.

1. As support suggested, if you build Legato with the LEGATO\_VERSION environment variable set to a custom value, this will enable the firmware to report your custom version in the LWM2M message. You’d also need to change your AV package with the same version. Also ensure that your custom version is unique for each of your releases.

2. Older versions of Legato (I’m unsure which version the change was made) included the hash when the Legato version was returned in the LWM2M object. You could patch the framework to report the hash in the object, then you don’t need to change the manifest. However, you do need to ensure the hash changes each build. If you’re using the Yocto build environment, it’s simple. Just add this line to legato-af.bbappend:

If you’re building Legato using the standalone makefile, you’ll need to come up with a way to ensure the hash changes.

BR,  
Chris

---

<div class="post-metadata">

### Author: ![nilsa](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nilsa](https://forum.legato.io/u/nilsa)
#### Post date: [November 22, 2019, 11:03am UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/19 "2019-11-22T11:03:02Z")

</div>

Tanks for the info @cchenry 😃

At the moment I just add some metadata, like \_FW\_project, to the device type in order to have several bundles with the same legato version in Airvantage. But that does not fix the issue with updating a WP with a new bundle with the same legato version.

Option 1 sounds best to me.  
But how do I build Legato with leaf?  
Do I go to leaf-data/profile/wp85-legato/ and just build wp85 with custom LEGATO\_VERSION?  
And then move the legato.cwe file to wp85-legato-image?

---

<div class="post-metadata">

### Author: ![mehdiALL1](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mehdiALL1](https://forum.legato.io/u/mehdiALL1)
#### Post date: [December 6, 2019, 5:03pm UTC](https://forum.legato.io/t/fota-baseline-legato-system/4626/20 "2019-12-06T17:03:35Z")

</div>

> [@nilsa](#):
>
> But how do I build Legato with leaf?

You need to switch to the source code mode with “leaf getsrc swi-legato”, after that you will get the legato source and build your legato sys.

You should not modify " or this is not a proper method) the content of the “leaf-data/profile/wp85-legato/” package as they might be shared between multiple workspaces

[Next page](https://forum.legato.io/t/fota-baseline-legato-system/4626.md?page=2)
